dependencies between object types and tables. : Table « Object Oriented Database « Oracle PL / SQL






dependencies between object types and tables.

 
SQL>
SQL>
SQL> CREATE OR REPLACE TYPE RowObject AS OBJECT (
  2    attributeA NUMBER
  3  );
  4  /

Type created.

SQL> show errors
No errors.
SQL>
SQL> CREATE OR REPLACE TYPE ColObject AS OBJECT (
  2    attributeB NUMBER
  3  );
  4  /

Type created.

SQL> show errors
No errors.
SQL>
SQL> CREATE TABLE RowTable OF RowObject;

Table created.

SQL>
SQL> CREATE TABLE ColTable (
  2    theObject ColObject
  3  );

Table created.

SQL>
SQL> SELECT object_name, object_type, status
  2    FROM user_objects
  3    WHERE object_name IN ('COLTABLE', 'ROWTABLE');

OBJECT_NAME          OBJECT_TYPE         STATUS
-------------------- ------------------- -------
COLTABLE             TABLE               VALID
ROWTABLE             TABLE               VALID

SQL>
SQL>
SQL> DROP TABLE RowTable;

Table dropped.

SQL> DROP TABLE ColTable;

Table dropped.

SQL>
SQL>

 








Related examples in the same category

1.CREATE a TABLE with the Column Type in It
2.Loading the 'row object' Table
3.Create table from Object type