Create type and use it as table column
SQL> create or replace type addressType as object
2 (
3 Street VARCHAR2(50),
4 City VARCHAR2(25),
5 State CHAR(2),
6 Zip NUMBER
7 );
8 /
SQL> create table CUSTOMER
2 (
3 Name VARCHAR2(25),
4 Address addressType
5 );
SQL> /
SQL> insert into CUSTOMER values(1,addressType('My Street', 'Some City', 'ST', 10001));
SQL>
SQL> drop type addressType force;
SQL> drop table customer;
Related examples in the same category