KSQL_STMT_DOUBLE(3)

NAME
ksql_stmt_blob, ksql_stmt_bytes, ksql_stmt_double, ksql_stmt_int, ksql_stmt_isnull, ksql_stmt_str - get the result columns of a statement

LIBRARY
ksql

SYNOPSIS
#include <ksql.h>
const void *
ksql_stmt_blob(struct ksql_stmt *stmt, size_t col);
size_t
ksql_stmt_bytes(struct ksql_stmt *stmt, size_t col);
double
ksql_stmt_double(struct ksql_stmt *stmt, size_t col);
int64_t
ksql_stmt_int(struct ksql_stmt *stmt, size_t col);
int
ksql_stmt_isnull(struct ksql_stmt *stmt, size_t col);
char *
ksql_stmt_str(struct ksql_stmt *stmt, size_t col);

DESCRIPTION
The ksql_stmt_blob, ksql_stmt_bytes, ksql_stmt_double, ksql_stmt_int, and ksql_stmt_str functions return data from a row returned after ksql_stmt_step(3). They all accept the relevant column to query, which starts at zero. The results are not defined for a statement without a waiting row or for columns beyond the prepared statement.

The ksql_stmt_blob and ksql_stmt_bytes functions are usually used to return binary data. The ksql_stmt_str returns a string whose memory is “owned” by the database, so it should be copied before modification.

The ksql_stmt_isnull function checks if the result column is empty, i.e., SQLITE_NULL.

SEE ALSO
sqlite3_column_blob(3)