[Lazarus] What is a TSQLTransaction and why do I need one?
michael.vancanneyt at wisa.be
michael.vancanneyt at wisa.be
Wed Dec 1 16:01:46 CET 2010
On Wed, 1 Dec 2010, Joost van der Sluis wrote:
>
>> Is there somewhere I can hook into the TSQLQuery to (a) see exactly what
>> query was passed to the server (b) collect any error text and (c) get
>> execution timing?
>
> a) Easiest is to use the database-client's log mechanism. (If there is
> any). Else you can change the TPQConnection.Preparestatement function.
> The 'buf' parameter is the actual query. But as you'll see it also adds
> some more to the query, so it opens a cursor, before it is send to the
> database-server.
>
> b) Ehm.. the error-text is in the exception?
>
> c) Hook into TPQConnection.PrepareStatement and TPQCOnnection.Execute
I am a firm proponent of putting a unified mechanism for a) and c) in
TSQLQuery/TSQLConnection, and have, in fact, a patch ready for this
(it implements a simple event mechanism for the log).
I'm tired of re-implementing this for each project...
Michael.
More information about the Lazarus
mailing list