0
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_DATES_TABLE = "CREATE TABLE" + TABLE_NAME + "(" + COLUMN_DATES + "TEXT"+ ")";
    db.execSQL(CREATE_DATES_TABLE);
}

what wrong with syntax ?

1
  • 2
    You should post the error syntax as well Commented May 17, 2017 at 15:55

2 Answers 2

2

You are missing space between your keywords and values

String CREATE_DATES_TABLE = "CREATE TABLE" + TABLE_NAME + "(" + COLUMN_DATES + "TEXT"+ ")";

should be

String CREATE_DATES_TABLE = "CREATE TABLE " + TABLE_NAME + " (" + COLUMN_DATES + " TEXT)";
Sign up to request clarification or add additional context in comments.

Comments

1

YOu are missing a space between the column name and column type, which in your case is TEXT. It should be:

String CREATE_DATES_TABLE = "CREATE TABLE " + TABLE_NAME + " (" + COLUMN_DATES + " TEXT)";

And you may want to use "CREATE TABLE IF NOT EXISTS " + TABLE_NAME + "(..... to ensure you don't create the table if it exists(if that is a function you want).

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.