I am trying to declare a variable and accessing it again to update same table for a particular id.(Updating STATUS from 'E' to 'R')
create or replace trigger resume_trgr
before update on temp_jobs
DECLARE
job_status varchar(2);
begin
select STATUS into :job_status from temp_jobs where id=6120;
if :job_status='E'
then
update temp_jobs set STATUS='R' where id=6120;
end if;
end;
/
But it returning error while executing above code. Error code is below:
Trigger resume_trgr compiled
Errors: check compiler log
Error(5,27): PLS-00049: bad bind variable 'STATUS'