logo       

Re: Passing strings with quotation marks into SQLite: msg#00114

db.sqlite.general

Subject: Re: Passing strings with quotation marks into SQLite

According to the SQL standards, the proper way to escape quotes in a string is
to escape only the type of quotes surrounding the entire data, and to escape
them by doubling them, i.e.

'foo ''bar''' == foo 'bar'
"foo ""bar""" == foo "bar"

On Wed, Nov 20, 2002 at 12:23:33AM -0000, sergey_sikorsky wrote:
> Hello ALL,
>
> Test table structure:
>
> create table AUX_TABLE(
> NAME varchar(255) not null,
> VAL varchar(255)
> );
>
> SQLite version 2.7.3
> Enter ".help" for instructions
> sqlite> INSERT INTO aux_table(name, val) VALUES("opa", "'t");
> sqlite> INSERT INTO aux_table(name, val) VALUES("opa", '"t');
> sqlite> INSERT INTO aux_table(name, val) VALUES("opa", '\'t');
> ...>
>
> Is there any way to pass a string with single and double quotation
> marks at the same time into SQLite?
>
> Thanks.
>
> Sergey Sikorskiy
>
>
>
> To unsubscribe from this group, send an email to:
> sqlite-unsubscribe-VgYJa0VH1e9BDgjK7y7TUQ@xxxxxxxxxxxxxxxx
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
Mike Swieton
--
The difference between losers and winners is that losers don't fail enough.
- Ross Jeffries

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/JjlUgA/vN2EAA/xGHJAA/EbFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
sqlite-unsubscribe-VgYJa0VH1e9BDgjK7y7TUQ@xxxxxxxxxxxxxxxx



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise