Home » SQL & PL/SQL » SQL & PL/SQL » Help me in writing trigger
Help me in writing trigger [message #223857] Mon, 12 March 2007 02:03 Go to next message
Messages: 95
Registered: February 2007


I need a trigger for following below scenario.

empno status
1 new
2 accepted
3 pending
4 pending

I have to write a trigger for below scenario. Whenever a record is inserted the status of a employ is new. I have to querry the table for status is pending and i have to capture the time also. after 1 hr again i have to check for status still it is in pending then i have to sent email for all email recipients mentioning empno in that mail.

I think I have to write update trigger on column status with where condtion.

Just help in writing this trigger.

Re: Help me in writing trigger [message #223885 is a reply to message #223857] Mon, 12 March 2007 03:34 Go to previous message
Messages: 20850
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Trigger will fire whenever a record is inserted. But, it won't fire "after 1 hour again". You should schedule a job to do it.

OK, you know the scenario. Start with the CREATE keyword, put several statements behind it (UTL_SMTP sends a mail) and, finally, test it. If you have a problem, do come back and explain it. Then schedule the procedure using DBMS_JOB or DBMS_SCHEDULER. If you have a problem, do come back and explain it.
Previous Topic: query to find second highest sal
Next Topic: subquery problem
Goto Forum:

Current Time: Sat Oct 22 20:56:56 CDT 2016

Total time taken to generate the page: 0.25632 seconds