My procedure in oracle is defined under a package, which has in and out parameters of table of records. I can call the procedure using packagename.procname using the callable statement from java. However to access the out parameter, I need to define a variable of type ARRAY. But the types of record and table of records in oracle are defined inside the package. Thus those types are not accessible from java using the ARRAYDESCRIPTOR.
The proc and types are defined as below:
CREATE OR REPLACE PACKAGE mypackage IS
TYPE TY_Pos IS RECORD
( cust_id VARCHAR2(9)
, balance NUMBER
);
TYPE TY_TBL IS TABLE OF TY_Pos INDEX BY PLS_INTEGER;
PROCEDURE myproc(inTable IN OUT TY_TBL,
count IN NUMBER,
outTable IN OUT TY_TBL
);
CREATE OR REPLACE PACKAGE BODY mypackage AS
PROCEDURE myproc(inTable IN OUT TY_TBL,
count IN NUMBER,
outTable IN OUT TY_TBL
) as
--proc body
For accessing the out variable of proc which is a table of records, I am creating array descriptor as
ArrayDescriptor myDescp = ArrayDescriptor.createDescriptor ("TY_TBL", l_con);
But since the TY_TBL is defined inside the package thus it throws error. Please help me how can I access this type from my java code.