PLS-00049 bad bind variable While using :OLD

You can save it in a local variable (like: v_deletedate) and then use that variable in your insert command.

create or replace trigger dis_sal_his

after delete or insert or update on employee

for each row

declare

username varchar2(10);

v_deletedate date;

begin

select user into username from dual;

v_deletedate := :old.deletedate;

insert into employeehistory

values(:old.id,:old.name,:old.age,:old.address,:old.salary,v_deletedate);

end;

 

Leave a Comment