Passing an array of Dates to a Database Stored Procedure Returns in Error: "Java Exception: Invalid Pl/Sql Index Table Element Type" (Doc ID 1148206.1)

Last updated on AUGUST 03, 2016

Applies to:

JDBC - Version: 10.2.0.4 and later   [Release: 10.2 and later ]
This problem can occur on any platform.

Symptoms

When calling a database PL/SQL procedure and passing an array with Date elements to that procedure, following error is thrown:

Exception
java.sql.SQLException: Invalid PL/SQL Index Table element type
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:110)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:171)


The code of the PL/SQL procedure used looks like:

CREATE OR REPLACE PACKAGE PJ_BPH_test AS

  PROCEDURE "PublishPayment" ( p_num_components in Number
                             , param1 in types.TDateArr
  );

END PJ_BPH_test;
/


When called by a java code as follows:
cst.setPlsqlIndexTable(2,strArr, numOfComponents, numOfComponents, java.sql.Types.DATE, 4000);

The above error will occur.

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