0

I'm trying to execute an oracle procedure that has an array type(VARRAY) output parameter. This array type is defined in a package.

VARRAY definition:

create or replace
package PKG_TYPES_VARIABLES
as  
  TYPE RETURNARRAY IS VARRAY(100) OF VARCHAR2(2000);
end;

When I tried executing the stored proc using JDBC, I got the following execption.

invalid name pattern: PKG_TYPES_VARIABLES.RETURNARRAY

Java Code:

oracleCallableStmt =
        (OracleCallableStatement) dbTransaction.createCallableStatement("begin pkg1.prc_MasterValidation(?); end;", 0);
    oracleCallableStmt.registerOutParameter(1, OracleTypes.ARRAY, "PKG_TYPES_VARIABLES.RETURNARRAY");
    oracleCallableStmt.executeUpdate();

Can't we register the array output parameter which is defined in a package? When I searched for this error in google, every one says the types cannot be invoked when they are defined in package. But those blogs/forums are pretty old.

Is it true that we cannot invoke the types if they are defined in package even in latest jdbc and oracle 12c db? Can anyone explain me why there is such limitation?

0 Answers0