GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
KSQL_RESULT_DOUBLE(3) FreeBSD Library Functions Manual KSQL_RESULT_DOUBLE(3)

ksql_result_blob, ksql_result_blob_alloc, ksql_result_bytes, ksql_result_double, ksql_result_int, ksql_result_isnull, ksql_result_str, ksql_result_str_alloc
get the result columns of a statement

library “ksql”

#include <sys/types.h>
#include <stdint.h>
#include <ksql.h>

enum ksqlc
ksql_result_blob(struct ksqlstmt *stmt, const void **p, size_t *sz, size_t column);

enum ksqlc
ksql_result_blob_alloc(struct ksqlstmt *stmt, void **p, size_t *sz, size_t column);

enum ksqlc
ksql_result_bytes(struct ksqlstmt *stmt, int *p, size_t column);

enum ksqlc
ksql_result_double(struct ksqlstmt *stmt, double *p, size_t column);

enum ksqlc
ksql_result_int(struct ksqlstmt *stmt, int64_t *p, size_t column);

enum ksqlc
ksql_result_isnull(struct ksqlstmt *stmt, int *p, size_t column);

enum ksqlc
ksql_result_str(struct ksqlstmt *stmt, const char **p, size_t column);

enum ksqlc
ksql_result_str_alloc(struct ksqlstmt *stmt, char **p, size_t column);

These functions return results following ksql_stmt_step(3). They all accept stmt, the statement allocated with ksql_stmt_alloc(3); the column to query, which starts at zero; and p, which is set to the resulting data. The ksql_result_blob() function additionaly accepts sz, which is set to the length of p.

The ksql_result_str() and ksql_result_blob() functions return memory that must be copied prior to a subsequent ksql_stmt_step(3), ksql_stmt_reset(3), or ksql_stmt_free(3). The ksql_result_blob() may fill in a NULL pointer in the event of an empty buffer; ksql_result_str() will always return a NUL-terminated string on success. For the caller to manage memory, use the ksql_result_blob_alloc() and ksql_result_str_alloc() variants to pass back memory that must be released with free(3).

There are a number of error conditions returned by these functions.
Memory allocation failure.
There is no result row available. This happens when the prior ksql_stmt_step(3) did not return KSQL_ROW.
The column has no data. This is not returned by ksql_result_isnull().
The column exceeds the maximum number of available result columns.
An internal system error occurred.

If any of these errors occur, the passed-in result pointers p and sz are undefined.

On success, KSQL_OK is returned and the result pointers are filled in.

sqlite3_column_blob(3)
May 9, 2018 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.