Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
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
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • 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.
 
All of life is a contant education - Eleanor Roosevelt. Tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic