Feature request : Add Comments

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Zagawa
Posts: 21
Joined: Fri 12 May 2006 09:56

Feature request : Add Comments

Post by Zagawa » Tue 26 Sep 2006 08:35

Hi,

Sometimes, we need to change Query in a TMyQuery. It's a good thing for us if we could keep a track of the old query.

Like in Mysql Client ' -- ' could ignore the rest of the line..

ex :

Code: Select all

select * from actions
--where cAction = 'C'
order by cActionSoc
For the moment we are obliged to delete modifications..

Do you think it's possible to add this feature in nearest future ?

Best Regards

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 26 Sep 2006 09:04

Please specify what version of MyDAC and what version of MySQL Server do use.

Zagawa
Posts: 21
Joined: Fri 12 May 2006 09:56

Post by Zagawa » Tue 26 Sep 2006 09:17

Sorry :?

mydac 4.40.0.18
Mysql 5.0.24a

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 26 Sep 2006 11:45

MyDAC supports comments like MySQL Server does. You should place one or more spaces between '--' and the text you want to be commented. In the example you have posted you should replace the line

Code: Select all

  --where cAction = 'C'

with the following one:

Code: Select all

  -- where cAction = 'C'

Zagawa
Posts: 21
Joined: Fri 12 May 2006 09:56

Post by Zagawa » Tue 26 Sep 2006 12:38

Thanks,

The Mysql command line client accept without space because it remove lines which are under comments.
Comments are never sent to mysql Server whith command line client.

This induced me in error.

thanks again,
Best Regards

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 26 Sep 2006 13:09

We try to avoid changing SQL code entered by user. That is why MyDAC does not eliminate comments from the SQL statement. So you should use the same comment syntax as described in this topic of MySQL Reference Manual.

Post Reply