在sqlite3中,我们可以将sql execute(...回调函数...)转换为sqlite_prepare,step,finalize

时间:2022-06-21 23:06:30

And in the step function, call the callback function(as its too big to replicate) for eg:

在step函数中,调用回调函数(因为它太大而不能复制),例如:


sqlite3_exec(db,command,callback,0,error);
>>>>>>>>>>
sqlite3_prepare_v2(db,command,-1,&stmt,NULL); 
rc = sqlite3_step(stmt); 
if(rc == SQLITE_ROW) 
    { INSERT CALLBACK FUNCTION HERE } 
else 
    do error checking or sqlite3 done etc 
sqlite3_finalize(stmt); 
...
//there is somewhere an 
//**static int callback (void *NotUsed, int argc, char **argv, char **azColName)** 

And if so, how?

如果是这样,怎么样?

1 个解决方案

#1


0  

Yes, this is possible. It's exactly what the original implementation of sqlite3_exec() does.

是的,这是可能的。这正是sqlite3_exec()的原始实现。

#1


0  

Yes, this is possible. It's exactly what the original implementation of sqlite3_exec() does.

是的,这是可能的。这正是sqlite3_exec()的原始实现。