17,086
社区成员
发帖
与我相关
我的任务
分享
drop type ADDRESS force;
create or replace type ADDRESS as object
(
PROVINCE varchar(10),
CITY varchar(20 ),
STREET varchar(30)
);
/
drop type person force;
create or replace type person as object
(
pname varchar(30) ,
ads ref ADDRESS
)
/
drop table address_WORK_TAB force;
create table address_WORK_TAB of ADDRESS(PRIMARY KEY(PROVINCE,CITY,STREET)) OBJECT IDENTIFIER IS PRIMARY KEY;
/
drop table person_WORK_TAB force;
create table person_WORK_TAB of person(PRIMARY KEY(pname)) OBJECT IDENTIFIER IS PRIMARY KEY;
/
select t.*, t.rowid from PERSON_WORK_TAB t
update PERSON_WORK_TAB set ads=make_ref(address_WORK_TAB,'1','1','1');
查了几条纪录后 最后一局报错:ORA-22979create or replace procedure test_ref is
addref ref address ;
begin
select ref(a) into addref from address_WORK_TAB a where street='1';
insert into PERSON_WORK_TAB values ('ya',addref);
commit;
end test_ref;
这样也插不进去。。。。。