Subject | RE: [firebird-support] Escaping a string |
---|---|
Author | Norman McFarlane |
Post date | 2008-09-01T20:26:27Z |
Hi Helen,
Thanks so much. I thought that might be the case!
Regards,
Norman
_____
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Helen Borrie
Sent: 01 September 2008 04:13 PM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Reading BLOB field data
At 23:14 1/09/2008, you wrote:
string as anything but a string unless you "do something" to make it treat
it differently.
The only thing that you ever have to escape is the apostrophe (a.k.a.
single-quote) character to protect it from being interpreted as a string
delimiter.
Fb 2.1 has some function calls to make the engine treat a string (along with
some other constant types) as a hex literal...
./heLen
[Non-text portions of this message have been removed]
Thanks so much. I thought that might be the case!
Regards,
Norman
_____
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Helen Borrie
Sent: 01 September 2008 04:13 PM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Reading BLOB field data
At 23:14 1/09/2008, you wrote:
>Hi group,No
>
>I am converting an existing MySQL database application (very old version of
>MySQL) to FB 2.x.
>
>I writing the code to emulate the calls made to the MySQL Classes, I have
>come across a call to mysql_escape_string() which effectively escapes a
>string by pre-pending a \ to certain characters. For example, a string like
>this XA00 is the value will be returned as follows \XA00 is the value. This
>is apparently to make the string safe to pass to MySQL in a query.
>
>Is there something similar for Firebird
>, and is it in fact necessary?No. In real SQL the boot is really on the other foot. It doesn't treat a
string as anything but a string unless you "do something" to make it treat
it differently.
The only thing that you ever have to escape is the apostrophe (a.k.a.
single-quote) character to protect it from being interpreted as a string
delimiter.
Fb 2.1 has some function calls to make the engine treat a string (along with
some other constant types) as a hex literal...
./heLen
[Non-text portions of this message have been removed]