my dog learned polymorphism*
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
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
Error in Oracle like clause
Handling cursor declared in oracle in java program
ORA-06550: line 1, column 36: PLS-00103: Encountered the symbol ";"
Problem in executing Oracle Function from JSP Page
registerOutParameter Problem when the type is ARRAY