MySQL Forums
Forum List  »  Triggers

Re: Negate INSERT
Posted by: Bill Karwin
Date: June 28, 2006 10:52AM

There's no support in MySQL's current implementation of triggers to voluntarily throw an exception and abort the statement that spawned the trigger.

The workaround I've found is to write a BEFORE trigger to set one of the not-NULL columns in the table to NULL, thus violating its NOT NULL constraint. This causes the statement that spawned the trigger to be aborted.

Regards,
Bill K.

Options: ReplyQuote


Subject
Views
Written By
Posted
5168
June 28, 2006 04:22AM
Re: Negate INSERT
9362
June 28, 2006 10:52AM


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.