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 employee (
2 employee EmployeeType,
3 count NUMBER
4 );
Table created.
SQL> /
SQL>
SQL> desc employee;
Name Null? Type
EMPLOYEE EMPLOYEETYPE
ID NUMBER
NAME VARCHAR2(15)
DESCRIPTION VARCHAR2(22)
SALARY NUMBER(5,2)
COUNT NUMBER
SQL>
SQL> drop table employee;
Table dropped.
|