wood burning stoves 2.0*
The moose likes JDBC and the fly likes How  to read a pl/sql table which is an OUT parameter from a stored proc from java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How  to read a pl/sql table which is an OUT parameter from a stored proc from java?" Watch "How  to read a pl/sql table which is an OUT parameter from a stored proc from java?" New topic
Author

How to read a pl/sql table which is an OUT parameter from a stored proc from java?

mamata surapaneni
Greenhorn

Joined: Jul 24, 2007
Posts: 10
Hi,
I have my code:

CURSOR C1 IS SELECT .........;
TYPE T1 is TABLE OF C1%ROWTYPE INDEX BY INTEGER;
TYPE T2 IS TABLE OF T1 INDEX BY BINARY INTEGER;

CREATE OR REPLACE PROCEDURE P1( OUT T2) IS
{}

I am trying to read T2 from my java code.
How to register this OUT parameter in java code?
vanlalhmangaiha khiangte
Ranch Hand

Joined: Sep 11, 2006
Posts: 170
You can use java.sql.Array .. you can read more about it here

Suppose that input and output parameters IN_PHONE and OUT_PHONE in stored procedure GET_EMP_DATA are arrays that are defined like this:
CREATE TYPE PHONENUMBERS AS VARCHAR(10) ARRAY[5]
Call GET_EMP_DATA with the two parameters.



Hope this helps ..
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1121

Mamata,
Please note that Vanlalhmangaiha's example uses a database type which is a VARRAY, whereas your example uses a PL/SQL table type.
As far as I know, Vanlalhmangaiha's example does not work with PL/SQL table types.

Good Luck,
Avi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to read a pl/sql table which is an OUT parameter from a stored proc from java?
 
Similar Threads
Type inference in generic mehods
Doubt in String ==
Custom Annotations changing Source Code
Deadlocks in Threads?
DELETE using subquery