Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Getting error while creating sqlite table. Help needed please!!

Devansh JaniDevansh Jani Posts: 1
edited February 3 in Android
{
    SQLiteDatabase sqLiteDatabase = getWritableDatabase();

    String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_DETAILS + "("
            + COLUMN_ID + " INTEGER PRIMARY AUTOINCREMENT, " + COLUMN_NAME + " TEXT, "
            + COLUMN_EMAIL + " TEXT, " + COLUMN_C_NAME + " TEXT, " + COLUMN_V_MODEL + " TEXT, "
            + COLUMN_SERVICE_DETAILS + " TEXT"+ ");";
    sqLiteDatabase.execSQL(CREATE_CONTACTS_TABLE);
}

I am getting an error while executing this block of code

android.database.sqlite.SQLiteException: near "name": syntax error (code 1): , while compiling: CREATE TABLE details(id INTEGER PRIMARY KEY AUTOINCREMENT name TEXT email TEXT c_name TEXT v_model TEXT service_details TEXT );

Tagged:
Sign In or Register to comment.