Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
mamata surapaneni
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic