Mstdlib-1.24.0
|
Functions | |
size_t | M_sql_stmt_result_affected_rows (M_sql_stmt_t *stmt) |
size_t | M_sql_stmt_result_num_rows (M_sql_stmt_t *stmt) |
size_t | M_sql_stmt_result_total_rows (M_sql_stmt_t *stmt) |
size_t | M_sql_stmt_result_num_cols (M_sql_stmt_t *stmt) |
const char * | M_sql_stmt_result_col_name (M_sql_stmt_t *stmt, size_t col) |
M_sql_data_type_t | M_sql_stmt_result_col_type (M_sql_stmt_t *stmt, size_t col, size_t *type_size) |
M_sql_data_type_t | M_sql_stmt_result_col_type_byname (M_sql_stmt_t *stmt, const char *col, size_t *type_size) |
M_bool | M_sql_stmt_result_col_idx (M_sql_stmt_t *stmt, const char *col, size_t *idx) |
M_sql_error_t | M_sql_stmt_result_isnull (M_sql_stmt_t *stmt, size_t row, size_t col, M_bool *is_null) |
M_sql_error_t | M_sql_stmt_result_text (M_sql_stmt_t *stmt, size_t row, size_t col, const char **text) |
M_sql_error_t | M_sql_stmt_result_bool (M_sql_stmt_t *stmt, size_t row, size_t col, M_bool *val) |
M_sql_error_t | M_sql_stmt_result_int16 (M_sql_stmt_t *stmt, size_t row, size_t col, M_int16 *val) |
M_sql_error_t | M_sql_stmt_result_int32 (M_sql_stmt_t *stmt, size_t row, size_t col, M_int32 *val) |
M_sql_error_t | M_sql_stmt_result_int64 (M_sql_stmt_t *stmt, size_t row, size_t col, M_int64 *val) |
M_sql_error_t | M_sql_stmt_result_binary (M_sql_stmt_t *stmt, size_t row, size_t col, const M_uint8 **bin, size_t *bin_size) |
M_bool | M_sql_stmt_result_isnull_direct (M_sql_stmt_t *stmt, size_t row, size_t col) |
const char * | M_sql_stmt_result_text_direct (M_sql_stmt_t *stmt, size_t row, size_t col) |
M_bool | M_sql_stmt_result_bool_direct (M_sql_stmt_t *stmt, size_t row, size_t col) |
M_int16 | M_sql_stmt_result_int16_direct (M_sql_stmt_t *stmt, size_t row, size_t col) |
M_int32 | M_sql_stmt_result_int32_direct (M_sql_stmt_t *stmt, size_t row, size_t col) |
M_int64 | M_sql_stmt_result_int64_direct (M_sql_stmt_t *stmt, size_t row, size_t col) |
const M_uint8 * | M_sql_stmt_result_binary_direct (M_sql_stmt_t *stmt, size_t row, size_t col, size_t *bin_size) |
M_sql_error_t | M_sql_stmt_result_isnull_byname (M_sql_stmt_t *stmt, size_t row, const char *col, M_bool *is_null) |
M_sql_error_t | M_sql_stmt_result_text_byname (M_sql_stmt_t *stmt, size_t row, const char *col, const char **text) |
M_sql_error_t | M_sql_stmt_result_bool_byname (M_sql_stmt_t *stmt, size_t row, const char *col, M_bool *val) |
M_sql_error_t | M_sql_stmt_result_int16_byname (M_sql_stmt_t *stmt, size_t row, const char *col, M_int16 *val) |
M_sql_error_t | M_sql_stmt_result_int32_byname (M_sql_stmt_t *stmt, size_t row, const char *col, M_int32 *val) |
M_sql_error_t | M_sql_stmt_result_int64_byname (M_sql_stmt_t *stmt, size_t row, const char *col, M_int64 *val) |
M_sql_error_t | M_sql_stmt_result_binary_byname (M_sql_stmt_t *stmt, size_t row, const char *col, const M_uint8 **bin, size_t *bin_size) |
M_bool | M_sql_stmt_result_isnull_byname_direct (M_sql_stmt_t *stmt, size_t row, const char *col) |
const char * | M_sql_stmt_result_text_byname_direct (M_sql_stmt_t *stmt, size_t row, const char *col) |
M_bool | M_sql_stmt_result_bool_byname_direct (M_sql_stmt_t *stmt, size_t row, const char *col) |
M_int16 | M_sql_stmt_result_int16_byname_direct (M_sql_stmt_t *stmt, size_t row, const char *col) |
M_int32 | M_sql_stmt_result_int32_byname_direct (M_sql_stmt_t *stmt, size_t row, const char *col) |
M_int64 | M_sql_stmt_result_int64_byname_direct (M_sql_stmt_t *stmt, size_t row, const char *col) |
const M_uint8 * | M_sql_stmt_result_binary_byname_direct (M_sql_stmt_t *stmt, size_t row, const char *col, size_t *bin_size) |
SQL Statement Result Processing
size_t M_sql_stmt_result_affected_rows | ( | M_sql_stmt_t * | stmt | ) |
Retrieve the number of rows affected by the executed statement.
Does not apply to SELECT statements, used often on UPDATE and DELETE statements to reflect how many rows were affected.
NOTE: On update, if updating a row in the database, and the passed in fields being updated are the same as the database already contains, depending on the backend database driver, that row may or may not be included.
Developers should not rely on this behavior.
[in] | stmt | Initialized M_sql_stmt_t object. |
size_t M_sql_stmt_result_num_rows | ( | M_sql_stmt_t * | stmt | ) |
Retrieve the number of cached rows in statement handle.
There may be additional rows yet to be fetched if not retrieving all rows at once. This function will return only the number of cached rows client-side, each time M_sql_stmt_fetch() is called, previous cached rows are cleared. This result is NOT cumulative.
[in] | stmt | Initialized M_sql_stmt_t object. |
size_t M_sql_stmt_result_total_rows | ( | M_sql_stmt_t * | stmt | ) |
Retrieve the number of total rows that have been fetched so far.
This number may be greater than or equal to M_sql_stmt_result_num_rows() as each call to M_sql_stmt_fetch() will clear the current cached rows (and count), but this value will continue to increment.
[in] | stmt | Initialized M_sql_stmt_t object. |
size_t M_sql_stmt_result_num_cols | ( | M_sql_stmt_t * | stmt | ) |
Retrieve the number of columns returned from the server in response to a query.
[in] | stmt | Initialized M_sql_stmt_t object. |
const char * M_sql_stmt_result_col_name | ( | M_sql_stmt_t * | stmt, |
size_t | col | ||
) |
Retrieve the name of a returned column.
[in] | stmt | Initialized and executed M_sql_stmt_t object. |
[in] | col | Index of column. |
M_sql_data_type_t M_sql_stmt_result_col_type | ( | M_sql_stmt_t * | stmt, |
size_t | col, | ||
size_t * | type_size | ||
) |
Retrieve the data type of the returned column.
[in] | stmt | Initialized and executed M_sql_stmt_t object. |
[in] | col | Index of column. |
[out] | type_size | Optional, pass NULL if not desired. For TEXT and BINARY types, the column definition may indicate a possible size (or maximum size). If the value is 0, it means the column width is bounded by the maximums of the SQL server. |
M_sql_data_type_t M_sql_stmt_result_col_type_byname | ( | M_sql_stmt_t * | stmt, |
const char * | col, | ||
size_t * | type_size | ||
) |
Retrieve the data type of the returned column.
[in] | stmt | Initialized and executed M_sql_stmt_t object. |
[in] | col | Name of column. |
[out] | type_size | Optional, pass NULL if not desired. For TEXT and BINARY types, the column definition may indicate a possible size (or maximum size). If the value is 0, it means the column width is bounded by the maximums of the SQL server. |
M_bool M_sql_stmt_result_col_idx | ( | M_sql_stmt_t * | stmt, |
const char * | col, | ||
size_t * | idx | ||
) |
Retrieve the column index by name
[in] | stmt | Initialized and executed M_sql_stmt_t object. |
[in] | col | Column name, case insensitive. |
[out] | idx | Index of column. |
M_sql_error_t M_sql_stmt_result_isnull | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col, | ||
M_bool * | is_null | ||
) |
Retrieve if a cell is NULL.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
[out] | is_null | Return whether column is NULL or not. |
M_sql_error_t M_sql_stmt_result_text | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col, | ||
const char ** | text | ||
) |
Retrieve a textual cell from the resultset.
All cell types may be retrieved in their textual form.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
[out] | text | Output constant pointer to cell data. May be NULL if a NULL column. |
M_sql_error_t M_sql_stmt_result_bool | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col, | ||
M_bool * | val | ||
) |
Retrieve a bool value from the resultset.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
[out] | val | Output boolean value. |
M_sql_error_t M_sql_stmt_result_int16 | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col, | ||
M_int16 * | val | ||
) |
Retrieve a signed 16bit Integer cell from the resultset.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
[out] | val | Output integer data. If NULL, outputs 0. |
M_sql_error_t M_sql_stmt_result_int32 | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col, | ||
M_int32 * | val | ||
) |
Retrieve a signed 32bit Integer cell from the resultset.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
[out] | val | Output integer data. If NULL, outputs 0. |
M_sql_error_t M_sql_stmt_result_int64 | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col, | ||
M_int64 * | val | ||
) |
Retrieve a signed 64bit Integer cell from the resultset.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
[out] | val | Output integer data. If NULL, outputs 0. |
M_sql_error_t M_sql_stmt_result_binary | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col, | ||
const M_uint8 ** | bin, | ||
size_t * | bin_size | ||
) |
Retrieve a binary cell from the resultset.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
[out] | bin | Output constant pointer to cell data. May be NULL if a NULL column. |
[out] | bin_size | Size of binary data returned. |
M_bool M_sql_stmt_result_isnull_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col | ||
) |
Retrieve if a cell is NULL, directly, ignoring errors.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
const char * M_sql_stmt_result_text_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col | ||
) |
Retrieve a textual cell from the resultset, directly, ignoring errors.
All cell types may be retrieved in their textual form.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
M_bool M_sql_stmt_result_bool_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col | ||
) |
Retrieve a bool value from the resultset, directly, ignoring errors.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
M_int16 M_sql_stmt_result_int16_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col | ||
) |
Retrieve a signed 16bit Integer cell from the resultset, directly, ignoring errors.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
M_int32 M_sql_stmt_result_int32_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col | ||
) |
Retrieve a signed 32bit Integer cell from the resultset, directly, ignoring errors.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
M_int64 M_sql_stmt_result_int64_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col | ||
) |
Retrieve a signed 64bit Integer cell from the resultset, directly, ignoring errors.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
const M_uint8 * M_sql_stmt_result_binary_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
size_t | col, | ||
size_t * | bin_size | ||
) |
Retrieve a binary cell from the resultset, directly, ignoring errors.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
[out] | bin_size | Size of binary data returned. |
M_sql_error_t M_sql_stmt_result_isnull_byname | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col, | ||
M_bool * | is_null | ||
) |
Retrieve if a cell is NULL (by column name).
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column nameto retrieve |
[out] | is_null | Return whether column is NULL or not. |
M_sql_error_t M_sql_stmt_result_text_byname | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col, | ||
const char ** | text | ||
) |
Retrieve a textual cell from the resultset (by column name).
All cell types may be retrieved in their textual form.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column name to retrieve |
[out] | text | Output constant pointer to cell data. May be NULL if a NULL column. |
M_sql_error_t M_sql_stmt_result_bool_byname | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col, | ||
M_bool * | val | ||
) |
Retrieve a bool value from the resultset (by column name).
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column name to retrieve |
[out] | val | Output boolean value. |
M_sql_error_t M_sql_stmt_result_int16_byname | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col, | ||
M_int16 * | val | ||
) |
Retrieve a signed 16bit Integer cell from the resultset (by column name).
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column name to retrieve |
[out] | val | Output integer data. |
M_sql_error_t M_sql_stmt_result_int32_byname | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col, | ||
M_int32 * | val | ||
) |
Retrieve a signed 32bit Integer cell from the resultset (by column name).
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column name to retrieve |
[out] | val | Output integer data. |
M_sql_error_t M_sql_stmt_result_int64_byname | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col, | ||
M_int64 * | val | ||
) |
Retrieve a signed 64bit Integer cell from the resultset (by column name).
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column name to retrieve |
[out] | val | Output integer data. |
M_sql_error_t M_sql_stmt_result_binary_byname | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col, | ||
const M_uint8 ** | bin, | ||
size_t * | bin_size | ||
) |
Retrieve a binary cell from the resultset (by column name).
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column index to retrieve |
[out] | bin | Output constant pointer to cell data. May be NULL if a NULL column. |
[out] | bin_size | Size of binary data returned, maximum is 64k. |
M_bool M_sql_stmt_result_isnull_byname_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col | ||
) |
Retrieve if a cell is NULL, directly, ignoring errors (by column name).
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column name to retrieve |
const char * M_sql_stmt_result_text_byname_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col | ||
) |
Retrieve a textual cell from the resultset, directly, ignoring errors (by column name).
All cell types may be retrieved in their textual form.
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column name to retrieve |
M_bool M_sql_stmt_result_bool_byname_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col | ||
) |
Retrieve a bool value from the resultset, directly, ignoring errors (by column name).
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column name to retrieve |
M_int16 M_sql_stmt_result_int16_byname_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col | ||
) |
Retrieve a signed 16bit Integer cell from the resultset, directly, ignoring errors (by column name).
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column name to retrieve |
M_int32 M_sql_stmt_result_int32_byname_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col | ||
) |
Retrieve a signed 32bit Integer cell from the resultset, directly, ignoring errors (by column name).
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column name to retrieve |
M_int64 M_sql_stmt_result_int64_byname_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col | ||
) |
Retrieve a signed 64bit Integer cell from the resultset, directly, ignoring errors (by column name).
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column name to retrieve |
const M_uint8 * M_sql_stmt_result_binary_byname_direct | ( | M_sql_stmt_t * | stmt, |
size_t | row, | ||
const char * | col, | ||
size_t * | bin_size | ||
) |
Retrieve a binary cell from the resultset, directly, ignoring errors (by column name).
[in] | stmt | Initialized M_sql_stmt_t object. |
[in] | row | Row index to retrieve |
[in] | col | Column name to retrieve |
[out] | bin_size | Size of binary data returned. |