de***@system102.com wrote:
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+?
I haven't tried this, but I would recommend experimenting with
"SELECT ... INTO OUTFILE".
See
http://dev.mysql.com/doc/mysql/en/select.html.
Tip: you can use SELECT without querying a table. E.g., the following
works:
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
http://dev.mysql.com/doc/mysql/en/binary-log.html
Also read
http://dev.mysql.com/doc/mysql/en/st...e-logging.html for
logging issues related specifically to triggers.
Regards,
Bill K.