Subject Re: [firebird-support] I can't use new.FIELD in a EXECUTE STATEMENT called into a Trigger
Author Milan Babuskov
marc_guillot wrote:
> In a very simple sample, into a Trigger I can use :
>
> select new.ROW_ID from rdb$database into :ROW_ID
>
> But using EXECUTE STATEMENT this doesn't works :
>
> SQL = 'select new.ROW_ID from rdb$database';
> execute statement :SQL into :ROW_ID;
>
> There is any way to access to new. and old. trigger fields

This should work:

SQL = 'select '||new.ROW_ID||' from rdb$database';
execute statement :SQL into :ROW_ID;


Be careful, if the referenced field is not a number, you'll need to put
in in quotes. Example for a date field:

SQL = 'select '''|| new.DATE_FIELD ||''' from rdb$database';

HTH

--
Milan Babuskov

==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================