0

Stored procedure run structure is like this :

var sampleVar REFCUSOR;
EXEC SAMPLE_PROC(P_DATE=>TO_DATE('01-JAN-21','DD-MON-YY'),P_DETAILS=>:sampleVar);

I need to run this SP using Java code. But getting error while running 'var sampleVar REFCUSOR;' statement. Error: Invalid Sql statement.

How to resolve this error? Any alternate way to successfully run this Stored Proc using Java.

Luke Woodward
  • 60,283
  • 16
  • 83
  • 102
  • I don't think you need to declare a variable to call this stored procedure. There are other StackOverflow questions that handle calling a stored procedure that returns a `REF CURSOR` in an `OUT` parameter, for example https://stackoverflow.com/questions/53531178/oracle-jdbc-get-sys-refcursor-from-procedure . These will likely help you. – Luke Woodward Mar 19 '22 at 13:43

0 Answers0