Home » SQL & PL/SQL » SQL & PL/SQL » java stored procedure with ref cursor
java stored procedure with ref cursor [message #220840] Thu, 22 February 2007 06:16 Go to next message
ratan2204
Messages: 2
Registered: February 2007
Junior Member
Hi,

I have written a java stored procedure, in short a java program and complied that with "loadjava" feature. All compilation and other are fine.

I wrote a stored procedure to execute this stored procedure, with ref cursor.

The code is as follow.
create or replace
PROCEDURE tmpjava (
LS_IP_REQ_DT DATE,
LS_IP_REQ_IND CHAR,
LS_IP_REQ_SEQ NUMBER,
LS_IP_RPT_NUM NUMBER,
LS_IP_CLIENT CHAR,
LS_IP_SUB_CLIENT NUMBER,
LS_IP_ACCT number,
LS_IP_FROM_DT DATE,
LS_IP_TO_DT DATE,
CUR123 OUT refcursor
)
iS LANGUAGE JAVA
NAME 'myjava.getSum(java.sql.Date,oracle.sql.CHAR,int,int,oracle.sql.CHAR,int,long,java.sql.Date,java.sql.Date,java.sql.ResultSet[])';

it compiles withour errors.

I execute it this way
var y refcursor
execute tmpjava('2006-10-19','5',2,79,' ',0,21,'2004-01-22','2004-01-26',:y);
print y

The output is as follow.

PL/SQL procedure successfully completed.
ERROR:
ORA-24338: statement handle not executed

Can any one help me what is to be done.

Thanks.
ratan
Re: java stored procedure with ref cursor [message #220875 is a reply to message #220840] Thu, 22 February 2007 09:56 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

That error generally means that the cursor isn't populated.
Hard to say thou, you havent showed all you code.

Anyway
Found an example that might help you --> LINK
Re: java stored procedure with ref cursor [message #220977 is a reply to message #220840] Thu, 22 February 2007 23:29 Go to previous messageGo to next message
ratan2204
Messages: 2
Registered: February 2007
Junior Member
Hi,

ok, i did not understand, what code are u expecting from my side.
do u want c the java code ?

And example link which u sent, show example for stored functions and not stored procedures.

ratan
Re: java stored procedure with ref cursor [message #220992 is a reply to message #220977] Fri, 23 February 2007 01:25 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Mmm sorry I should have red the link more careful i guess.

Anyway
Always put in a "tiny" example that reflects your problem.
So showing your java code would be great.
Re: java stored procedure with ref cursor [message #221566 is a reply to message #220840] Tue, 27 February 2007 08:17 Go to previous message
orafaqer
Messages: 48
Registered: July 2006
Member
How to return a JDBC ResultSet as Ref Cursor from a Java Stored Procedure
Previous Topic: inserting regular expression in SQL Table.
Next Topic: Objects in a Tablespace
Goto Forum:
  


Current Time: Sun Dec 04 12:59:28 CST 2016

Total time taken to generate the page: 0.10830 seconds