declare
begin
for i in (select aid ,address from address)
loop
for j in (select aid ,address from address )
loop
if i.address=j.address then
if i.aid!=j.aid then
update employee_add
set aid=i.aid
where aid=j.aid;
delete from address
where aid=i.aid;
end if;
end if;
end loop;
end loop;
end;
/
このコードはfor loop
. その後、エラーが表示されます:------
*原因: 外部キー値に一致する主キー値がありません。
*処置: 外部キーを削除するか、一致する主キーを追加してください。
私はテーブル、、employee[eid (primary key) ,ename]
およびaddress[aid (primary
key),address]
多対多の関係テーブルを持っていますemployee_add[eid,aid]
。助けてください!少し早いですがお礼を :)