Page 1 of 1

[SOLVED] SQL Syntax not the same with TZQuery component interface and source code property...

Posted: 06.11.2016, 08:02
by gelinp
Hi,

I'm using Lazarus 1.6 with Free Pascal 3.0 and MySQL server version: 5.5.52-0+deb8u1 (Debian) for my database.

I remark that when I use graphical TZQuery component to prototype my application I can set SQL property with natural SQL syntax like :

SELECT * FROM DOCClassements WHERE idplan = :idplan

But when I set SQL property to the same TZQuery in source code I have to add a lot of [`] characters for each table and field names like :

SELECT * FROM `DOCClassements` WHERE `idplan` = :idplan

I would like to use same syntax with TZQuery component in toolbar or class in source code... So i have two questions :

1. Why this is like this ?
2. If I connect later to SQLite database, do you think SQL source code syntax will be different ? (I know it's the same with graphical TZQuery component because i already tested).

Thank you for your response.
Patrick

Re: SQL Syntax not the same with TZQuery component interface and source code property...

Posted: 06.11.2016, 17:16
by marsupilami
Hello Patrick,

duh - that sounds impossible. What error message do you get when you don't quote the table name and the column name in your source code?
Best regards,

Jan

Re: SQL Syntax not the same with TZQuery component interface and source code property...

Posted: 06.11.2016, 20:32
by gelinp
Sorry, you are write ยง Now I can't see any else !!! May be I confused with another one error... It's better kile this, I was disappointed to add a lot of this stuff...

Thanks anyway ! And sorry again...