描述
此函数在与数据库连接PDB相关联的数PreparedStatement pstmt之后返回指向下一个准备语句的指针。如果数PreparedStatement pstmt为NULL,则该接口返回指向与数据库连接PDB相关联的第一个准备语句的指针。如果没有准备好的语句满足此函数的条件,则返回NULL。
调用sqlite3_next_stmt(D,S)中的数据库连接指针D必须引用开放的数据库连接,特别是不能为空指针。
C / C ++语法
sqlite3_stmt *sqlite3_next_stmt( sqlite3 *pDb, sqlite3_stmt *pStmt ); |
PB语法
FUNCTION sqlite3_next_stmt ( _ BYVAL hDbc AS DWORD, _ BYVAL hStmt AS DWORD _ ) AS DWORD |
参数
pDb
[in]数据库连接句柄。必须是从sqlite3_opensqlite3_open16或sqlite3_open_v2获取的NULL指针或sqlite3对象指针。
pStmt
[in]语句句柄。
返回值
指向下一条语句的指针。
C ++实现代码
/*
** Return a pointer to the next prepared statement after pStmt associated
** with database connection pDb. If pStmt is NULL, return the first
** prepared statement for the database connection. Return NULL if there
** are no more.
*/
SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){
sqlite3_stmt *pNext;
sqlite3_mutex_enter(pDb->mutex);
if( pStmt==0 ){
pNext = (sqlite3_stmt*)pDb->pVdbe;
}else{
pNext = (sqlite3_stmt*)((Vdbe*)pStmt)->pNext;
}
sqlite3_mutex_leave(pDb->mutex);
return pNext;
}