對不起noop的問題,但我只是不能縫以得到它的工作。我創建了這個命令我的數據庫表:應用程序fc查詢sqlite數據庫
newLeaseTable = "create table '" + leaseName + "' (_id integer primary key autoincrement,"
+ " Date TEXT, StockTank1Ft NUMERIC, StockTank1Inch NUMERIC,"
+ " StockTank2Ft NUMERIC, StockTank2Inch NUMERIC, StockTank3Ft NUMERIC,"
+ " StockTank3Inch NUMERIC, StockTank4Ft NUMERIC, StockTank4Inch NUMERIC,"
+ " Change1 NUMBER, Change2 NUMBER, Change3 NUMBER, Change4 NUMBER, User TEXT);";
myDataBase.execSQL(newLeaseTable);
當我查詢與無論是rawquery或查詢語句的應用程序崩潰和日誌點到我的查詢語句的數據庫。我想在表「LeaseNames」中查找與變量字符串「enterLogLN」(來自editText)匹配的列「colLeaseNames」中的字符串,然後從同一行的「colWaterWells」列中返回整數。任何人都可以在這方面幫助,
感謝
在這種情況下,變量「enterLogLN」是「關於」 他
re is my rawquery and logcat:
String col[] = {"colLeaseNames", "colWaterWells"};
String test = "Select * from LeaseNames Where " + col + " ='" + enterLogLN + "'";
return Cursor cRWLeaseInfo = myDataBase.rawQuery(test, null);
logcat:
Caused by: android.database.sqlite.SQLiteException: unrecognized token: "[Ljava.lang.String;@405397e0 ='about'": , while compiling: Select * from LeaseNames Where [Ljava.lang.String;@405397e0 ='about'
什麼是logcat的說? – Nikhil 2012-07-07 04:46:34
引起:android.database.sqlite.SQLiteException:無法識別的標記:「[Ljava.lang.String; @ 405397e0 ='about'」:,while compiling:Select * from LeaseNames Where [Ljava.lang.String; @ 405397e0 = 'about' – deerkiller11 2012-07-07 04:53:41
如何使用崩潰的完整堆棧跟蹤來編輯您的問題。此外,您的問題顯示INSERT查詢,但是導致崩潰的SELECT查詢呢? – azgolfer 2012-07-07 04:55:41