XROAD
db_result.h File Reference
#include <common/xroad_common_types.h>
#include <common/xroad_string.h>
#include <common/xroad_variant.h>
#include <stdint.h>
#include <stdbool.h>
#include "db_engine.h"
Include dependency graph for db_result.h:

Go to the source code of this file.

Functions

int64_t db_result_get_nfields (db_engine_t *e, const void *obj)
 
xroad_errno_t db_result_get_fname (db_engine_t *e, const void *obj, int32_t col_num, xroad_str_t *fname)
 
int64_t db_result_get_size (db_engine_t *e, const void *obj)
 
xroad_errno_t db_result_get_int64 (db_engine_t *e, const void *obj, int32_t row_num, int32_t col_num, int64_t *val, bool *is_null)
 
xroad_errno_t db_result_get_bool (db_engine_t *e, const void *obj, int32_t row_num, int32_t col_num, bool *val, bool *is_null)
 
xroad_errno_t db_result_get_double (db_engine_t *e, const void *obj, int32_t row_num, int32_t col_num, double *val, bool *is_null)
 
xroad_errno_t db_result_get_char (db_engine_t *e, const void *obj, int32_t row_num, int32_t col_num, char *val, bool *is_null)
 
xroad_errno_t db_result_get_string (db_engine_t *e, const void *obj, int32_t row_num, int32_t col_num, xroad_str_t *val, bool *is_null)
 
xroad_errno_t db_result_get_value (db_engine_t *e, const void *obj, int32_t row_num, int32_t col_num, xroad_variant_t *val)
 

Detailed Description

Function Documentation

◆ db_result_get_bool()

xroad_errno_t db_result_get_bool ( db_engine_t *  e,
const void *  obj,
int32_t  row_num,
int32_t  col_num,
bool *  val,
bool *  is_null 
)

extracts boolean value from specific cell in result set

Parameters
[in]obj- pointer to the result set
[in]row_num- row of result set
[in]col_num- column of value of the result set
[out]val- pointer to variable where value should be stored
[out]is_null- pointer to flag which detects that value is NULL, if pointer == NULL it will be ignored
Returns
XROAD_OK if value was successfully stored, XROAD_FAILED otherwise

◆ db_result_get_char()

xroad_errno_t db_result_get_char ( db_engine_t *  e,
const void *  obj,
int32_t  row_num,
int32_t  col_num,
char *  val,
bool *  is_null 
)

extracts char value from specific cell in result set

Parameters
[in]obj- pointer to the result set
[in]row_num- row of result set
[in]col_num- column of value of the result set
[out]val- pointer to variable where value should be stored
[out]is_null- pointer to flag which detects that value is NULL, if pointer == NULL it will be ignored
Returns
XROAD_OK if value was successfully stored, XROAD_FAILED otherwise

◆ db_result_get_double()

xroad_errno_t db_result_get_double ( db_engine_t *  e,
const void *  obj,
int32_t  row_num,
int32_t  col_num,
double *  val,
bool *  is_null 
)

extracts double value from specific cell in result set

Parameters
[in]obj- pointer to the result set
[in]row_num- row of result set
[in]col_num- column of value of the result set
[out]val- pointer to variable where value should be stored
[out]is_null- pointer to flag which detects that value is NULL, if pointer == NULL it will be ignored
Returns
XROAD_OK if value was successfully stored, XROAD_FAILED otherwise

◆ db_result_get_fname()

xroad_errno_t db_result_get_fname ( db_engine_t *  e,
const void *  obj,
int32_t  col_num,
xroad_str_t fname 
)

extracts field name from specified column in result set

Parameters
[in]obj- pointer to the result set
[in]col_num- column of value of the result set
[out]fname- pointer to field name Str(xroad_str_t)
Returns
XROAD_OK if value was successfully stored, XROAD_FAILED otherwise

◆ db_result_get_int64()

xroad_errno_t db_result_get_int64 ( db_engine_t *  e,
const void *  obj,
int32_t  row_num,
int32_t  col_num,
int64_t *  val,
bool *  is_null 
)

extracts int64_t value from specific cell in result set

Parameters
[in]obj- pointer to the result set
[in]row_num- row of result set
[in]col_num- column of value of the result set
[out]val- pointer to variable where value should be stored
[out]is_null- pointer to flag which detects that value is NULL, if pointer == NULL it will be ignored
Returns
XROAD_OK if value was successfully stored, XROAD_FAILED otherwise

◆ db_result_get_nfields()

int64_t db_result_get_nfields ( db_engine_t *  e,
const void *  obj 
)

gets number of columns in result set

Parameters
[in]obj- pointer to the result set
Returns
number of rows in result set

◆ db_result_get_size()

int64_t db_result_get_size ( db_engine_t *  e,
const void *  obj 
)

gets number of rows in result set

Parameters
[in]obj- pointer to the result set
Returns
number of rows in result set

◆ db_result_get_string()

xroad_errno_t db_result_get_string ( db_engine_t *  e,
const void *  obj,
int32_t  row_num,
int32_t  col_num,
xroad_str_t val,
bool *  is_null 
)

extracts string value from specific cell in result set

Parameters
[in]obj- pointer to the result set
[in]row_num- row of result set
[in]col_num- column of value of the result set
[out]val- pointer to variable where value should be stored
[out]is_null- pointer to flag which detects that value is NULL, if pointer == NULL it will be ignored
Returns
XROAD_OK if value was successfully stored, XROAD_FAILED otherwise

◆ db_result_get_value()

xroad_errno_t db_result_get_value ( db_engine_t *  e,
const void *  obj,
int32_t  row_num,
int32_t  col_num,
xroad_variant_t val 
)

return variant type value

Parameters
[in]obj- pointer to the result set
[in]row_num- row of result set
[in]col_num- column of value of the result set
[out]val- pointer to variable where value should be stored
Returns
XROAD_OK if value was successfully stored, XROAD_FAILED otherwise