0

i have a problem with the following SQL command using SQLite Manager:

CREATE TABLE "types" ("id" INTEGER PRIMARY KEY, "name" TEXT, "kind" TEXT, "length" INTEGER);

It generates the following syntax error:

SQLiteManager:

CREATE TABLE "types" ("id" INTEGER PRIMARY KEY, "name" TEXT, "kind" TEXT, "length" INTEGER); [ near "": syntax error ]
Exception Name: NS_ERROR_FAILURE
Exception Message: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)         
[mozIStorageConnection.createStatement]

But i cannot see any problem in the statement. Can anybody help me with this?

Update: I found the bug: I copied the line out of a text editor:

CREATE TABLE "types" ("id" INTEGER PRIMARY KEY, "name" TEXT, "kind" TEXT, "length" INTEGER)?;

In the text editor there is no ? at the end. Also in SQLite Manager the ? is not visible. But on command line i can see there is a ? if i paste the line from clipboard. If the ? is removed it works perfectly in SQLite Manager :D

1 Answer 1

1

This works without problems.

$ sqlite3 
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE "types" ("id" INTEGER PRIMARY KEY, "name" TEXT, "kind" TEXT, "length" INTEGER);
sqlite> .schema
CREATE TABLE "types" ("id" INTEGER PRIMARY KEY, "name" TEXT, "kind" TEXT, "length" INTEGER);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.