• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help me in creating a Trigger for Insert and Update Options

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34668
366
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You add it to the "after" clause on the trigger. See the full syntax for triggers.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic