information on query execution

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
rvelasco

information on query execution

Post by rvelasco » Tue 21 Jun 2005 15:34

Hello. Similar to the question by CleaverX, Posted: Mon Jun 13, 2005 9:03 am, I would like to retrieve the information message from the SQL. For example:

mysql> SELECT VERSION(), CURRENT_DATE;
+--------------+--------------+
| VERSION() | CURRENT_DATE |
+--------------+--------------+
| 3.22.20a-log | 1999-03-19 |
+--------------+--------------+
1 row in set (0.01 sec)

The TmyQuery object will publish the information in the tabular format. But I would like to access the information below the table. i.e., the "1 row in set (0.01 sec)". How can I access this information?

Thanks for the help.

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Tue 21 Jun 2005 21:03

Just use a TMyQuery component and put the "select version(),current_date" in the SQL text. When you open it you will get a result like you're selecting directly from any table.

Saludos

J.Pieter Vos

rvelasco

Not the full answer...

Post by rvelasco » Tue 21 Jun 2005 21:58

Correct. TMyQuery will return what I asked it for. However, I want the mySQL response that is OUTSIDE of the boundary.

What I want to get is the following response:


"1 row in set (0.01 sec)"


How do I THAT text? (Of course I am also interested in the main SQL response, but I can already get that).

alec

Re: Not the full answer...

Post by alec » Wed 22 Jun 2005 03:59

rvelasco wrote:"1 row in set (0.01 sec)"
This information calculated on client application and not retrieved from MySQL Server.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 22 Jun 2005 08:04

You can get row count from MyQuery.RecordCount property.

To get time information use follow code:

Code: Select all

var
  tc: cardinal;
...
  tc := GetTickCount;
  MyQuery.Execute;
  tc := GetTickCount - tc; // Time in milliseconds
Please see details in MSDN GetTickCount topic

Post Reply