我制作了两个对象表,参考 M:M,插入工作正常,但是当我尝试更新参考时,我得到了错误。
错误: SQL 错误:ORA-00904:“A”。“ATS_PN”:“%s:无效标识符”
CREATE OR REPLACE TYPE STUDENTI AS OBJECT(
S_NUM INT,
S_UZV VARCHAR2(30)
);
CREATE OR REPLACE TYPE PASNIEDZEJI AS OBJECT(
P_NUM INT,
P_UZV VARCHAR2(30)
);
CREATE OR REPLACE TYPE ATS_ST AS OBJECT(
ID INT,
ST_ID REF STUDENTI
);
CREATE OR REPLACE TYPE ATS_PN AS OBJECT(
ID INT,
PN_ID REF PASNIEDZEJI
);
CREATE OR REPLACE TYPE ATS_P AS TABLE OF ATS_PN;
CREATE OR REPLACE TYPE ATS_S AS TABLE OF ATS_ST;
CREATE OR REPLACE TYPE O_STUDENTI AS OBJECT(
STUD STUDENTI,
PASN ATS_P
);
CREATE OR REPLACE TYPE O_PASNIEDZEJI AS OBJECT(
PASN PASNIEDZEJI,
STUD ATS_S
);
CREATE TABLE T_STUDENTI OF O_STUDENTI
NESTED TABLE PASN STORE AS P_TBL;
CREATE TABLE T_PASNIEDZEJI OF O_PASNIEDZEJI
NESTED TABLE STUD STORE AS S_TBL;
INSERT INTO T_STUDENTI VALUES (STUDENTI(191, 'BRONES'), NULL);
INSERT INTO T_PASNIEDZEJI VALUES (PASNIEDZEJI(53, 'JHONES'), NULL);
INSERT INTO T_PASNIEDZEJI VALUES (PASNIEDZEJI(54, 'HIKKAEV'), NULL);
UPDATE T_STUDENTI A SET A.PASN = (1, 'TEST') WHERE A.STUD.S_NUM = 191; --misstake some where ther :/