[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] Adding data with periods
From:       "aditya siram" <aditya.siram () gmail ! com>
Date:       2008-12-15 5:28:58
Message-ID: 594f78210812142128p4a2ce03cyfad3dcd81c9f5b64 () mail ! gmail ! com
[Download RAW message or body]

Thanks a lot. The issue has been fixed with:
INSERT INTO TEST_TABLE(CONTENTS) VALUES ("Hello. World!");

I was thrown by the error message that seemed to be complaining about the
periods when I was actually missing the VALUES(...) clause.

Appreciate the quick response ...
deech

On Sun, Dec 14, 2008 at 11:21 PM, John Stanton <johns@viacognis.com> wrote:

> Note that literal delimiters in SQL are single quotes, e.g. 'This is an
> SQL literal'.
>
> It is good practice with Sqlite to use bound variables.  You avoid
> possible SQL injection attacks and limit sensitivity to data content.
>
> aditya siram wrote:
> > Hi all,
> > I'm having trouble adding data with period characters in it. I tries to
> > escape the period with a `'` but that didn' t seem to work. Here is an
> > example interaction:
> >
> > sqlite> create table test_table ("Contents" varchar);
> > sqlite> insert into test_table "hello . world";
> > SQL error: near ""hello . world"": syntax error
> > sqlite> insert into test_table "hello '. world";
> > SQL error: near ""hello '. world"": syntax error
> >
> > Thanks ...
> > deech
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic