pub trait ToSql: Send + Sync {
// Required method
fn bind_to(
&mut self,
pos: usize,
params: &mut Params,
stmt: &OCIStmt,
err: &OCIError
) -> Result<usize>;
// Provided method
fn update_from_bind(&mut self, pos: usize, _params: &Params) -> Result<usize> { ... }
}
Expand description
A trait for types that can be used as SQL arguments
Required Methods§
sourcefn bind_to(
&mut self,
pos: usize,
params: &mut Params,
stmt: &OCIStmt,
err: &OCIError
) -> Result<usize>
fn bind_to(
&mut self,
pos: usize,
params: &mut Params,
stmt: &OCIStmt,
err: &OCIError
) -> Result<usize>
Binds itself to the SQL parameter placeholder
Parameters
pos
- zero-based index of the parameter placeholder to which the value will be boundparams
- Statement parameters as defined in the SQLstmt
- statement to which the argument value will be bounderr
- OCI error structure
Note that the specified position might be ignored if the argument also provides the specific placeholder name to which the value should be bound.
Returns
The index of the placeholder for the next argument.
Provided Methods§
sourcefn update_from_bind(&mut self, pos: usize, _params: &Params) -> Result<usize>
fn update_from_bind(&mut self, pos: usize, _params: &Params) -> Result<usize>
A callback that is called to update OUT (or INOUT) argumetns. For example, to set the length of the received data.