Zeos / Firebird Quotechar problem

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
Marius2
Fresh Boarder
Fresh Boarder
Posts: 18
Joined: 06.12.2008, 13:07

Zeos / Firebird Quotechar problem

Post by Marius2 »

I'm a returning user wanting to replace unidac and anydac with good old zeos again (as unicode seems to be working now).

My problem, i have a simple query: select * from table_name where field_name="field_value"

On which i get the following error
'SQL Error: Dynamic SQL Error SQL error code = -206 Column unknown field_calue At line 2, column 7. Error Code: -206. Column does not belong to referenced table The SQL: select * from table_name'#$D#$A'where field_name="field_value"'#$D#$A'; '

I think zeos thinks the "field_value" should have been a database field or something like that. Is there something i can do to make zeos/firebird accept the double quote again?

Any other tips are welcome?

Greetings,
Marius
guidoaerts
Senior Boarder
Senior Boarder
Posts: 93
Joined: 01.07.2009, 16:07

Post by guidoaerts »

select * from table_name where field_name = 'field_value'

use single quotes, and if a single quote should be incorporated in a string, it must be two consecutive single quotes (not a double qoute):
'select * from table_name where field_name = ''field_value'''
double quotes are indeed used to reference columns
guido
Marius2
Fresh Boarder
Fresh Boarder
Posts: 18
Joined: 06.12.2008, 13:07

Post by Marius2 »

Thanks Guido,

I have hundreds (mayby even thousands) of hardcoded queries with double qoutes so this solution would cost us a lot of time to correct and test. Like you suggested i use query parameters these day's to avoid the quote clutter.

Unidac and anydac dont complain so i expected something simple setting to turn it of/on which. I will have to check some pretty old zeos sources tomorrow to see if i can dig up some explanation why this has been worked in older versions of zeos.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Marius2,

Are you joking with us?
Don't you remember this old post : http://zeos.firmos.at/viewtopic.php?t=2142

Mark
Image
Marius2
Fresh Boarder
Fresh Boarder
Posts: 18
Joined: 06.12.2008, 13:07

Post by Marius2 »

mdaems wrote:Marius2,

Are you joking with us?
Don't you remember this old post : http://zeos.firmos.at/viewtopic.php?t=2142

Mark
LOL i wish Mark

That was a while ago and since then came zeos database, then unicode and zeos was far from prepared for that. So to get our products working with unicode we switched to anydac (temporarely).

And no joke, we are still use dialect 1, not because of the fun of it, but because changing would take ~200 hours. Sources are now dialect 3 proof and an upgrade plan is on paper to convert to dialect 3 and utf8, its just gonna take time to get there. As a mainframe worker you know changes come slow, so mayby next year i can say that problem is out of the way.

I just hope Zeos is then 100% unicode ready also, it worries me to see zeos in beta stage after al this time since the release of delphi 2009.

Greetings,
Marius
Locked