Data Structures | Enumerations | Functions
sql_result.h File Reference

Result set. More...

Data Structures

struct  vtm_sql_result
 

Enumerations

enum  vtm_sql_result_state { VTM_SQL_RES_STATE_UNINIT, VTM_SQL_RES_STATE_READY, VTM_SQL_RES_STATE_STEPPING, VTM_SQL_RES_STATE_FINISHED }
 

Functions

VTM_API void vtm_sql_result_release (struct vtm_sql_result *res)
 
VTM_API int vtm_sql_result_fetch_row (struct vtm_sql_result *res, vtm_dataset *row)
 
VTM_API int vtm_sql_result_fetch_all (struct vtm_sql_result *res)
 

Function Documentation

VTM_API void vtm_sql_result_release ( struct vtm_sql_result res)

Releases the result set.

Parameters
resthe result set that should be released
VTM_API int vtm_sql_result_fetch_row ( struct vtm_sql_result res,
vtm_dataset row 
)

Fetches the next row from the result set.

Parameters
resthe target result set
[out]rowthe fetched row
Returns
VTM_OK if row was sucessfully retrieved
VTM_E_IO_EOF if all rows were retrieved
VTM_E_INVALID_STATE if the result set is in the wrong state, for example if all rows have alread been fetched
VTM_E_NOT_SUPPORTED if the operation is not supported in the underlaying sql implementation
VTM_ERROR if an unknown error occured
VTM_API int vtm_sql_result_fetch_all ( struct vtm_sql_result res)

Fetches and buffers the complete result set.

Parameters
resthe target result set
Returns
VTM_OK if operation succeed
VTM_E_INVALID_STATE if the result set is in the wrong state, for example if single row fetching has already been used.
VTM_E_NOT_SUPPORTED if the operation is not supported in the underlaying sql implementation
VTM_ERROR if an error occured