我收到此错误。请给我一些教程。这样我才能改进。
请不要拒绝投票我的学生已经要求
01-17 16:07:05.234: E/AndroidRuntime(26559): android.database.sqlite.SQLiteException: near "table": syntax error (code 1): , while compiling: CREATE TABLE table(_id INTEGER PRIMARY KEY Autoincrement,date INTEGER,quantity TEXT,materialTEXT ;)
01-17 16:07:05.234: E/AndroidRuntime(26559): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
01-17 16:07:05.234: E/AndroidRuntime(26559): at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1113)
01-17 16:07:05.234: E/AndroidRuntime(26559): at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:686)
答案 0 :(得分:2)
在日志创建表查询中,material
列名称和TEXT
数据类型之间需要空格:
CREATE TABLE table(_id INTEGER PRIMARY KEY Autoincrement,
date INTEGER,quantity TEXT,material TEXT) ;