create trigger audit_trail01
after update or delete on cust_mstr
for each row
declare
open varchar2(8);
begin
if updating then
open := 'UPDATE';
elsif deleting then
open := 'Delete';
end if;
insert into audit_cust
( cust_no
, fname
, mname
, lname
, dob_inc
, occup
, pancopy
, fqrm60
, operation
, userid
, opdate )
values
( :old.cust_no
, :old.fname
, :old.mname
, :old.lname
, :old.dob_inc
, :old.occup
, :old.pancopy
, :old.fqrm6o
, open
, user
, sysdate );
end;
I have written the above but it is showing me the below error:
Errors:
TRIGGER AUDIT_TRAIL01 Line/Col: 5/8
PLS-00103: Encountered the symbol "=" when expecting one of the following:
mod bind variable> continue current sql execute forall merge pipe purge json_exists json_value json_query json_object json_array
Line 5
which isOPEN VARCHAR2(8);
So what are you not able to understand?OPEN
is a reserved keyword in Oracle. Use a proper variable name. – Lalit Kumar B