Re: [sqlite] INSERT failing.

2010-03-23 Thread Paul Corke
> unrecognized token: ""Man weiss es nicht, aber es war ein Feiertag.")"

The character after the . is not a double-quote, plus you should be
using single quotes anyway.

Paul.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] INSERT failing.

2010-03-22 Thread P Kishor
On Mon, Mar 22, 2010 at 11:59 PM, Ted Rolle  wrote:
> Here's the table definition:
>  1  CREATE TABLE jokes (
>  2   source    TEXT,
>  3   language  TEXT,
>  4   question  TEXT,
>  5   answer    TEXT
>  6  );
> This works.
> This doesn't:
> INSERT INTO jokes
> VALUES ("Radio Eriwan","de_DE","Frage an Radio Eriwan:  An welchem Tag genau
> starb Josef Stalin?","Man weiss es nicht, aber es war ein Feiertag.“)
> Here's the error message:
> Last Error: unrecognized token: ""Man weiss es nicht, aber es war ein
> Feiertag.“)"


Works just fine for me; see below. Next time try using single quotes
to delimit the text strings (I have no idea why folks use
double-quotes to do so... obviously they are getting into this habit
from some other software usage). SQL uses single quotes to delimit
strings, and doubles quotes are used for defining entities (table
names, column names, etc.) that would otherwise clash with keywords or
other SQL rules.

punk...@lucknow ~/Data/punkish$sqlite3
-- Loading resources from /Users/punkish/.sqliterc
SQLite version 3.6.19
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE jokes (source TEXT, language TEXT, question TEXT,
answer TEXT);
sqlite> INSERT INTO jokes VALUES ('Radio Eriwan','de_DE','Frage an
Radio Eriwan:  An welchem Tag genaustarb Josef Stalin?','Man weiss es
nicht, aber es war ein Feiertag.');
sqlite> SELECT * FROM jokes;
sourcelanguagequestion
answer
  --
---
-
Radio Eriwan  de_DE   Frage an Radio Eriwan:  An welchem Tag
genaustarb Josef Stalin?  Man weiss es nicht, aber es war ein
Feiertag.
sqlite>


-- 
Puneet Kishor
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] INSERT failing.

2010-03-22 Thread Ted Rolle
Here's the table definition:
  1  CREATE TABLE jokes (
  2   sourceTEXT,
  3   language  TEXT,
  4   question  TEXT,
  5   answerTEXT
  6  );
This works.
This doesn't:
INSERT INTO jokes
VALUES ("Radio Eriwan","de_DE","Frage an Radio Eriwan:  An welchem Tag genau
starb Josef Stalin?","Man weiss es nicht, aber es war ein Feiertag.“)
Here's the error message:
Last Error: unrecognized token: ""Man weiss es nicht, aber es war ein
Feiertag.“)"
-- 
_
3.14159265358979323846264338327950Let the spirit of pi
2884197169399375105820974944592307  spread all over the world!
8164062862089986280348253421170679 http://pi314.at  PI VOBISCUM!

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users