We have an Oracle type that’s declared as such:
CREATE OR REPLACE TYPE its_accountarray;
There is no base type. This type is then used in Procedures and packages (and in Java Stored procedures as an array descriptor). In the procedure/package it uses extend function to add to array.
<declare section>
v_account latax.ITS_ACCOUNTARRAY := new ITS_accountArray();
...
BEGIN
...
...
v_account.extend(1);
and in Java, it’s used as:
oracle.sql.ARRAY ls_accountARRAY, ls_periodARRAY;
oracle.sql.ArrayDescriptor ad = ArrayDescriptor.createDescriptor(**"ITS_ACCOUNTARRAY"**, oconn);
ls_accountARRAY = new ARRAY(ad, oconn, arg_accounts);
ocs.setARRAY(2, ls_accountARRAY);
I am curious as to how this works. Even though the name has Array in it, it is not defined as an array or table type, like I typically see. It works, but is this a legal usage or should I declare the type to be of some array type explicitly?
Thanks
Sam
I tried to reproduce what you say is happening, and got an error:
So, you’re probably looking at the wrong type definition (e.g. you’re looking at it in the wrong schema), or not looking at the entire type definition (e.g. there is a TYPE BODY that provides the implementation). Since this seems to be acting like a nested table type, the former sounds more likely.