使用一些我将在下面展示的类型:
CREATE TYPE Course_objtype AS OBJECT (
Course_code VARCHAR2(4),
Course_name VARCHAR2(200),
Study_mode CHAR(2),
Campus REF Campus_list,
Faculty REF Faculty_list,
Director REF Staff_list
);
CREATE TYPE Campus_objtype AS OBJECT (
Campus_ID NUMBER,
Campus_code CHAR(1),
Campus_name VARCHAR2(11),
Phone_Number VARCHAR(20),
Address Address_objtype
);
CREATE TYPE Faculty_objtype AS OBJECT (
Faculty_ID NUMBER,
Faculty_Name VARCHAR(200)
);
CREATE TYPE Staff_objtype AS OBJECT(
Staff_ID VARCHAR(7),
Person Person_objtype,
Staff_email VARCHAR2(200),
Office VARCHAR2(6),
Phone VARCHAR2(20),
Position VARCHAR2(15)
);
我一直在尝试将下面的值插入到名为 Course_list 的表中,从链接到上述类型的表中继承值:
INSERT INTO Course_list VALUES (
'2136','Computing','FT',
(SELECT REF(d) FROM Campus_list d WHERE d.Campus_code = 'C'),
(SELECT REF(a) FROM Faculty_list a WHERE a.Faculty_ID = '3'),
(SELECT REF(n) FROM Staff_list n WHERE n.Staff_ID = 'E129675')
);
这让我回到了以下错误:
ORA-22979: 无法插入对象视图 REF 或用户定义的 REF
有什么想法吗?我一无所知:(