Retrieving Out Parameter Being a User Defined Type From Stored Procedure Using JDBC Fails With ORA-04043 (Doc ID 1902288.1)

Last updated on NOVEMBER 03, 2016

Applies to:

JDBC - Version 10.2.0.5 and later
Information in this document applies to any platform.

Symptoms

Retrieving out parameter from stored procedure fails with:

ORA-04043 object "xxxx" does not exist
at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:979)
at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:875)
at oracle.jdbc.driver.T2CConnection.getTdoCState(T2CConnection.java:1085)
at oracle.jdbc.oracore.OracleTypeADT.initMetadata11_2(OracleTypeADT.java:776)
at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:509)
at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:469)
at oracle.sql.StructDescriptor.initPickler(StructDescriptor.java:362)
at oracle.sql.StructDescriptor.<init>(StructDescriptor.java:283)
at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:121)
at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:74)
at oracle.jdbc.driver.NamedTypeAccessor.otypeFromName(NamedTypeAccessor.java:89)
at oracle.jdbc.driver.TypeAccessor.initMetadata(TypeAccessor.java:74)
at oracle.jdbc.driver.OracleStatement.allocateAccessor(OracleStatement.java:2271)
at oracle.jdbc.driver.T2CCallableStatement.allocateAccessor(T2CCallableStatement.java:2502)
at oracle.jdbc.driver.T2CCallableStatement.registerOutParameterInternal(T2CCallableStatement.java:2820)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:227)
at oracle.jdbc.driver.OracleCallableStatementWrapper.registerOutParameter(OracleCallableStatementWrapper.java:1601)
at TesteJdbcPuro.main(TesteJdbcPuro.java:15)

 

With JDBC Thin, the exception received is:

java.sql.SQLException: invalid name pattern: MyProc.MYTYPE
at oracle.jdbc.oracore.OracleTypeADT.initMetadata11_2(OracleTypeADT.java:806)
at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:509)
at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:469)
at oracle.sql.StructDescriptor.initPickler(StructDescriptor.java:362)
at oracle.sql.StructDescriptor.<init>(StructDescriptor.java:283)
at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:121)
at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:74)
at oracle.jdbc.driver.NamedTypeAccessor.otypeFromName(NamedTypeAccessor.java:89)
at oracle.jdbc.driver.TypeAccessor.initMetadata(TypeAccessor.java:74)
at oracle.jdbc.driver.T4CCallableStatement.allocateAccessor(T4CCallableStatement.java:616)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterInternal(OracleCallableStatement.java:177)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:227)
at oracle.jdbc.driver.OracleCallableStatementWrapper.registerOutParameter(OracleCallableStatementWrapper.java:1601)
at TesteJdbcPuro.main(TesteJdbcPuro.java:15)

Out parameter is a user defined type, which is declared inside a package header.
The issue occurs when trying to call the procedure from a Java Application with JDBC OCI 11g

Example:

 

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