Subject Re: [firebird-support] Retrieving field new and old value using variable
Author Alexandre Benson Smith
Dimitry Sibiryakov wrote:
> On 18 Jul 2006 at 2:07, Alexandre Benson Smith wrote:
>
>
>> I thought EXECUTE STATEMENT could fit, never used it for this
>> prupouse, but do you mind to explain why it can't help ?
>>
>
> It is executed in different context and thus can't access NEW.* and
> OLD.*.
>
>
humm

ok..

thanks for the info

I was thinking something on this line:

create trigger foo for bar after insert as

declare variable wField varchar(50);
declare variable wStm varchar(2000);

begin
for
select
rf.Field_Name
from
RDB$Relation_Fields rf join
...
where
...
into
:wField
do begin
wStm = 'IF (New.' || wField || ' <> Old.' || wField || ') then
do_some stuff';
Execute Statement wStm;
end
end

Never tried something like this, and hope to never want to try it :-), I
dislike very much this sollution, but I thought in theory could work.

see you !

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