Page 1 of 1

Feature request : Add Comments

Posted: Tue 26 Sep 2006 08:35
by Zagawa
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

Posted: Tue 26 Sep 2006 09:04
by Antaeus
Please specify what version of MyDAC and what version of MySQL Server do use.

Posted: Tue 26 Sep 2006 09:17
by Zagawa
Sorry :?

mydac 4.40.0.18
Mysql 5.0.24a

Posted: Tue 26 Sep 2006 11:45
by Antaeus
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'

Posted: Tue 26 Sep 2006 12:38
by Zagawa
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

Posted: Tue 26 Sep 2006 13:09
by Antaeus
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.