Subject | Re: Trigger - What´s Wrong??? it looks fine for me... |
---|---|
Author | Adam |
Post date | 2005-09-05T06:25:22Z |
> 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"
> endLook closely at the next line!!!
>
> IF (old."nome" <> new."nome") THEN
> begin
> 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
Adam