Subject RE: [firebird-support] Re: SQL Statement that fired trigger?
Author Alan McDonald
> --- In firebird-support@yahoogroups.com, "Martijn Tonies"
> <m.tonies@...> wrote:
> >
> >
> > > I would like to know if someone knows of a way to get the SQL
> > > statement that caused a trigger to fire?
> >
> > You cannot, you can only know if it's an insert, delete or update
> > statement.
> >
> > 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
> >
> Are you sure there is absolutely no way? But please do share how to
> know if it's an insert, delete or update please.
>
> Thanks
> Anton

use an external table as a log
use your before insert/update/delete triggers to insert into the external
table
if it's an insert then insert a record called insert, if it's update insert
update.. etc
other than that you can't know the exact SQL unless you use a proxy to
intercept and log the SQL to/from the server.
Alan