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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -