aspose file tools*
The moose likes JDBC and the fly likes how to return the index by variable from pl/sql to java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to return the index by variable from pl/sql to java" Watch "how to return the index by variable from pl/sql to java" New topic
Author

how to return the index by variable from pl/sql to java

ganeshjanu janu
Greenhorn

Joined: Mar 25, 2008
Posts: 1
Hi,
I have the problem for the following scenario,

String SP ="{? = call f1() }";
lCallableStatement = conn.prepareCall(SP);
lCallableStatement.registerOutParameter(1,Types.STRUCT);
lCallableStatement.execute();

At back end(oracle):
SQL> create or replace package p1
as
type a is table of varchar2(20) index by varchar2(20);
end p1;
/

Package created.

SQL> create or replace function f1 return p1.a
2 as
3 o1 p1.a;
4 begin
5 o1('active'):='true';
6 dbms_output.put_line('val is'||o1('active'));
7 return o1;
8 end;
9 /

Function created.

BUG:
but i got the error while run the code.

SQ exception:2002 invalid column type:


If anyone have the suggestion then tell me.
with regards,
ganesh.s
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to return the index by variable from pl/sql to java
 
Similar Threads
registerOutParameter Problem when the type is ARRAY
Handling cursor declared in oracle in java program
Problem in executing Oracle Function from JSP Page
Error in Oracle like clause
ORA-06550: line 1, column 36: PLS-00103: Encountered the symbol ";"