Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: storing the character { into a field.
storing the character { into a field.
Posted: 2008/06/07 10:53
 
I have tried to find it on the forum, but couldn't find it. Sorry if I missed it.
Compliments for the product and the support.

Now to my question:

I have textfields in mysql where the character { is part of the string.
For example, field user, contains the name "carbonaria{france}".

If I do a selection with anydac and mysql f.i.
select * from users where nick="carbonaria{france}" anydac returns the failure
[ANYDAC][Phys]-324. Unknown escape sequence[]

I know that the characters {} are meant to be used with macro processing.
But I have to store these characters {} just into a field.
Is there someway to escape them, like /{ or can I disable the macro function?
Your answer would really be appreciated.

regards
Carbonaria
Re:storing the character { into a field.
Posted: 2008/06/14 02:14
 
There are two options:
1) Use parameters ! That is most safe way.

 ADQuery.SQL.Text := 'select * from users where nick= :p'; ADQuery.Params[0].AsString := 'carbonaria{france}'; ADQuery.Open;


2) Set ResourceOptions.EscapeExpand to False. That disables escape sequences processing.

PS: In AnyDAC 2.0 you can use sequence '{' to disable escape sequence processing.