Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert trigger to delete the row is just inserted

Status
Not open for further replies.

boooble

Programmer
Jul 16, 2003
1
GB
Hi,
I have an insert trigger which populates few other tables. After populating the tables i need to delete the row which got inserted( one which actioned the trigger). can this be done?

Would be great if someone can help?

Cheers,
Manoj
 
You might try this: Have the application which inserts the row which fires the trigger immediately delete the row it just inserted. That way the after insert trigger will have fired and done its work on all the other tables and the row you want deleted will be gone. Don't forget to do a commit in there somewhere.
 
You may store PK of newly inserted row(s) in package variable and delete those records in after insert statement level trigger. The same way as with mutating error.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top