Page 1 of 1

Escaping identifiers in SQL query

Posted: 24.06.2008, 06:17
by Atlant
[lang=English]
Interesting idea!

Identifiers of fields in inquiry to shield, for example

Code: Select all

SELECT %Menu first%, %Menu Two% FROM %Table number 1% 
And it is transformed :
for MySql:

Code: Select all

SELECT `Menu first`, `Menu Two` FROM `Table number 1`
- for Postgres:

Code: Select all

SELECT "Menu first", "Menu Two" FROM "Table number 1"

[lang=Russian]
Интересная идея!

Ввести обобщенный символ для экранирования идентификаторов полей, например %
И использовать его для возможности создания более общих запросов
Примеры - выше.

Posted: 24.06.2008, 22:14
by mdaems
Seems like a useful feature.
I suppose we need 1 new TZReadOnlyQuery property : 'IdentifierQuote : string'. When this property is not empty we need some extra parsing using the DatabaseMetadata identifierquoting information.
If somebody can work this out, the feautre could be added quickly...

Mark