Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL SYS_TYPEID Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: SYS_TYPEID

Definition:
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:

SYS_TYPEID(Object_type_value)


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';

TYPE_NAME TYPEID
------------------------------ --------------------------------
TYP_ID 0168

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

1 row created.

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

SYS_TYPEID
-----------------
0168



Related Links:
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 220 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?