Part of my homework. I know this is quite basic, but it is not so intuitive for me. I create this:
CREATE TYPE Address_typ AS OBJECT (
AddressNo NUMBER,
Street VARCHAR2(64),
PostCode VARCHAR2(9),
Town VARCHAR2(64)
);
/
CREATE TYPE Customer_typ AS OBJECT (
CustNo NUMBER,
customer_name VARCHAR2(64),
VAT_NO VARCHAR2(18),
Address_ref REF Address_typ
);
/
CREATE TABLE Address_table OF Address_typ;
CREATE TABLE Customer_table OF Customer_typ
(Address_ref SCOPE IS Address_table);
this insert works:
INSERT INTO Address_table VALUES(Address_typ(1,'Strumykowa 5','65-001', 'Zielona Góra'));
and one below is not (with empty Address_table):
INSERT INTO Customer_table VALUES(Customer_Typ(1,'PPUH ZZPD', '12345678901', Address_typ(1,'Strumykowa 5','65-001', 'Zielona Góra')));
How should I insert correctly into Customer_table