Author
OUT as Table in StoreProcedure
Prashant Saraf
Ranch Hand
Joined: Sep 25, 2006
Messages: 30
posted Feb 03, 2010 23:08:33
Hi,
I have an oracle store procedure which return TABLE RECORD
here is procedure
I want to know how to read OUT of above procedure.
Thanks
This message was edited 1 time. Last update was at Feb 03, 2010 23:09:04 by Prashant Saraf
Jan Cumps
Bartender
Joined: Dec 20, 2006
Messages: 1112
posted Feb 04, 2010 00:31:38
Do you want to know how to read this OUT parameter in Java , with JDBC?
tune in turn on phase out
ITIL Foundation
OMG UML Fundamental
Prashant Saraf
Ranch Hand
Joined: Sep 25, 2006
Messages: 30
posted Feb 04, 2010 00:46:07
Jan Cumps wrote: Do you want to know how to read this OUT parameter in Java, with JDBC?
I do know how to read OUT for Procedure. I want to know how to read the OUT of RECORD TABLE type?
Jan Cumps
Bartender
Joined: Dec 20, 2006
Messages: 1112
posted Feb 04, 2010 01:05:39
Prashant,
my excuses, but I still don't understand it.
Where do you want to read the OUT parameter?
In a pl/sql program? In a java program? Somewhere else?
Can you post the piece of code where you are trying to read the OUT parameter?
This message was edited 1 time. Last update was at Feb 04, 2010 01:06:44 by Jan Cumps
tune in turn on phase out
ITIL Foundation
OMG UML Fundamental
Prashant Saraf
Ranch Hand
Joined: Sep 25, 2006
Messages: 30
posted Feb 04, 2010 01:37:24
Jan Cumps wrote: Prashant,
my excuses, but I still don't understand it.
Where do you want to read the OUT parameter?
In a pl/sql program? In a java program? Somewhere else?
Can you post the piece of code where you are trying to read the OUT parameter?
Sorry Jan, I am using JDBC to read the OUT Parameter.
Java Code is
I want to know what Type to use in registerOutParameter method.
Thanks
Prashant
This message was edited 1 time. Last update was at Feb 04, 2010 01:40:22 by Prashant Saraf
Jan Cumps
Bartender
Joined: Dec 20, 2006
Messages: 1112
posted Feb 04, 2010 03:17:19
The procedure has 2 parameters and is called getChildRelationsByInstanceId , and the JDBC code shows three parameters (question marks) and is called proc3.
tune in turn on phase out
ITIL Foundation
OMG UML Fundamental
Jan Cumps
Bartender
Joined: Dec 20, 2006
Messages: 1112
posted Feb 04, 2010 03:31:13
Here is the way to retrieve user defined types:
http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/objects/ObjectTypes.html
If you can write your stored procedure so that it returns a cursor to that table, you can programs your JBDC like this:
http://www.enterprisedt.com/publications/oracle/result_set.html
tune in turn on phase out
ITIL Foundation
OMG UML Fundamental
Prashant Saraf
Ranch Hand
Joined: Sep 25, 2006
Messages: 30
posted Feb 05, 2010 04:59:05
hi
here is my code
On cstmt.execute(); it throws following exception.
my procedure returns TABLE of RECORD.
Please help