Column objects appear as nodes within the Columns node. Each object is labeled with a name and its type in parentheses. Column object nodes are composite nodes, with the attributes of the type appearing as subnodes.
There can be four subtypes of column objects-nested object type, table type, varying array type and REF object type. Column objects are labeled in the Object Navigator as follows:
column-name (nested-object-type)
column-name (table-type-name:TABLE OF table-subtype-name)
column-name (varying-array-type-name: VARRAY(size) OF varying-array-subtype-name)
column-name (REF reference-type-name)
Oracle Object Support in the Object Navigator
In the following example, the emp_col column of table emp_tab is a nested object of type emp_typ.
CREATE TYPE emp_typ AS OBJECT (ename VARCHAR2(30),
esalary NUMBER(5,2));
CREATE TABLE emp_tab (emp_col emp_typ, dept VARCHAR2(2));
The subtree for emp_tab is:
In the next example, the emps column of table dept_tab is a nested table with subtype emp_tbl. The nested table contains rows of type emp_typ.
CREATE TYPE emp_typ AS OBJECT (ename VARCHAR2(30),
esalary NUMBER(5,2));
CREATE TYPE emp_tbl AS TABLE OF emp_typ;
CREATE TABLE dept_tab (dname VARCHAR2(20), emps emp_tbl)
NESTED TABLE emps STORE AS emps_tab;
The subtree for dept_tab is:
In the following example, the emps column of table dept_tab_ary is a varying array with subtype emp_ary. The varying array contains rows of type emp_typ.
CREATE TYPE emp_typ AS OBJECT (ename VARCHAR2(30),
esalary NUMBER(5,2));
CREATE TYPE emp_ary AS VARRAY(7) OF emp_typ;
CREATE TABLE dept_tab_ary (dname VARCHAR2(20), emps emp_ary);
The subtree for dept_tab_ary is:
In the next example, the manager column of table dept_ref is a referenced object with type emp_typ.
CREATE TYPE emp_typ AS OBJECT (ename VARCHAR2(30),
esalary NUMBER(5,2));
CREATE TABLE dept_ref (dname VARCHAR2(20), manager REF emp_typ);
The subtree for dept_ref is: