Link to home
Start Free TrialLog in
Avatar of marcelocbf
marcelocbf

asked on

MySQL: Rollback Insert through BEFORE Triggers

Hi,

I'd like to rollback a Insert statement is my check in the BEFORE INSERT trigger don't satisfy a condition ...

I read somewhere that any exception during the trigger would prevent the insert, but I don't know how throw this exceptions ...

Can someone help me ?

Thanks,
Avatar of libin_v
libin_v
Flag of India image

raise_application_error(-10001,'Error in Insert');
ASKER CERTIFIED SOLUTION
Avatar of libin_v
libin_v
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of marcelocbf
marcelocbf

ASKER

Sorry for the delay ...
I'll study your solution ... Thanks