friends,
i have written following sqlite insert statement which seems to be wrong.
before inserting row i am checking if record exists then dont insert(ATM data is more than 600 records)
Reached max size for compiled sql statement cache for database.no space for this sql statement in cache.select 1 from atm where atmid=251 please change your sql statment to use “?” for bindargs, instead of
public void addAtm(ATM atm)
{
db.execSQL("INSERT INTO " + AtmsTable.NAME +
"(" +AtmsTable.COL_ID + ","
+AtmsTable.COL_BankID +","
+ AtmsTable.COL_BankNAME+","
+ AtmsTable.COL_BankPhone+","
+ AtmsTable.COL_BankAddress+","
+ AtmsTable.COL_BankCoordinates+","
+ AtmsTable.COL_BankCity+","
+ AtmsTable.COL_BankWebaddress+") Values ("
+atm.getAtmID()+","
+atm.getBankID()
+ ",'" + atm.getBankName().trim()
+"','" + atm.getPhone()
+"','" + atm.getAddress()
+"','" + atm.getCoordinates()
+"','" + atm.getCity()
+"','" + atm.getWebAddress()+ "');");
}
and
public boolean atmExists(int atmId)
{
OpenIfNotOpened();
Cursor cursor = db.rawQuery("select 1 from " + AtmsTable.NAME +" where " + AtmsTable.COL_ID + "=" + atmId,null);
boolean exists = (cursor.getCount() > 0);
cursor.close();
return exists;
}
and i am getting following error message
any help would be appreciated.
just use: