Page 1 of 1

Zeos / Firebird Quotechar problem

Posted: 22.09.2010, 12:32
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

Posted: 22.09.2010, 20:37
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

Posted: 22.09.2010, 21:24
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.

Posted: 13.10.2010, 23:08
by mdaems
Marius2,

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

Mark

Posted: 13.10.2010, 23:45
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