create trigger Trigger_1
Before INSERT
on Adresse
for each row
declare
pruefen int;
begin
select COUNT(*)
into pruefen
from CITY
where city.NAME = :new.stadt
and CITY.PROVINCE = :new.provinz;
if(pruefen = 0) then
RAISE_APPLICATION_ERROR(-20000, 'Fehler');
end if;
end;
Error:
[2020-01-18 10:14:12] [72000][20000] ORA-20000: Fehler
[2020-01-18 10:14:12] ORA-06512: in "ZOGL1011.TRIGGER_1", Row 6
[2020-01-18 10:14:12] ORA-04088: error during execution of Trigger "ZOGL1011.TRIGGER_1"
[2020-01-18 10:14:12] Position: 12
I don't get the problem.. :new.stadt and :new.provinz are in red, but I can create the trigger.
Thank you for your help!
:new.stadtandcity.namesame? Also, Is data type of the:new.provinzandcity.provincesame?