You can also use an object type to define an entire table, and the table is known as an object table. : Object Table « Object Oriented « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> CREATE or replace TYPE EmployeeType AS OBJECT (
  2    id          NUMBER,
  3    name        VARCHAR2(15),
  4    description VARCHAR2(22),
  5    salary       NUMBER(5, 2)
  6  );
  7  /

Type created.

SQL> CREATE TABLE object_employee OF EmployeeType;

Table created.

SQL>
SQL> desc object_employee;
 Name                Null?    Type
 ID                           NUMBER
 NAME                         VARCHAR2(15)
 DESCRIPTION                  VARCHAR2(22)
 SALARY                       NUMBER(5,2)

SQL>
SQL> drop table object_employee;

Table dropped.

SQL>
SQL>
SQL>








32.9.Object Table
32.9.1.You can also use an object type to define an entire table, and the table is known as an object table.
32.9.2.Inserting a row into an object table
32.9.3.One-step INSERTs into a Table that Contains Row Objects
32.9.4.INSERT Values into a Table that Contains Row Objects (TCRO)
32.9.5.Insert data just as one would ordinarily do with a common SQL table:
32.9.6.SELECTing Individual Columns in Table that Contains Row Objects
32.9.7.Selecting Rows from the object Table
32.9.8.SELECT from the object-oriented table
32.9.9.Updating a Row in the object Table
32.9.10.UPDATE a Table that Contains Row Objects (TCRO)
32.9.11.Accessing the object table by reference
32.9.12.Create a table based on an Object with methods
32.9.13.Alter table to add a user-defined type column