My Oracle Support Banner

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 OCTOBER 06, 2022

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.5 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A 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

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.