逻辑回归:从数学原理到Python实战应用
2026/8/4 4:10:36
infoDAO.deleteByInfoIds(ids);Caused by: android.database.sqlite.SQLiteException: too many SQL variables (code 1 SQLITE_ERROR): , while compiling: DELETE FROM Info WHERE infoId IN (?,?,?,?,?...SQLite 数据库参数数量超限导致的崩溃问题
SQLite 数据库在编译 SQL 语句时,对绑定参数(?占位符)的数量有硬性上限,默认是 999 个SQLITE_MAX_VARIABLE_NUMBER
https://sqlite.org/limits.htmlintbatchSize=500;inttotalSize=ids.size();for(inti=0;i<totalSize;i+=batchSize){intend=Math.min(i+batchSize,totalSize);List<Integer>batchIds=ids.subList(i,end);infoDAO.deleteByInfoIds(batchIds);}