Its been an hour I m having trouble executing oracle stored procedures in Codeigniter 2. I m not being able to find proper documentation for CI+Stored procedures.
My Stored Procedure :
CREATE OR REPLACE
PROCEDURE SP_DISTRICT_INSERT(P_DST_NAME VARCHAR2, FLAG VARCHAR2 Default '0',P_USER_ID Number) AS
PKEY NUMBER:=0;
BEGIN
SELECT MAX(NVL(DST_ID,0))+1 INTO PKEY FROM DISTRICT ;
INSERT INTO DISTRICT(DST_ID, DST_NAME, USER_ID, ENTERED_DATE, FLAG) VALUES(PKEY,P_DST_NAME,P_USER_ID,SYSDATE ,FLAG);
COMMIT ;
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR (-20001,PKEY|| 'INVALID_NO'|| P_DST_NAME|| 'DATAMISMATCH'|| SQLERRM, TRUE) ;
END SP_DISTRICT_INSERT ;
AND I executed stored procedure in my model like this
$ins=$this->db->query("call SP_DISTRICT_INSERT('abcdxyz',1,1)");
The page showing error
Error Number:
call SP_DISTRICT_INSERT('abcdxyz',1,1)
Filename: D:\xampp\htdocs\..\database\DB_driver.php
Line Number: 330
However,
If i call procedure directly from Navicat, it works
Any help will be appreciated.
P.S. I m using Codeigniter 2 and Oracle 11g
Thanks
Well the problem was database field length. The scenario is that after form submission, the input string is converted into unicode format like 
. So if database field length is 10 and i input string with 4 characters, the procedure returned error because 4 characters when converted into unicode format becomes around 24 characters which is bigger than the allowed length in database field.