Re: Before insert trigger fires on delete
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
Subject
Views
Written By
Posted
4825
February 22, 2006 07:31PM
2360
February 23, 2006 04:45AM
2344
February 23, 2006 08:44AM
2440
February 23, 2006 09:47AM
2447
February 23, 2006 01:42PM
2138
March 02, 2009 07:34AM
Re: Before insert trigger fires on delete
3436
February 24, 2006 10:36AM
2585
February 24, 2006 01:27PM
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.