View on GitHub API Documentation
A small C++ wrapper for the native C ODBC API.
Functions
Binding multiple non-string values

Binds given values to given parameter placeholder number in the prepared statement. More...

Functions

template<class T >
void nanodbc::statement::bind (short param_index, T const *values, std::size_t batch_size, param_direction direction=PARAM_IN)
 Binds multiple values. More...
 
template<class T >
void nanodbc::statement::bind (short param_index, T const *values, std::size_t batch_size, T const *null_sentry, param_direction direction=PARAM_IN)
 Binds multiple values. More...
 
template<class T >
void nanodbc::statement::bind (short param_index, T const *values, std::size_t batch_size, bool const *nulls, param_direction direction=PARAM_IN)
 Binds multiple values. More...
 
void nanodbc::statement::bind (short param_index, std::vector< std::vector< uint8_t >> const &values, param_direction direction=PARAM_IN)
 Binds multiple values. More...
 
void nanodbc::statement::bind (short param_index, std::vector< std::vector< uint8_t >> const &values, bool const *nulls, param_direction direction=PARAM_IN)
 Binds multiple values. More...
 
void nanodbc::statement::bind (short param_index, std::vector< std::vector< uint8_t >> const &values, uint8_t const *null_sentry, param_direction direction=PARAM_IN)
 Binds multiple values. More...
 

Detailed Description

If your prepared SQL query has any parameter markers, ? (question mark) placeholders, this is how you bind values to them. Parameter markers are numbered using Zero-based index from left to right.

It is possible to use these functions for batch operations.

Parameters
param_indexZero-based index of parameter marker (placeholder position).
valuesValues to substitute into placeholder.
batch_sizeThe number of values being bound.
null_sentryValue which should represent a null value.
nullsFlags for values that should be set to a null value.
param_direcitonODBC parameter direction.
Exceptions
database_error

Function Documentation

◆ bind() [1/6]

template<class T >
void nanodbc::statement::bind ( short  param_index,
T const *  values,
std::size_t  batch_size,
param_direction  direction = PARAM_IN 
)

◆ bind() [2/6]

template<class T >
void nanodbc::statement::bind ( short  param_index,
T const *  values,
std::size_t  batch_size,
T const *  null_sentry,
param_direction  direction = PARAM_IN 
)

◆ bind() [3/6]

template<class T >
void nanodbc::statement::bind ( short  param_index,
T const *  values,
std::size_t  batch_size,
bool const *  nulls,
param_direction  direction = PARAM_IN 
)

◆ bind() [4/6]

void nanodbc::statement::bind ( short  param_index,
std::vector< std::vector< uint8_t >> const &  values,
param_direction  direction = PARAM_IN 
)

◆ bind() [5/6]

void nanodbc::statement::bind ( short  param_index,
std::vector< std::vector< uint8_t >> const &  values,
bool const *  nulls,
param_direction  direction = PARAM_IN 
)

◆ bind() [6/6]

void nanodbc::statement::bind ( short  param_index,
std::vector< std::vector< uint8_t >> const &  values,
uint8_t const *  null_sentry,
param_direction  direction = PARAM_IN 
)