我创建了表格,这是我的问题..任何人都可以帮助我吗?
这按摩出现
')',<column constraint>,<type name>or comma expected,got '1'
https://i.imgur.com/n98F5Gm.png“我的Android Studio代码”
https://i.imgur.com/ct7QkHG.png“我的问题按摩”
final String SQL_CREATE_QUESTIONS_TABLE = "CREATE TABLE " +
QuestionTable.TABLE_NAME + "(" +
QuestionTable._ID + "INTEGER PRIMARY KEY AUTOINCREMENT, " +
QuestionTable.COLUMN_QUESTION + "TEXT" +
QuestionTable.COLUMN_OPTION1 + " TEXT " +
QuestionTable.COLUMN_OPTION2 + " TEXT " +
QuestionTable.COLUMN_OPTION3 + " TEXT " +
QuestionTable.COLUMN_OPTION4 + " TEXT " +
QuestionTable.COLUMN_ANSWER_NR + "INTEGER" +
")";
答案 0 :(得分:1)
您缺少一些空格和一些逗号
final String SQL_CREATE_QUESTIONS_TABLE = "CREATE TABLE " +
QuestionTable.TABLE_NAME + " (" +
QuestionTable._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
QuestionTable.COLUMN_QUESTION + " TEXT, " +
QuestionTable.COLUMN_OPTION1 + " TEXT ," +
QuestionTable.COLUMN_OPTION2 + " TEXT ," +
QuestionTable.COLUMN_OPTION3 + " TEXT ," +
QuestionTable.COLUMN_OPTION4 + " TEXT ," +
QuestionTable.COLUMN_ANSWER_NR + " INTEGER" +
");";