Subject Re: [firebird-support] Stop the deleting process
Author Lucas Franzen
Marc,

Marc Geldon schrieb:

> Hello!
>
> Is it possible to stop the deleting process in a BEFORE DELETE trigger? I mean: Can I prevent IB/FB from delete a row?

Yes, you can raise an exception.

create exception E_NO_DELETE 'This record cannot be deleted';

create trigger bd_mytable
for mytable before delete
position 0
as
begin
if ( condition for no dleetion is given ) then
begin
exception E_NO_DELETE;
end
end

HTH

Luc.