Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top