Subject Re: [firebird-support] execute statement
Author Mark Rotteveel
On 9-8-2012 22:03, Sergio wrote:
>
> Hello! I'm trying to do a trigger to maintain a history table. I'm using (for the first time!) execute statement. What I want to do is very simple: if a field change I save the old value in the history
>
> When I execute the trigger I get an error:
>
> Invalid token.
> Dynamic SQL Error.
> SQL error code = -104.
> Token unknown - line 1, column 1.
> if.
>
> I'm sure I'm using "execute statement" in the wrong way !!!
>
> this is the trigger:

EXECUTE STATEMENT is for executing queries only, your code is not just a
query as it contains an IF statement. I think for your purposes you need
to use EXECUTE BLOCK
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-execblock.html

Mark
--
Mark Rotteveel