Throw an error in a MySQL trigger *

Question

If I have a trigger before the update on a table, how can I throw an error that prevents the update on that table?

Answer

Here is one hack that may work. It isn't clean, but it looks like it might work:

Essentially, you just try to update a column that doesn't exist.

< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/24/" >Throw an error in a MySQL trigger< /a>
Share on Google Plus

About Cinema Guy

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment