Subject Re: Retrieving field new and old value using variable
Author Adam
--- In firebird-support@yahoogroups.com, Alexandre Benson Smith
<iblist@...> wrote:
>
> TechVale - Gustavo wrote:
> > Hi All,
> >
> > May i retrieve the "new" and "old" field values using its field
name in a trigger ?
> >
> > i would like to do something like :
> >
> > for select <SelectToGetAllFieldsNameInTable> into :MyFieldName do
> > begin
> > if( <OldFieldNameUsingMyFieldNameVar> <>
<NewFieldNameUsingMyFieldNameVar> ) then ...
> >
> > Thanks in advanced,
> >
> > Gustavo.
> >
>
> Gustavo,
>
> You could go the EXECUTE STATEMENT way.
>
> But I would create a simple app that reads the RDB$Relations,
> RDB$Relation_Fields, etc. and generate a script with the full SQL
>

I think he is talking about the OLD and NEW context variables
available within triggers. It looks like he is attempting to cycle
through each field in the given table (probably through system
tables), then check field by field whether the value has changed,
possibly some sort of replication idea.

I may be mistaken, but I don't think this is possible at the moment,
although I can see its merit.

Adam