On 9-8-2012 22:13, Sergio wrote: >> 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 > > Thanks Mark! > > Yes... I've been reading it before, but I didn't found any example similar of > what I want to do... > > Perhaps is no possible at all?
I think you need to create an EXECUTE BLOCK statement as text and then execute that using EXECUTE STATEMENT, however I am not actually sure if that would give you access to the NEW and OLD context tables. > Anyway, I was "inspired" in a firebird FAQ > > http://www.firebirdfaq.org/faq133/ That is more an example of how you can use a query to write the trigger code, but the result of that query will still be the normal code inside the trigger. Mark -- Mark Rotteveel
