想做一個抓取病歷的數(shù)據(jù)庫(商用),病歷存在知識產(chǎn)權(quán)問題嗎
律師回復(fù)
-
月幫助201720人CREATE TABLE testa(autoid NUMBER,expressionid NUMBER,aaa VARCHAR2(20));CREATE TABLE testb(autoid NUMBER,taskid NUMBER,bbb VARCHAR2(20));alter table TESTA add constraint testa_u1 primary key (AUTOID);alter table TESTB add constraint testb_u1 primary key (AUTOID);alter table TESTA add constraint testa_n1 foreign key (EXPRESSIONID) references testb (AUTOID);alter table TESTB add constraint testb_n1 foreign key (taskid) references testb (AUTOID);INSERT INTO testa VALUES(1,NULL,'aa');INSERT INTO testa VALUES(2,NULL,'aa');INSERT INTO testa VALUES(3,NULL,'aa');INSERT INTO testa VALUES(4,NULL,'aa');INSERT INTO testb VALUES(1,NULL,'bb');INSERT INTO testb VALUES(2,NULL,'bb');INSERT INTO testb VALUES(3,NULL,'bb');INSERT INTO testb VALUES(4,NULL,'bb');UPDATE testa SET expressionid = 3 WHERE autoid = 4;--不報錯實測不報錯,樓主實際執(zhí)行的語句,肯定跟上面有差異。根據(jù)你的描述,建議檢查輸入expression是否與update原來的task在同一個事務(wù)中。或者先COMMIT輸入expression,后update task 原問題:《ORA-02291: integrity constraint () violated - parent key not found。oracle外鍵約束錯誤》回復(fù)于 2022-11-15 17:13:08