Well, this should be ultra-simple, but I simply can't seem to spot it among the 1001 sqlite-related commands.
嗯,这应该是非常简单的,但我似乎无法在1001 sqlite相关命令中发现它。
So :
- I'm performing a
SELECT
statement, withsqlite3_prepare
- I'm getting the results per row with
sqlite3_step
- I'm accessing the Xth's column's result by
sqlite3_column_text(sqlStmt,X)
我正在使用sqlite3_prepare执行SELECT语句
我用sqlite3_step得到每行的结果
我正在通过sqlite3_column_text(sqlStmt,X)访问Xth列的结果
The question is :
问题是 :
How can I get the number of columns in the row? (= the range in which X can... move...)
如何获取行中的列数? (= X可以...移动的范围......)
P.S. The question is tagged with d
(I'm basically developing in D), but it won't make much difference since it's using native C bindings...
附:问题用d标记(我基本上用D开发),但它没有太大区别,因为它使用的是本机C绑定...
1 个解决方案
#1
3
According to http://www.sqlite.org/c3ref/data_count.html,
根据http://www.sqlite.org/c3ref/data_count.html,
int sqlite3_data_count(sqlite3_stmt *pStmt);
returns the number of columns in the current row of the result set of prepared statement pStmt
.
返回预准备语句pStmt的结果集的当前行中的列数。
#1
3
According to http://www.sqlite.org/c3ref/data_count.html,
根据http://www.sqlite.org/c3ref/data_count.html,
int sqlite3_data_count(sqlite3_stmt *pStmt);
returns the number of columns in the current row of the result set of prepared statement pStmt
.
返回预准备语句pStmt的结果集的当前行中的列数。