MySQL Forums
Forum List  »  Triggers

Re: inserting and updating
Posted by: Roland Bouman
Date: December 19, 2007 05:09AM

You can't do that - not natively.

The work around is to provoke an error in some way, like setting a NOT NULL column to NULL:

SET NEW.column := NULL;

which may make sense if your trigger is validating input on a NOT NULL column.

Otherwise, you can call a UDF that always fails, see:

http://rpbouman.blogspot.com/2005/11/using-udf-to-raise-errors-from-inside.html

There is also a patch available if you are willing to recompile the server:

http://koke.amedias.org/articles/2007/05/09/hacking-mysql-signal-support-i/

I hope this helps,

Roland Bouman
http://rpbouman.blogspot.com/

Options: ReplyQuote


Subject
Views
Written By
Posted
25043
November 17, 2005 04:00AM
16729
November 17, 2005 06:58AM
23682
November 19, 2005 08:53AM
14504
February 23, 2006 02:28AM
10792
February 23, 2006 04:42AM
15454
February 24, 2006 08:28AM
8485
February 24, 2006 10:15AM
6273
February 24, 2006 12:42PM
7892
February 27, 2006 08:56AM
6690
February 27, 2006 11:27AM
18878
February 28, 2006 05:22AM
6539
December 20, 2006 03:34AM
4104
November 18, 2008 08:28AM
4749
November 18, 2008 12:45PM
6162
December 19, 2006 11:00AM
4963
December 19, 2006 02:35PM
6216
December 19, 2006 07:53PM
4408
December 20, 2006 03:37AM
4613
December 19, 2006 11:01AM
5492
November 24, 2006 05:32AM
4470
November 24, 2006 07:02AM
3615
December 23, 2008 06:08AM
11181
February 25, 2006 11:48PM
4945
December 19, 2007 04:24AM
3919
December 24, 2008 01:02PM
4765
December 19, 2007 03:59AM
Re: inserting and updating
4622
December 19, 2007 05:09AM
3520
November 18, 2008 08:25AM
3903
November 18, 2008 12:49PM
6004
December 19, 2007 04:46AM


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.