Create Row Objects REF TYPE : Reference Object « Object Oriented Database « Oracle PL / SQL






Create Row Objects REF TYPE



SQL> CREATE OR REPLACE TYPE address_obj as OBJECT(
  2        street VARCHAR2(20),
  3        city VARCHAR2(20),
  4        state CHAR(2),
  5        zip CHAR(5));
  6  /

Type created.

SQL>
SQL> -- Create Row Objects REF TYPE
SQL>
SQL> -- Create a table that contains only the address objects:
SQL>
SQL> CREATE TABLE address_table OF ADDRESS_OBJ;

Table created.

SQL>
SQL> SELECT * FROM address_table;

no rows selected

SQL>
SQL> drop table address_table;

Table dropped.

SQL>
SQL>
           
       








Related examples in the same category

1.Use discrete attribute names
2.CREATE a Table that References Our Row Objects