*突然、クエリにそのようなテーブルが表示されなくなりましたが、昨日までは正常に機能していました。このコードに詰まっています。助けてください *
クリック時
public void onClick(View arg0) {
String stckCenterid=String.valueOf(headerDb.getStockCenterId(dat1));
String stockItemId=String.valueOf(headerDb.getStockItemId(stckCenterid));
System.out.println("StockCenterid, Stockitemid " + stckCenterid +" "+ stockItemId);
headerDb.getStockLedger(stckCenterid,stockItemId,from_date_format,to_date_format);
}
});
このストックセンターIDは希望どおりに来ていますが、同じものをgetstockitemidに渡していますが、クエリはそのようなテーブルを表示していません。つまり、以下のクエリです。これらのセンターIDとアイテムIDを別のクエリに渡して結果を取得しています
クエリ
public int getStockItemId(String stCenterId) {
db = this.getReadableDatabase();
Cursor c = db.rawQuery("SELECT STOCK_ITEM_ID from qt_um_stock_items_qty WHERE " +
" STOCK_CENTRE_ID " + " = ? " , new String[] { stCenterId });
c.moveToFirst();
int index = c.getColumnIndex("STOCK_ITEM_ID");
return c.getInt(index);
}
ログキャット
> 10-22 09:06:46.449: W/dalvikvm(1050): threadid=1: thread exiting with
> uncaught exception (group=0x40a71930) 10-22 09:06:46.509:
> E/AndroidRuntime(1050): FATAL EXCEPTION: main 10-22 09:06:46.509:
> E/AndroidRuntime(1050): android.database.sqlite.SQLiteException: no
> such table: qt_um_stock_items_qty (code 1): , while compiling: Select
> STOCK_ITEM_ID from qt_um_stock_items_qty WHERE STOCK_CENTER_ID=? 10-22
> 09:06:46.509: E/AndroidRuntime(1050): at
> android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native
> Method) 10-22 09:06:46.509: E/AndroidRuntime(1050): at
> android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:882)
> 10-22 09:06:46.509: E/AndroidRuntime(1050): at
> android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:493)
> 10-22 09:06:46.509: E/AndroidRuntime(1050): at
> android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
> 10-22 09:06:46.509: E/AndroidRuntime(1050): at
> android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
> 10-22 09:06:46.509: E/AndroidRuntime(1050): at
> android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37) 10-22
> 09:06:46.509: E/AndroidRuntime(1050): at
> android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
> 10-22 09:06:46.509: E/AndroidRuntime(1050): at
> android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1314)
> 10-22 09:06:46.509: E/AndroidRuntime(1050): at
> android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1253)
> 10-22 09:06:46.509: E/AndroidRuntime(1050): at
> com.manacle.umma.activity.HeaderDb.getItemId(HeaderDb.java:3864) 10-22
> 09:06:46.509: E/AndroidRuntime(1050): at
> com.manacle.umma.activity.StockBalrep$4.onClick(StockBalrep.java:187)
> 10-22 09:06:46.509: E/AndroidRuntime(1050): at
> android.view.View.performClick(View.java:4204) 10-22 09:06:46.509:
> E/AndroidRuntime(1050): at
> android.view.View$PerformClick.run(View.java:17355) 10-22
> 09:06:46.509: E/AndroidRuntime(1050): at
> android.os.Handler.handleCallback(Handler.java:725) 10-22
> 09:06:46.509: E/AndroidRuntime(1050): at
> android.os.Handler.dispatchMessage(Handler.java:92) 10-22
> 09:06:46.509: E/AndroidRuntime(1050): at
> android.os.Looper.loop(Looper.java:137) 10-22 09:06:46.509:
> E/AndroidRuntime(1050): at
> android.app.ActivityThread.main(ActivityThread.java:5041) 10-22
> 09:06:46.509: E/AndroidRuntime(1050): at
> java.lang.reflect.Method.invokeNative(Native Method) 10-22
> 09:06:46.509: E/AndroidRuntime(1050): at
> java.lang.reflect.Method.invoke(Method.java:511) 10-22 09:06:46.509:
> E/AndroidRuntime(1050): at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
> 10-22 09:06:46.509: E/AndroidRuntime(1050): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 10-22
> 09:06:46.509: E/AndroidRuntime(1050): at
> dalvik.system.NativeStart.main(Native Method) 10-22 09:06:49.110:
> I/Process(1050): Sending signal. PID: 1050 SIG: 9 10-22 09:06:50.629:
> E/Trace(1330): error opening trace file: No such file or directory (2)
> 10-22 09:06:51.482: D/dalvikvm(1330): GC_FOR_ALLOC freed 130K, 10%
> free 2504K/2780K, paused 64ms, total 72ms 10-22 09:06:51.969:
> I/Choreographer(1330): Skipped 63 frames! The application may be
> doing too much work on its main thread. 10-22 09:06:52.050:
> D/gralloc_goldfish(1330): Emulator without GPU emulation detected.
> 10-22 09:06:52.699: I/Choreographer(1330): Skipped 85 frames! The
> application may be doing too much work on its main thread.