plsql - When i create a trigger it gives an error saying it is invalid and failed re-validation -
i tried updating client_master table gave error idk why.i did update client_master set name='abc' name='xyz';
create or replace trigger client_audit before update or delete on client_master each row begin case when updating insert audit_client values(:old.c_no,:old.name,:old.address,:old.bal_due,'upd','1',sysdate); when deleting insert audit_client values(:old.c_no,:old.name,:old.address,:old.bal_due,'delet','2',sysdate); end case; end; /
try solution. hope helps.
create or replace trigger client_audit before update or delete on client_master each row declare begin if updating insert audit_client values ( :old.c_no, :old.name, :old.address, :old.bal_due, 'upd', '1', sysdate ); elsif deleting insert audit_client values ( :old.c_no, :old.name, :old.address, :old.bal_due, 'delet', '2', sysdate ); end if; end; /
Comments
Post a Comment