문제

Well, this should be ultra-simple, but I simply can't seem to spot it among the 1001 sqlite-related commands.

So :

  • I'm performing a SELECT statement, with sqlite3_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)

The question is :

How can I get the number of columns in the row? (= the range in which X can... move...)


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...

도움이 되었습니까?

해결책

According to 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top