oracle - basic objects: ORA-00932 when INSERT object type data -
part of homework. know quite basic, not intuitive me. create this:
create type address_typ object ( addressno number, street varchar2(64), postcode varchar2(9), town varchar2(64) ); / create type customer_typ 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 address_table); this insert works:
insert address_table values(address_typ(1,'strumykowa 5','65-001', 'zielona góra')); and 1 below not (with empty address_table):
insert customer_table values(customer_typ(1,'ppuh zzpd', '12345678901', address_typ(1,'strumykowa 5','65-001', 'zielona góra'))); how should insert correctly customer_table
this way work:
insert customer_table values(customer_typ(1,'ppuh zzpd', '12345678901', (select ref(a) address_table a.addressno = 1)));
Comments
Post a Comment