xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_data_count.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
2.Dt SQLITE3_DATA_COUNT 3
3.Os
4.Sh NAME
5.Nm sqlite3_data_count
6.Nd number of columns in a result set
7.Sh SYNOPSIS
8.In sqlite3.h
9.Ft int
10.Fo sqlite3_data_count
11.Fa "sqlite3_stmt *pStmt"
12.Fc
13.Sh DESCRIPTION
14The sqlite3_data_count(P) interface returns the number of columns in
15the current row of the result set of prepared statement
16P.
17If prepared statement P does not have results ready to return (via
18calls to the sqlite3_column() family of interfaces)
19then sqlite3_data_count(P) returns 0.
20The sqlite3_data_count(P) routine also returns 0 if P is a NULL pointer.
21The sqlite3_data_count(P) routine returns 0 if the previous call to
22sqlite3_step(P) returned SQLITE_DONE.
23The sqlite3_data_count(P) will return non-zero if previous call to
24sqlite3_step(P) returned SQLITE_ROW, except in
25the case of the PRAGMA incremental_vacuum
26where it always returns zero since each step of that multi-step pragma
27returns 0 columns of data.
28.Pp
29.Sh IMPLEMENTATION NOTES
30These declarations were extracted from the
31interface documentation at line 4988.
32.Bd -literal
33SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt);
34.Ed
35.Sh SEE ALSO
36.Xr sqlite3_column_blob 3 ,
37.Xr sqlite3_column_count 3 ,
38.Xr sqlite3_step 3 ,
39.Xr sqlite3_stmt 3 ,
40.Xr SQLITE_OK 3
41