11-05-2009 04:39 PM
Hi,
I'm trying to query some data in a diadem script. The syntax which works fine in the MySQL query browser is:
SELECT * FROM uut_battery_task_summary WHERE uut_result = "{19dc2179-c4e8-436f-a3b1-e91651b8924f}";
but when structuring the query in a vb script in Diadem I am getting an "invalid character" at the "{" character with the line:
Call SQL_ExecDirect("SELECT * FROM uut_battery_task_summary WHERE uut_result = "{19dc2179-c4e8-436f-a3b1-e91651b8924f}"")
So I tried escaping the quotes, with:
Call SQL_ExecDirect("SELECT * FROM uut_battery_task_summary WHERE uut_result = \"{19dc2179-c4e8-436f-a3b1-e91651b8924f}\"")
and I am still getting the error with the same character. This is probably a newbie error, just starting out with VB. Can someone point out what is wrong? Can I literally enclose {19dc2179-c4e8-436f-a3b1-e91651b8924f} without it complaining somehow? I also tried LIKE "19dc2179-c4e8-436f-a3b1-e91651b8924f", and also with escaped \" quotes, but still no luck.
Thanks for any help
David J.
Solved! Go to Solution.
11-06-2009 12:55 AM - edited 11-06-2009 12:55 AM
Hello David!
In VBS a double-quote is escaped with a double-double-quote. In your examplel
Call SQL_ExecDirect("SELECT * FROM uut_battery_task_summary WHERE uut_result = ""{19dc2179-c4e8-436f-a3b1-e91651b8924f}""")
should work.
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
11-18-2009 12:32 PM
Ah thanks. I actually solved this also by using a single quote, strangely enough.
Regards,
David J.