Subject | Re: [firebird-support] Trigger - What´s Wrong??? it looks fine for me... |
---|---|
Author | Helen Borrie |
Post date | 2005-09-05T07:08:20Z |
At 02:28 AM 5/09/2005 -0300, you wrote:
the colon prefix on variable and argument names:
-- use the colon when referring to a variable or argument in an SQL statement
-- omit it in ALL other situations
so, e.g.
changes = changes || 'NOME: ' || old."nome" || ' \ ' || new."nome" || ', ';
./hb
>I Keep getting this error:In addition to what others have said, understand the rules about the use of
>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
>
>if (:changes is not null) then
>begin
>INSERT into "HistoryTest"
>values
>(old."id", old."nome", 'now', 'U', :changes);
>end
>end
the colon prefix on variable and argument names:
-- use the colon when referring to a variable or argument in an SQL statement
-- omit it in ALL other situations
so, e.g.
changes = changes || 'NOME: ' || old."nome" || ' \ ' || new."nome" || ', ';
./hb