Subject | Re: [firebird-support] I can't use new.FIELD in a EXECUTE STATEMENT called into a Trigger |
---|---|
Author | Milan Babuskov |
Post date | 2009-07-11T14:40:15Z |
marc_guillot wrote:
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
==================================
> In a very simple sample, into a Trigger I can use :This should work:
>
> 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
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
==================================