advanced - work around for user defined exceptions inside triggers
hello guys
i am relatively new to mysql, coming from the oracle world.. i actually use 5.0 server version
i noticed (correct me if i am wrong, i hope it so) there is no a simple way to raise user defined errors to user.. for example.. checking a combo of fields, when the values are not good, i would block the dml and raising a specific exception... something like "RAISE_APPLICATION_ERROR(-20201,'some mistake');"
so, a workaround could be generating another error (i.e. dup val on index on another table created specifically for this scope), while inserting somewhere (in another table) the warning(s) found..
but this doesn't lead to anywhere if this insert is not made in another transaction different from the one from where was raised the event that launched the trigger..
matter of fact, an error on the trigger rollbacks ALL the transaction, also the rows in the log table.. instead, i would like to raise the error in the trigger and then querying the log table to understand what happened..
at this point i don't know how to proceed.. i think not to be the first to have this problem, i would like to know if there is another way...
claudio
Subject
Views
Written By
Posted
advanced - work around for user defined exceptions inside triggers
2932
May 03, 2011 08:06AM
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.