Skip to Content
0
Former Member
Jun 18, 2007 at 08:58 AM

JDBC Adapter call Oracle Procedure with REF CURSOR Type Input

87 Views

Hi All,

I have scenario to calling oracle storeprocedure with ref cursor input type. This is the sample oracle procedure code :

CREATE OR REPLACE PACKAGE DB2_PAYSLIP IS

CURSOR c_details IS

SELECT '' in_nogaji

, '' in_jenis

, '' in_no

, '' in_deskripsi

, '' in_jumlah

FROM DUAL;

TYPE ct_details IS REF CURSOR RETURN c_details%ROWTYPE;

END;

CREATE OR REPLACE PROCEDURE proc_ins_payslip(in_cur IN OUT db2_payslip.ct_details) IS

v_in db2_payslip.c_details%ROWTYPE;

BEGIN

LOOP

FETCH in_cur INTO v_in;

INSERT INTO PAYSLIP_DETAIL VALUES(v_in.in_nogaji,v_in.in_jenis,v_in.in_no,v_in.in_deskripsi,v_in.in_jumlah);

EXIT WHEN in_cur%NOTFOUND;

END LOOP;

CLOSE in_cur;

COMMIT;

END;

How to design my data type in order to support calling this oracle store procedure.

Please help me.

Regards

Fernand