If I have a
before the update on a table, how can I throw an error that prevents the update on that table?
Hi can you make a practical example on how to write the trigger in the link?I have two columns (idUser and idGuest) that must be mutually exclusive in the table orders, but i'm fairly new to triggers and i'm finding difficulties in writing it!Thx.
In procedure insert_test if new.id < 0 isn't valid syntax if should if P_id < 0
First hack is not working #1103 - Incorrect table name 'Error: invalid_id_test'.
happy_marmoset, isn't the whole point to raise an error? By using The error text as a table name, the error is triggered and the insert is prevented. As I understand this is a way to do it, if your mysql < 5.5
While this code snippet may solve the question, including an explanation really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion. Please also try not to crowd your code with explanatory comments, as this reduces the readability of both the code and the explanations!