Subject Re: [firebird-support] Trigger - What´s Wrong??? it looks fine for me...
Author Aage Johansen
Patrick Antonioli wrote:
> I Keep getting this error:
> Unsuccessful execution caused by a system error that precludes
> successful execution of subsequent statements.
> Dynamic SQL Error.
> expression evaluation not supported.
> Create trigger ..............................
> AS
>
> declare variable changes varchar(1000) ;
>
> begin
>
> changes = '';
>
> IF (old."id" <> new."id") THEN
> begin
> changes = :changes + 'ID: ' || old."id" || ' \ ' || new."id" || ', ';
> end
>
> IF (old."nome" <> new."nome") THEN
> begin
> changes = :changes + 'NOME: ' || old."nome" || ' \ ' || new."nome" || ', ';
> end
>

Apart from the concatenation problem, ...
I don't think CHANGES will ever be "not null".


> if (:changes is not null) then
> begin
> INSERT into "HistoryTest"
> values
> (old."id", old."nome", 'now', 'U', :changes);
> end
> end


--
Aage J.