Subject Re: [firebird-support] Is it possible to cancel UPDATE with update trigger ?
Author Mr. John
Thanks Alexandre,one question: in your code why UPDATE will not fire also,because you delete 'current' record ?







________________________________
From: Alexandre Benson Smith <iblist@...>
To: firebird-support@yahoogroups.com
Sent: Tue, November 10, 2009 9:48:44 PM
Subject: Re: [firebird-support] Is it possible to cancel UPDATE with update trigger ?


John,

Mr. John wrote:
> Hi !
> Is it possible to cancel update inside UPDATE trigger and perform delete and insert ?
> I have complex triggers for insert and delete and instead of writing also an update trigger i want to force
> update =delete+insert.
> Thanks.
>

I don't remember if I already did something like that.. but I believe so...

Create trigger TU_Table for Table before update as
begin
Delete from Table where PK = old.PK;
Insert into Table (Pk, Col1, Col2) values (new.PK, new.Col1, New.Col2);
end

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware. com.br







[Non-text portions of this message have been removed]