MySQL Forums
Forum List  »  Triggers

Re: Before insert trigger fires on delete
Posted by: Andrew Gilfrin
Date: February 24, 2006 10:36AM

Murthy

Sorry for the delayed reply I have only just managed to get on a MySQL instance.

I think the problem isn't with the code but to do with the fact you are trying to raise an error artificially, in procedures the method you are using seems to work but here it seems as if when the trigger goes to fire it does some sort of check on the validity of the trigger and fails. This would explain the reason it happens on delete (it also happens on update).

Now the good news....

The method detailed on the this page

http://mysql.gilfster.com/page.php?parent_id=2&page_id=2.0.7

Works great for what you want to do. I just tested it out using your example and it worked fine.

Andrew Gilfrin
------------------
http://gilfster.blogspot.com
My MySQL related Blog

http://www.mysqldevelopment.com
MySQL Stored Procedure,Trigger, View.... (Just about most things these days) Information

Options: ReplyQuote


Subject
Views
Written By
Posted
4825
February 22, 2006 07:31PM
Re: Before insert trigger fires on delete
3436
February 24, 2006 10:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.