CodeIgniter Forums

Full Version: oracle database with codeigniter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]selvercode[/eluser]
hello i created procedure and function in oracle database
----------
i called procedure from codeiginter as:
$this->db->stored_procedure('PRODUCT_ACTIONS', 'INSERT_PRODUCT', $param);
ok it make insert success but if not insert success how i can
handeled this or how i kown if not insert ??
-----
and how i can called function from codeiginiter and "get returnd value"??
plz can any one help me ?
Code:
create or replace PROCEDURE INSERT_PRODUCT
(PRODUCT_NAME IN VARCHAR2
, PRODUCT_NUMBER IN VARCHAR2
) AS
BEGIN
  Insert into PRODUCTS (PRODUCT_NAME,PRODUCT_NUMBER) values (PRODUCT_NAME,PRODUCT_NUMBER);
EXCEPTION
  WHEN OTHERS
  THEN
    raise_application_error(-20001,'An error was FF encountered - '||SQLCODE||' -ERROR- ');
END INSERT_PRODUCT;
-----
Code:
create or replace FUNCTION ADD_NEW
(
  PARAM1 IN NUMBER
, PARAM2 IN VARCHAR2
, PARAM3 IN VARCHAR2
) RETURN NUMBER AS
BEGIN
  Insert INTO PRODUCTS (PRODUCT_NAME,PRODUCT_NUMBER) values (PARAM2,PARAM3);
  RETURN 1;
END ADD_NEW;