Re: [sqlite] apostrophes in strings...

2011-02-23 Thread Scott Hess
On Wed, Feb 23, 2011 at 12:50 PM, BareFeetWare wrote: > On 21/02/2011, at 8:11 AM, Scott Hess wrote: >> You can also convert: >>  ATTACH DATABASE x AS y KEY z >> to: >>  SELECT sqlite_attach(x, y, z) >> where the parameters can be turned into bind arguments.  Then embedded >> quotes won't be an i

Re: [sqlite] apostrophes in strings...

2011-02-23 Thread BareFeetWare
On 21/02/2011, at 8:11 AM, Scott Hess wrote: > You can also convert: > ATTACH DATABASE x AS y KEY z > to: > SELECT sqlite_attach(x, y, z) > where the parameters can be turned into bind arguments. Then embedded quotes > won't be an issue. SQLite won't allow an "attach" statement within a trans

Re: [sqlite] apostrophes in strings...

2011-02-23 Thread Simon Slavin
On 23 Feb 2011, at 3:15pm, Sam Carleton wrote: > Thank you, that is what I needed. Now to statisfy my curiosity... What > exactly is the KEY value? It took me a second read of this message to grin at it. Simon. ___ sqlite-users mailing list sqlite-u

Re: [sqlite] apostrophes in strings...

2011-02-23 Thread Richard Hipp
On Wed, Feb 23, 2011 at 10:15 AM, Sam Carleton wrote: > Kevin, > > Thank you, that is what I needed. Now to statisfy my curiosity... What > exactly is the KEY value? > The KEY is used by the (proprietary) SQLite Encryption Extension. It allows you to ATTACH an encrypted database and specify t

Re: [sqlite] apostrophes in strings...

2011-02-23 Thread Scott Hess
I believe the key is used for attaching to encrypted databases. -scott On Wed, Feb 23, 2011 at 7:15 AM, Sam Carleton wrote: > Kevin, > > Thank you, that is what I needed.  Now to statisfy my curiosity...  What > exactly is the KEY value? > > On Tue, Feb 22, 2011 at 10:39 PM, Kevin Benson > wro

Re: [sqlite] apostrophes in strings...

2011-02-23 Thread Sam Carleton
Kevin, Thank you, that is what I needed. Now to statisfy my curiosity... What exactly is the KEY value? On Tue, Feb 22, 2011 at 10:39 PM, Kevin Benson wrote: > The suggestion apparently derives from comments in attach.c > For example: > > http://gears.googlecode.com/svn/trunk/third_party/sqlit

Re: [sqlite] apostrophes in strings...

2011-02-22 Thread Kevin Benson
The suggestion apparently derives from comments in attach.c For example: http://gears.googlecode.com/svn/trunk/third_party/sqlite_google/src/attach.c /* ** An SQL user-function registered to do the work of an ATTACH statement. The ** three arguments to the function come directly from an attach sta

Re: [sqlite] apostrophes in strings...

2011-02-22 Thread Sam Carleton
On Mon, Feb 21, 2011 at 9:42 AM, Sam Carleton wrote: > On Sun, Feb 20, 2011 at 4:11 PM, Scott Hess wrote: > >> You can also convert: >> ATTACH DATABASE x AS y KEY z >> to: >> SELECT sqlite_attach(x, y, z) >> where the parameters can be turned into bind arguments. Then embedded >> quotes won't

Re: [sqlite] apostrophes in strings...

2011-02-20 Thread Scott Hess
You can also convert: ATTACH DATABASE x AS y KEY z to: SELECT sqlite_attach(x, y, z) where the parameters can be turned into bind arguments. Then embedded quotes won't be an issue. -scott On Sun, Feb 20, 2011 at 11:31 AM, Pavel Ivanov wrote: > I believe doubling the single quote inside th

Re: [sqlite] apostrophes in strings...

2011-02-20 Thread Pavel Ivanov
I believe doubling the single quote inside the string literal should help. Pavel On Sun, Feb 20, 2011 at 2:23 PM, Sam Carleton wrote: > This is a bit crazy and I know the ideal way would be to not allow the > apostrophy in the first place but, my focus is easy of use for my customers, > as comp

[sqlite] apostrophes in strings...

2011-02-20 Thread Sam Carleton
This is a bit crazy and I know the ideal way would be to not allow the apostrophy in the first place but, my focus is easy of use for my customers, as compared to easy for me... I had a customer that saved their SQLite database here: D:/My Events/President's Day/event.sqlite My software uses ATT

Re: [sqlite] Apostrophes in strings

2004-08-07 Thread Paul Smith
Apply the php-function "sqlite_escape_string" on all the string data you insert/update to the database. That should to the trick. Thanks, it just makes a '' from ' instead of \' as with MySQL. Reminds me a bit of Visual Basic... It's the standard SQL way of escaping a ' character (MySQL (and som

Re: [sqlite] Apostrophes in strings

2004-08-07 Thread Yves Goergen
On 07.08.2004 12:04 (+0200), Yves Glodt wrote: Apply the php-function "sqlite_escape_string" on all the string data you insert/update to the database. That should to the trick. Thanks, it just makes a '' from ' instead of \' as with MySQL. Reminds me a bit of Visual Basic... p.s. There is also "

Re: [sqlite] Apostrophes in strings

2004-08-07 Thread Yves Glodt
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Saturday 07 August 2004 11:46, Yves Goergen wrote: > Hi everyone, Hi, > I found the SQLite DLL for PHP today and just wanted to do some > testing with it. I could rewrite my dump of the MySQL tables and data > so that SQLite would understand it. B

[sqlite] Apostrophes in strings

2004-08-07 Thread Yves Goergen
Hi everyone, I found the SQLite DLL for PHP today and just wanted to do some testing with it. I could rewrite my dump of the MySQL tables and data so that SQLite would understand it. But there's a fundamental problem left. I have strings that contain ' characters. But strings are written in '' char