大批量数据的导入建议使用事务进行处理,其效率要比单条插入高很多。
ret = sqlite3_exec ( db,"begin transaction",& zErrorMsg ); for (...) { //insert into operate // 如果操作错误 ret = sqlite3_exec ( db,"rollback transaction",& zErrorMsg ) } ret = sqlite3_exec ( db,"commit transaction",& zErrorMsg );