Attempting to Execute a Java Stored Procedure that Returns a REF CURSOR Fails With: ORA-00932: inconsistent datatypes: java.sql.ResultSet (Doc ID 1595997.1)

Last updated on JULY 05, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.5 and later
Information in this document applies to any platform.

Symptoms

 The followings error may occur when calling a Java Stored Procedure that returns a REF CURSOR:

Executing the procedure results in the following:

    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected an OUT argument at position 1 that
    is a java.sql.ResultSet got a java.sql.ResultSet that can not be used as a REF CURSOR

 Trying to access the REF CURSOR results in the following:

    ORA-24338: statement handle not executed

 

The behavior can be reproduced from SQLPlus, with the following code:


Sample Output:

SQL> exec testonecur(:v5);
BEGIN testonecur(:v5); END;

*
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected an OUT argument at position 1 that
is a java.sql.ResultSet got a java.sql.ResultSet that can not be used as a REF
CURSOR


SQL> print v5;
ERROR:
ORA-24338: statement handle not executed


SP2-0625: Error printing variable "v5"


Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms