1

I'm having a problem with creating a table:

Error:

08-31 02:31:21.559    4121-4121/? E/SQLiteLog﹕ (1) near "limit": syntax error
08-31 02:31:21.689    4121-4121/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start receiver com.mbb.common.SmsReceiver: android.database.sqlite.SQLiteException:
near "limit": syntax error (code 1): , while compiling: CREATE TABLE
feedback(type, speed, expaierdate, date , limit );

MY Code:

 db.execSQL("CREATE TABLE feedback(type , speed , expaierdate , date , limit);");

1 Answer 1

3

LIMIT is a keyword.

You can either quote it:

db.execSQL("CREATE TABLE feedback(type, speed, expaierdate, date, \"limit\");");

(in which case you have to quote it every time you use it), or use another name:

db.execSQL("CREATE TABLE feedback(type, speed, expiredate, date, some_limit);");
Sign up to request clarification or add additional context in comments.

1 Comment

+1 and a quick question, what is the data type of all these columns if you dont specify any? :)

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.