Subject | Re: [firebird-support] Creating a Database History |
---|---|
Author | Martijn Tonies |
Post date | 2008-02-07T09:07Z |
> > Execute Statement 'Old.' || FieldName INTO :OldString;seems to me you are missing select and from.
> >
> > I get an error of Unknown Token 'Old'.
> >
>
>
> > Execute Statement 'Old.' || FieldName INTO :OldString;
> > Execute Statement 'New.' || FieldName INTO :NewString;
>
> Hi, i can't say I've used execute statement so i had to look it up, but it
>...'
> Something like this:
> execute statement 'select old.' || fieldname || ' from table_name where
This won't work.
Using EXECUTE STATEMENT with a context variable (NEW or OLD)
will never work, cause that's only available inside a trigger, not in a new
statement (the EXECUTE STATEMENT) is not executed inside the trigger,
although it uses the same connection and transaction.
So, there's no way to "walk" the columns to see what has changed.
Have you ever looked at our product IB LogManager that can simplify
creating triggers for you? Take a look at www.upscene.com
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com