試圖創建一個觸發器,該觸發器查看地址表中的zip,將其與zipcode表中的zip匹配,並填充城市州和國家地址表。不過,我收到以下錯誤:創建觸發器錯誤錯誤:ORA-04076:無效的NEW或OLD規範
Error: ORA-04076: invalid NEW or OLD specification
我不確定如何在這裏使用新的或舊規範,有人可以幫忙嗎?
create or replace TRIGGER Addr_Zip
BEFORE INSERT OR UPDATE OF Zip ON ADDRESS
FOR EACH ROW
when (address.zip = Zip_Code.zip)
BEGIN
update address set Address.city = (select City from Zip_Code),
Address.State = (select State from Zip_Code),
Address.Country = (select Country from Zip_Code)
where address.zip = zip_code.zip;
END;
https://docs.oracle.com/database/121/TDDDG/tdddg_triggers.htm#TDDDG52000 – OldProgrammer