Subject | Re: [firebird-support] Is it possible to cancel UPDATE with update trigger ? |
---|---|
Author | Mr. John |
Post date | 2009-11-10T20:08:52Z |
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:
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]
________________________________
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 !I don't remember if I already did something like that.. but I believe so...
> 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.
>
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]