我創造了這樣插入時得到sqlite異常?如何?
db.execSQL("CREATE TABLE "+TABLE_NAME+" ("
+_ID+" INTEGER PRIMARY KEY AUTOINCREMENT,"
+ TITLE+" TEXT UNIQUE,"
+ PUBLISHED+" DATETIME,"
+ CONTENT+" TEXT,"
+ RATERS+" TEXT,"
+ VIEWCOUNT+" TEXT,"
+ THUMBNAIL+" TEXT,"
+ FAVCOUNT+" TEXT,"
+ FAVSTAT+" INTEGER,"
+ LINKWEB+" TEXT);");
我有,當我嘗試在表中插入值異常的數據庫?
02-24 15:57:37.802: ERROR/DatabaseUtils(283): Writing exception to parcel
02-24 15:57:37.802: ERROR/DatabaseUtils(283): android.database.sqlite.SQLiteException: table bru_tube has no column named linkweb: , while compiling: INSERT INTO bru_tube(content, favstat, title, thumbnail, linkweb, raters, viewcount, published, favcount) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?);
02-24 15:57:37.802: ERROR/DatabaseUtils(283): at android.database.sqlite.SQLiteProgram.native_compile(Native Method)
02-24 15:57:37.802: ERROR/DatabaseUtils(283): at android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110)
02-24 15:57:37.802: ERROR/DatabaseUtils(283): at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:59)
02-24 15:57:37.802: ERROR/DatabaseUtils(283): at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:41)
02-24 15:57:37.802: ERROR/DatabaseUtils(283): at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1026)
02-24 15:57:37.802: ERROR/DatabaseUtils(283): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1412)
02-24 15:57:37.802: ERROR/DatabaseUtils(283): at android.database.sqlite.SQLiteDatabase.insertOrThrow(SQLiteDatabase.java:1307)
02-24 15:57:37.802: ERROR/DatabaseUtils(283): at com.brownuniv.brutube.BruTube_Provider.insert(BruTube_Provider.java:82)
02-24 15:57:37.802: ERROR/DatabaseUtils(283): at android.content.ContentProvider$Transport.insert(ContentProvider.java:150)
02-24 15:57:37.802: ERROR/DatabaseUtils(283): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:140)
02-24 15:57:37.802: ERROR/DatabaseUtils(283): at android.os.Binder.execTransact(Binder.java:287)
02-24 15:57:37.802: ERROR/DatabaseUtils(283): at dalvik.system.NativeStart.run(Native Method)
如何解決?任何想法?
退房我已經編輯了我的疑問句.. – Praveen 2010-02-24 10:30:27
好了,同樣的答覆,其他列名... – 2010-02-24 10:37:43
作爲托爾斯滕表示,要確保你有正確的表模式在你的數據庫中。從上面的鏈接中,查看「從遠程Shell檢查sqlite3數據庫」部分 – ccheneson 2010-02-24 11:53:32