-
How to create trigger to log inserts/updates on table?
All,
as our client 'plays' always with the parameters in the database, we'ld like to have a logging of what they did. The easiest way for me seems a trigger, but I always get the erro ORA-4082: can't use old and new in table trigger.
CREATE OR REPLACE TRIGGER OMS.configdicttrig
AFTER INSERT OR UPDATE
ON configdict
BEGIN
insert into configdict_log
values (ld.CATEGORY ,
ld.PARAM,
ld.VALUE ,
ld.OWNER ,
configdictseq.nextval);
insert into configdict_log
values (:new.CATEGORY ,
:new.PARAM,
:new.VALUE ,
:new.OWNER ,
configdictseq.nextval);
commit;
end;
Can you help me on how I can log the old line and the new line?
Thx,
Rik
-
If you want to use :OLD and :NEW you need to specify for each row in the trigger creation command.
-
Thx Gandolf, works great now...
Rik
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|