Compilation failed, line 10 (14:27:16)
The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
PLS-00103: Encountered the symbol ";" when expecting one of the following: . ( ) * @ % & - + / at mod remainder rem with and or group having intersect minus start union where connect || multiset The symbol ";" was ignored.**
create or replace trigger "PROMOS_T2"
BEFORE insert or update on "PROMOS"
for each row
DECLARE
ma_exp1 EXCEPTION;
ma_exp2 EXCEPTION;
ma_exp3 EXCEPTION;
cap LOGTS.CAPACITE%TYPE;
nbr INTEGER;
begin
SELECT COUNT (*) INTO nbr FROM LOGTS WHERE :NEW."IDLOG"=IDLOG;
SELECT CAPACITE INTO cap FROM LOGTS WHERE :NEW."IDLOG"=IDLOG;
if (exists(SELECT * FROM PROMOS WHERE :NEW."IDPROMO"=IDPROMO;) )THEN
RAISE ma_exp1;
elsif nbr=1 AND cap < :NEW."NBPLACES" THEN
RAISE ma_exp2;
else
RAISE ma_exp3;
end if;
EXCEPTION
WHEN ma_exp1 THEN
RAISE_APPLICATION_ERROR(-20004,'la promos dèja existe');
WHEN ma_exp2 THEN
RAISE_APPLICATION_ERROR(-20005,'PAS DE PLACE');
WHEN ma_exp3 THEN
RAISE_APPLICATION_ERROR(-20006,'IDLOG nexiste pas');
end;