Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Beginner: trigger doesn't rollback insert
My BEFORE INSERT trigger checks for invalid quantities.
If QTY <= 0, a raise_application_error is issued and outputs a message to the user. I was also expecting the error to roll back the insert but the record is still inserted into the table.
Manual inserts via SQL*Plus seem to be OK (i.e., rolled back by trigger). But the trigger does commit records inserted through stored procs.
How can I prevent the trigger from performing the insert? Any pointers?
Thanks!