Escaping identifiers in SQL query

Freature requests from users for ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist, mdaems

Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 24.06.2008, 03:35

Escaping identifiers in SQL query

Postby Atlant » 24.06.2008, 06:17

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"

Интересная идея!

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

User avatar
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium

Postby mdaems » 24.06.2008, 22:14

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...


Return to “Feature Requests”

Who is online

Users browsing this forum: No registered users and 1 guest