Rád bych věděl proč mi android nechce vložit řádky do dočasné tabulky, pokaždé, když spustím následující kód, žádná chyba se neobjeví a výsledek je prázdný?
SQLiteDatabase database = this.getWritableDatabase();
String queryTempTable =
" CREATE TEMP TABLE DPHs (bill INTEGER, DPH INTEGER); "
+ "INSERT INTO DPHs (bill, DPH) VALUES('400', '20'); " // test
+ "INSERT INTO DPHs (bill, DPH) VALUES('400', '20'); " // test
+ " INSERT INTO DPHs (bill, DPH) SELECT SUM("+ITEM_COUNT+ "*" +ITEM_PRICE+") as bill, " + ITEM_DPH + " as DPH"
+ " FROM " + ORDER_TABLE
//+ " WHERE " + ITEM_DATE_PAID + " BETWEEN '" + from + "' AND '" + to + "'"
+ " GROUP BY " + ITEM_DPH + ";"
+ " INSERT INTO DPHs (bill, DPH) SELECT SUM(" + GUEST_TYPE_BILL_ACCO +") as bill, " + GUEST_TYPE_BILL_ACCO_DPH + " as DPH"
+ " FROM " + GUEST_PAYMENT_TABLE
//+ " WHERE " + GUEST_TYPE_DATE_PAID + " BETWEEN '" + from + "' AND '" + to + "'"
+ " GROUP BY " + GUEST_TYPE_BILL_ACCO_DPH + ";"
+ " INSERT INTO DPHs (bill, DPH) SELECT SUM(" + GUEST_TYPE_BILL_FEE +") as bill, " + GUEST_TYPE_BILL_FEE_DPH + " as DPH"
+ " FROM " + GUEST_PAYMENT_TABLE
//+ " WHERE " + GUEST_TYPE_DATE_PAID + " BETWEEN '" + from + "' AND '" + to + "'"
+ " GROUP BY " + GUEST_TYPE_BILL_ACCO_DPH + ";";
database.execSQL(queryTempTable);
Cursor cursor = database.rawQuery("SELECT * FROM DPHs GROUP BY DPH;", null);