Quick Search:
 The Oracle PL/SQL SYS_TYPEID Function      [Return To Index] Jump to:  


In Oracle PL/SQL, SYS_TYPEID is a built in function which is used to get the unique typeid of the hierarchical object instance pointed to in the result set. Hierarchical Objects are the nodes in object type hierarchy. All non-extended or final types have a zero SYS_TYPEID value.

Note that SYS_TYPEID returns the same value for an object instance which is contained by its corresponding TYPEID column in the USER_TYPES table.

Example Syntax:


Example Usage:

The SQL below returns the typeid of a hierarchical object instance. Note that the object type TYP_ID is created under TYP_ROOT with one attribute. TYPEID column from USER_TYPES table and SYS_TYPEID function return the same value '0168'

SQL> CREATE type typ_id under typ_root(a number);

Type created.

SQL> create table tab_id of typ_id;

Table created.

SQL> SELECT type_name, typeid FROM user_types WHERE type_name='TYP_ID';

------------------------------ --------------------------------
TYP_ID 0168

SQL> INSERT INTO tab_id values ('PSOUG','100);

1 row created.

SQL> SELECT SYS_TYPEID(value(t)) FROM tab_id t;


Related Links:
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org