CREATE TYPE cust_address_typ2 AS OBJECT
( street_address VARCHAR2(40)
, postal_code VARCHAR2(10)
, city VARCHAR2(30)
, state_province VARCHAR2(10)
, country_id VARCHAR2(10)
)
Type created.
create table dt_customers (
id number primary key,
customer_name varchar2(255),
customer_address cust_address_typ2 )
Table created.
declare
cust cust_address_typ2;
begin
cust := cust_address_typ2 ('100 Main',
'06896',
'Redding',
'CT',
'US');
insert into dt_customers
(id, customer_name, customer_address)
values
(1, 'ACME', cust);
end;
Statement processed.