• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

Invoking a Oracle Stored Proc which takes a REF CURSOR as a IN parameter

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to invoke a SP using JDBC where in one of the IN parameters to the SP is a REF CURSOR.
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you sure In parameter is REF CURSOR.... ???

I think it would be out parameter


For out parameter

registerOutParameter as oracle.jdbc.driver.OracleTypes.CURSOR

then get the output of CallableStatement as Object

eg:

let you have sp_abcd ( input_variable ,out_cursor) a stored procedure

CallableStatement cs = conn.prepareCall("execute sp_abcd(?,?)")

cs.setString(1,String_variable);
cs.registerOutParameter(2,oracle.jdbc.driver.OracleTypes.CURSOR)

ResultSet rs = (ResultSet) cs.getObject(2);

then you can process your REF CURSOR as resultset


For In parameter

If You have a In paramter as REF CURSOUR then how you are planning to pass your REF CURSOR

if you input ref cursor is output of another strored procedure

then you can do same in either way

one > Call you sp haveing parameter from previous one SP

two > If you are getting you ref cursor after executing a SP from Java then
you can set it as
cs.setObject(2, (Object) your ref cursor, Oracle.jdbc.driver.OracleTypes.CURSOR)




hope this work for you
[ November 03, 2004: Message edited by: Shailesh Chandra ]
 
Akshay Sharma
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its a IN parameter my dear.
 
Shailesh Chandra
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just edited my last post kindly refer again
 
Akshay Sharma
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No I am wondering if this is possible
I dont have any such condition as mentioned in your edited note
 
Shailesh Chandra
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Akshay Sharma:


I dont have any such condition as mentioned in your edited note



So what is your condtion

Or it was just a thought, if we can do it or not ....???
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to invoke a Oracle Stored Proc which takes a REF CURSOR as a IN parameter. If yes. how?
 
They weren't very bright, but they were very, very big. Ad contrast:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!