达到数据库的已编译sql语句高速缓存的最大大小

时间:2011-06-14 08:23:02

标签: android sqlite max-size

我有以下错误:

reached max size for compiled sql statement cache for database  no space for this 
sql statement in cache select number  code status time id from contacts number 
please change your sql statements to use "?" for bindargs of using actual values

这是我的代码:

    public long updateNumber(String NUMBER,String CODE,String STATUS,String TIME){
    ContentValues initialValuesCode = new ContentValues();
    initialValuesCode.put(codeOperator, CODE);
    initialValuesCode.put(status, STATUS);
    initialValuesCode.put(time,TIME);
    String prom="0"+NUMBER.substring(0,8);

    return db.update(Database_Table_Number, initialValuesCode, "NUMBER=?", new       String[{prom});

}


public Cursor getNumberById(String id_par)
{

   return db.query(Database_Table_Number, new String[]{number,codeOperator,status,time,id}, "_ID=?", new String[]{id_par}, null, null, null);
       }
      public Cursor getAllNumbers()
      {
   return db.query(Database_Table_Number, new String[]{number}, null, null, number, null, null);
      }
      public Cursor getAllContacts() 
  {
    return db.query(Database_Table_Name, new String[] {id,name}, null, null, null, null, "DISPLAY_NAME asc" );

}
  public Cursor getDate(String byid){
    return db.query(Database_Table_Number, new String[] {time}, "_ID=="+byid, null, null, null, null);
}
   public Cursor isEpmty(){
    return db.rawQuery("SELECT COUNT(*) FROM ContactsName", null);
}

1 个答案:

答案 0 :(得分:3)

这发生在哪里。我在你的sqlite查询中看到了很多错误...

这可能会给你带来什么?问题:

 "_ID=="+byid 

应该是:

 ...,"_ID=?",new String[]{byid},...