描述
此函数可用于在准备语句中查找SQL参数的数量。SQL参数是用于作为稍后绑定到参数的值的占位符的形式“?”,“?NNN”,“:AAA”,“$ AAA”或“@AAA”的标记。
C / C ++语法
int sqlite3_bind_parameter_count(sqlite3_stmt*); |
PB语法
FUNCTION sqlite3_bind_parameter_count ( _ BYVAL hStmt AS DWORD _ ) AS LONG |
参数
pStmt
[in]语句句柄。
返回值
准备语句中的SQL参数数。
备注
该函数实际返回最大(最右)参数的索引。对于除NNN之外的所有形式,这将对应于唯一参数的数量。如果使用了?NNN形式的参数,列表中可能会有间隙。
C ++实现代码
/*
** Return the number of wildcards that can be potentially bound to.
** This function is added to support DBD::SQLite.
*/
SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
Vdbe *p = (Vdbe*)pStmt;
return p ? p->nVar : 0;
}