|Subject||Re: Trigger - What´s Wrong??? it looks fine for me...|
> Unsuccessful execution caused by a system error that precludes|| ', ';
> successful execution of subsequent statements.
> Dynamic SQL Error.
> expression evaluation not supported.
> Create trigger ..............................
> declare variable changes varchar(1000) ;
> changes = '';
> IF (old."id" <> new."id") THEN
> changes = :changes + 'ID: ' || old."id" || ' \ ' || new."id"
> endLook closely at the next line!!!
> IF (old."nome" <> new."nome") THEN
> changes = :changes + 'NOME: ' || old."nome" || ' \ ' || new."nome"|| ', ';
Use || instead of +
> endThe next line will also give you grief.
> if (:changes is not null) thenChanges will be '' or have some value in it. It will not be NULL
because unless one of the strings you are appending to it is NULL. So
to preempt your next question about why the insert isn't working,
change the above line to
if (:changes <> '') then