racemi racemi - 6 months ago 16
SQL Question

Error: ORA-04072: invalid trigger type

I did the following trigger:

create or replace trigger check_club_location
before of insert or update on club
for each row
declare cnt number;
begin
select count(*) into cnt
from club
where club.location = :new.location;

if (cnt > 0) then
raise_application_error (-20100, 'Erro: ja existe club nessa localizacao.');
end if;
end;
/


After I tried to run this trigger in Oracle APEX, the following error message appears:


ORA-04072: invalid trigger type.


I already tried many fixes but none worked on my trigger unfortunatelly.

Answer

You have a typo

before of insert or update on club

remove the "of", Oracle is complaining that "of" is not a valid trigger type

Comments