-
How to get the Current Action in upd/del trigger
How do you reference the trigger action in an insert to another table ("INSERTING", "UPDATING", or "DELETING")?
For example:
insert into audit_table ld.col1, :new.col1, [ACTION], ...
Currently I've got 3 "IF [ACTION]" statements that set a varable and the var is set then used in the audit insert. Just thinking there's got to be a more elegant way to do this.
Thanks,
Ken
-
Well, at least I learned that ":" and an "o" make a cool purple face...
-
You could create 3 seperate triggers, one for each action.
AFAIK, your test method is about the only way to do that.
Good luck,
Ken
-
Guys,
You are wasting your time.
Do you realize that here we discuss is there a way to write 3 statements instead of 5.
I know you can say now that if ANOTHER statement appear then the trigger will not work correctly, but for almost 30 years existence of Oracle on the market, these statements have not changed so I would take that risk if I was you.
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
|