trigger question.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi everyone,
  I have an Oracle trigger that writes any updates to a specified table
to a file on the filesystem (using pl/sql).  How can this be done using
triggers in mySQL 5+?

Thanks in advance for your help.

Re: trigger question. wrote:
Quoted text here. Click to load it

I haven't tried this, but I would recommend experimenting with

Tip:  you can use SELECT without querying a table.  E.g., the following
   SELECT "literal string" INTO OUTFILE

The question is whether it works inside a trigger in MySQL 5.0.x.  The
only definitive answer is to try it and see.

Note that this feature works only if the specified output file cannot
previously exist.  This prevents SQL queries from clobbering critical
system files, such as /etc/passwd or database tables.  This might make
it awkward for your triggers to write incremental updats.

Alternatively, you could try using the MySQL query log or binary log to
record changes automatically, and then write some other application to
filter the log.  See

Also read for
logging issues related specifically to triggers.

Bill K.

Site Timeline