Page 1 of 1

information on query execution

Posted: Tue 21 Jun 2005 15:34
by rvelasco
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.

Posted: Tue 21 Jun 2005 21:03
by GEswin
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

Not the full answer...

Posted: Tue 21 Jun 2005 21:58
by rvelasco
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).

Re: Not the full answer...

Posted: Wed 22 Jun 2005 03:59
by alec
rvelasco wrote:"1 row in set (0.01 sec)"
This information calculated on client application and not retrieved from MySQL Server.

Posted: Wed 22 Jun 2005 08:04
by Ikar
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