Need to access a RECORD type returned by a DB package.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   madhuri_chalke
Posted On:   Tuesday, September 7, 2004 02:27 AM

I have a database package which contains a procedure that returns a RECORD TYPE. The record type is defined as follows in the package: TYPE job_rectype IS RECORD(    emp_id employee.emp_id%type,    emp_name employee.emp_name%type,    emp_lastname employee.emp_lastname%type,    dept_id department.dept_id%type    dept_name department.dept_name%type); The package returns the above record type, and I am unable to access it in a CallableStatment. Here is the code I use: The procedure takes in 3 parameters emp_id, dept_id and returns the record type as the 3rd parameter. CallableStatement cstmt = dbConn.prepareCall("{call DP_TEST.TEST_S   More>>

I have a database package which contains a procedure that returns a RECORD TYPE. The record type is defined as follows in the package:


TYPE job_rectype IS RECORD(

   emp_id employee.emp_id%type,

   emp_name employee.emp_name%type,

   emp_lastname employee.emp_lastname%type,

   dept_id department.dept_id%type

   dept_name department.dept_name%type);


The package returns the above record type, and I am unable to access it in a CallableStatment. Here is the code I use:
The procedure takes in 3 parameters emp_id, dept_id and returns the record type as the 3rd parameter.



CallableStatement cstmt = dbConn.prepareCall("{call DP_TEST.TEST_STATEMENT(?,?,?)}");



cstmt.setString(1, "EMP100061");

cstmt.setString(2, "20");

cstmt.registerOutParameter(3, OracleTypes.CURSOR);

cstmt.execute();

ResultSet rset = (ResultSet)cstmt.getObject(3);



I have also tried using:

ResultSet rset = ((OracleCallableStatement)cstmt).getCursor(3);


But still cannot.


Need help I am unable to access the record type returned.

   <<Less
About | Sitemap | Contact