Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to register OUT param to RECORD type for STORED PROCEDURE???

 
java freak
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i have a SP like this


CREATE OR REPLACE PACKAGE P1 AS

TYPE g_con_ref_cursor is REF CURSOR ;

TYPE g_con_error IS RECORD
(
error_code NUMBER,
error_desc varchar2(2000)
);

PROCEDURE PROC_CURSOR
(i_str_userid IN VARCHAR2,
o_cur_ref_cur OUT g_con_ref_cursor,
o_rec_error OUT g_con_error,
o_num_status OUT NUMBER);

END;



and now i am trying to call this SP using my java program
i am able to register the out put params for 2nd and 4 th variable

my doubt is how i can register the output param for 3rd (g_con_error) which is of record type

and how i can get result from this ???

my java program is like this

Connection connection = DatabaseHelper.prepareConnection();
CallableStatement proc = connection.prepareCall("{ call P1.PROC_CURSOR(?, ?, ?, ?) }");
proc.setString(1,"jn26557");
proc.registerOutParameter(2,oracle.jdbc.driver.OracleTypes.CURSOR);
proc.registerOutParameter(3,???,???); //HOW TO SET THIS ???
proc.registerOutParameter(4,oracle.jdbc.driver.OracleTypes.NUMERIC);
proc.execute();


plz help me in this
i have no idea how to do it

any help would be appreciated


Thanks in advance
Jaya Prakash Nalajala
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaya,
If you haven't done so already, I suggest visiting the following Web page:

http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html

It has links to sample code and documentation.

As far as I know, what you are trying to do is not supported by Oracle's JDBC driver.

Instead of a record, you may be able to define some object type -- and that (I think) is supported. Again, the sample code available (from the above Web page) illustrates how to do this (if I remember correctly).

Good Luck,
Avi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic