File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • 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
  • 0
  • 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: 33674
316
Eclipse IDE Java VI Editor
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic