triggers - Syntax error in SQL with NEW values -
create or replace trigger precio_reparaciones before insert or update on reparaciones each row begin update reparaciones set precio = :new.gasto_material * :new.tiempo_usado * :new.factor :new.garantia = 0; end;
sql developer shows syntax error first :new
is. (i'm using oracle database express edition 11g.)
how can solve it?
as reply of comment @kern golstein -
you can change trigger below -
create or replace trigger precio_reparaciones before insert or update on reparaciones each row begin if :new.garantia = 0 :new.precio := :new.gasto_material * :new.tiempo_usado * :new.factor; end if; end;
Comments
Post a Comment