Currently, I am building up a transient type in Oracle (18.104.22.168 and 22.214.171.124) PL/SQL to encapsulate access of views in a table producing function. However, I encounter something I don’t understand in the results of the ANYTYPE.GetAttrElemInfo. According to the documentation, it returns “the typecode of the attribute or collection element”. These typecodes are listed in package DBMS_TYPES. The ony numeric type defined in here is the NUMERIC type (with integer value 2), no subtypes are present here.
However, when I call the method on an object attribute that is defined as an subtype (like float or decimal), I will get a number that is not present in DBMS_TYPES. Does anyone has any pointers to documentation describing this behaviour? Is this a known issue?
I have an example script that shows / reproduces this behaviour: First a type object is defined with a number, float and decimal attribute. The anonymous PLSQL block will display the results of the anytype.GetAttrElemInfo call on the three attributes.
CREATE OR REPLACE TYPE TESTTYPE AS OBJECT
tt := TESTTYPE( 1, 123, 10);
adata := anydata.convertObject( tt);
v_typenum := adata.gettype( atype);
FOR i IN 1 … 3
v_typecode := atype.GetAttrElemInfo( i, v_precision, v_scale, v_LENGTH, v_csid, v_csfrm, v_attr_elt_type, v_aname);
DBMS_OUTPUT.put_line( ‘data of attribute ’ || i || ’ is:’ || v_typecode);
Hopefully anyone can help me.