Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto generated SQL command in Cursor Adaptor 1

Status
Not open for further replies.

vhad

Programmer
May 27, 2001
26
ID
I want to log every action.
How to get the auto-generated SQL command by CursorAdaptor when updating/deleting/insert?

Thanks,

Vince
 
You should let the ODBC driver log the passed in SQL, that's for example possible with MySQL ODBC.

You can intercept what's done the BeforeInsert/Update/Delete methods of the CA, and get the Insert/Update/Delete queries as a prameter of these events. But only the ODBC driver or SQL Server will be able to tell you the expanded queries with values set in for parameters. Also this is only possible, if you limit CA to do no batch operations, just committing one record/command at a time, meaning this is influenced by the setting of BatchUpdateCount. This is also mentioned in the help on the Before... events.

You would rather analyse what arrives at the server side with server side tools, sql query logging and or transaction logging. For example the MySQL ODBC driver offers the option to log queries to %TEMP%/myodbc.sql, that differs from database to database.

Bye, Olaf.

 
Thanks Olaf,

That explains everything.

Maybe I'll do at the server side with server side tools, or using triggers.
I'll do more research.

What I want to do is logging every Update/Insert/Delete action in the database.
So I can replicate the database, by sending the log one by one, and do the same action in the other database.
Because I need to send data by WAN with a very small bandwidth.

Thank you,

Vincent
 
Well, for that there is replication. What database do you use?

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top