Subject Re: [firebird-support] Custom RI was Re: Possible bug with CHECK constraint
Author Martijn Tonies
Hi,

> You can find several articles on Stored Procedures and Triggers at:
>
>
http://www.ibphoenix.com/a418.htm?a=ibphoenix&s=1096817336:414488&page=ibp_document
>
> It was enough to get me going.
>
> Not sure, but I don't think you can abort execution of a sql statement
> in a trigger. Probably a stored
> procedure is better suited to tackle your problem.

You can - by raising an exception. Obviously, you need to catch this
exception in your client code as you would with a FK exception.

You can create custom exceptions via
CREATE EXCEPTION <name> '<message>'

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com