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 return cusror from PL/SQL script?

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to return cursor from pl/sql procedures to java and other front end tools?

Thanks in advance,
Yamini
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try on google.

There are number of results.

Shailesh
[ April 07, 2005: Message edited by: Shailesh Chandra ]
 
Kash Mhai
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Declare the out parameter for the procedure as recordset
Eg.// o_out_data OUT PKG_NAME.recordset
2. use -
OPEN o_out_data
FOR
//SELECT STATEMENT GOES HERE
3. End of the package.

This should be accessed through Java as
cstmt.registerOutParameter(1,OracleTypes.CURSOR);
and to cast it into ResultSet
rs = (ResultSet)cstmt.getObject(1);

This should work.

Have fun..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic