| Author |
Help me in creating a Trigger for Insert and Update Options
|
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Hi
Please help me in creating a Trigger .
My requirement is that after insert or update on a Table , i want to fire an event .
I have started this way ,but doesn't know how to fully implement this .
say i have a dept table
CREATE TRIGGER DepartmentTrigger
AFTER INSERT ON Dept
BEGIN
INSERT INTO mytable VALUES("123","Kiran");
END DepartmentTrigger;
Please tell me how can i put the Update option also .
Thanks in advance .
|
Save India From Corruption - Anna Hazare.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26496
|
|
|
You add it to the "after" clause on the trigger. See the full syntax for triggers.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: Help me in creating a Trigger for Insert and Update Options
|
|
|