Struct odbc_api::StatementConnection
source · [−]pub struct StatementConnection<'env> { /* private fields */ }
Expand description
Statement handle which also takes ownership of Connection
Trait Implementations
sourceimpl AsHandle for StatementConnection<'_>
impl AsHandle for StatementConnection<'_>
sourcefn as_handle(&self) -> Handle
fn as_handle(&self) -> Handle
The raw underlying ODBC handle used to talk to the ODBC C API. The handle must be valid.
sourcefn handle_type(&self) -> HandleType
fn handle_type(&self) -> HandleType
The type of the ODBC handle returned by as_handle
. This is a method rather than a constant
in order to make the type object safe. Read more
sourceimpl<'s> Drop for StatementConnection<'s>
impl<'s> Drop for StatementConnection<'s>
sourceimpl Statement for StatementConnection<'_>
impl Statement for StatementConnection<'_>
sourcefn as_sys(&self) -> HStmt
fn as_sys(&self) -> HStmt
Gain access to the underlying statement handle without transferring ownership to it.
sourceunsafe fn bind_col(
&mut self,
column_number: u16,
target: &mut impl CDataMut
) -> SqlResult<()>
unsafe fn bind_col(
&mut self,
column_number: u16,
target: &mut impl CDataMut
) -> SqlResult<()>
Binds application data buffers to columns in the result set. Read more
sourceunsafe fn fetch(&mut self) -> Option<SqlResult<()>>
unsafe fn fetch(&mut self) -> Option<SqlResult<()>>
Returns the next row set in the result set. Read more
sourcefn get_data(
&mut self,
col_or_param_num: u16,
target: &mut impl CDataMut
) -> SqlResult<()>
fn get_data(
&mut self,
col_or_param_num: u16,
target: &mut impl CDataMut
) -> SqlResult<()>
Retrieves data for a single column in the result set or for a single parameter.
sourcefn unbind_cols(&mut self) -> SqlResult<()>
fn unbind_cols(&mut self) -> SqlResult<()>
Release all column buffers bound by bind_col
. Except bookmark column.
sourceunsafe fn set_num_rows_fetched(
&mut self,
num_rows: Option<&mut usize>
) -> SqlResult<()>
unsafe fn set_num_rows_fetched(
&mut self,
num_rows: Option<&mut usize>
) -> SqlResult<()>
Bind an integer to hold the number of rows retrieved with fetch in the current row set.
Passing None
for num_rows
is going to unbind the value from the statement. Read more
sourcefn describe_col(
&self,
column_number: u16,
column_description: &mut ColumnDescription
) -> SqlResult<()>
fn describe_col(
&self,
column_number: u16,
column_description: &mut ColumnDescription
) -> SqlResult<()>
Fetch a column description using the column index. Read more
sourceunsafe fn exec_direct(&mut self, statement: &SqlText<'_>) -> SqlResult<bool>
unsafe fn exec_direct(&mut self, statement: &SqlText<'_>) -> SqlResult<bool>
Executes a statement, using the current values of the parameter marker variables if any parameters exist in the statement. SQLExecDirect is the fastest way to submit an SQL statement for one-time execution. Read more
sourcefn close_cursor(&mut self) -> SqlResult<()>
fn close_cursor(&mut self) -> SqlResult<()>
Close an open cursor.
sourcefn prepare(&mut self, statement: &SqlText<'_>) -> SqlResult<()>
fn prepare(&mut self, statement: &SqlText<'_>) -> SqlResult<()>
Send an SQL statement to the data source for preparation. The application can include one or more parameter markers in the SQL statement. To include a parameter marker, the application embeds a question mark (?) into the SQL string at the appropriate position. Read more
sourceunsafe fn execute(&mut self) -> SqlResult<bool>
unsafe fn execute(&mut self) -> SqlResult<bool>
Executes a statement prepared by prepare
. After the application processes or discards the
results from a call to execute
, the application can call SQLExecute again with new
parameter values. Read more
sourcefn num_result_cols(&self) -> SqlResult<i16>
fn num_result_cols(&self) -> SqlResult<i16>
Number of columns in result set. Read more
sourceunsafe fn set_row_array_size(&mut self, size: usize) -> SqlResult<()>
unsafe fn set_row_array_size(&mut self, size: usize) -> SqlResult<()>
Sets the batch size for bulk cursors, if retrieving many rows at once. Read more
sourceunsafe fn set_paramset_size(&mut self, size: usize) -> SqlResult<()>
unsafe fn set_paramset_size(&mut self, size: usize) -> SqlResult<()>
Specifies the number of values for each parameter. If it is greater than 1, the data and indicator buffers of the statement point to arrays. The cardinality of each array is equal to the value of this field. Read more
sourceunsafe fn set_row_bind_type(&mut self, row_size: usize) -> SqlResult<()>
unsafe fn set_row_bind_type(&mut self, row_size: usize) -> SqlResult<()>
Sets the binding type to columnar binding for batch cursors. Read more
fn set_metadata_id(&mut self, metadata_id: bool) -> SqlResult<()>
sourceunsafe fn bind_input_parameter(
&mut self,
parameter_number: u16,
parameter: &impl HasDataType + CData + ?Sized
) -> SqlResult<()>
unsafe fn bind_input_parameter(
&mut self,
parameter_number: u16,
parameter: &impl HasDataType + CData + ?Sized
) -> SqlResult<()>
Binds a buffer holding an input parameter to a parameter marker in an SQL statement. This
specialized version takes a constant reference to parameter, but is therefore limited to
binding input parameters. See Statement::bind_parameter
for the version which can bind
input and output parameters. Read more
sourceunsafe fn bind_parameter(
&mut self,
parameter_number: u16,
input_output_type: ParamType,
parameter: &mut impl CDataMut + HasDataType
) -> SqlResult<()>
unsafe fn bind_parameter(
&mut self,
parameter_number: u16,
input_output_type: ParamType,
parameter: &mut impl CDataMut + HasDataType
) -> SqlResult<()>
Binds a buffer holding a single parameter to a parameter marker in an SQL statement. To bind
input parameters using constant references see Statement::bind_input_parameter
. Read more
sourceunsafe fn bind_delayed_input_parameter(
&mut self,
parameter_number: u16,
parameter: &mut impl DelayedInput + HasDataType
) -> SqlResult<()>
unsafe fn bind_delayed_input_parameter(
&mut self,
parameter_number: u16,
parameter: &mut impl DelayedInput + HasDataType
) -> SqlResult<()>
Binds an input stream to a parameter marker in an SQL statement. Use this to stream large
values at statement execution time. To bind preallocated constant buffers see
Statement::bind_input_parameter
. Read more
sourcefn is_unsigned_column(&self, column_number: u16) -> SqlResult<bool>
fn is_unsigned_column(&self, column_number: u16) -> SqlResult<bool>
true
if a given column in a result set is unsigned or not a numeric type, false
otherwise. Read more
sourcefn col_type(&self, column_number: u16) -> SqlResult<SqlDataType>
fn col_type(&self, column_number: u16) -> SqlResult<SqlDataType>
Returns a number identifying the SQL type of the column in the result set. Read more
sourcefn col_concise_type(&self, column_number: u16) -> SqlResult<SqlDataType>
fn col_concise_type(&self, column_number: u16) -> SqlResult<SqlDataType>
The concise data type. For the datetime and interval data types, this field returns the
concise data type; for example, TIME
or INTERVAL_YEAR
. Read more
sourcefn col_octet_length(&self, column_number: u16) -> SqlResult<isize>
fn col_octet_length(&self, column_number: u16) -> SqlResult<isize>
Returns the size in bytes of the columns. For variable sized types the maximum size is returned, excluding a terminating zero. Read more
sourcefn col_display_size(&self, column_number: u16) -> SqlResult<isize>
fn col_display_size(&self, column_number: u16) -> SqlResult<isize>
Maximum number of characters required to display data from the column. Read more
sourcefn col_precision(&self, column_number: u16) -> SqlResult<isize>
fn col_precision(&self, column_number: u16) -> SqlResult<isize>
Precision of the column. Read more
sourcefn col_scale(&self, column_number: u16) -> SqlResult<Len>
fn col_scale(&self, column_number: u16) -> SqlResult<Len>
The applicable scale for a numeric data type. For DECIMAL and NUMERIC data types, this is the defined scale. It is undefined for all other data types. Read more
sourcefn col_name(
&self,
column_number: u16,
buffer: &mut Vec<SqlChar>
) -> SqlResult<()>
fn col_name(
&self,
column_number: u16,
buffer: &mut Vec<SqlChar>
) -> SqlResult<()>
The column alias, if it applies. If the column alias does not apply, the column name is returned. If there is no column name or a column alias, an empty string is returned. Read more
sourceunsafe fn numeric_col_attribute(
&self,
attribute: Desc,
column_number: u16
) -> SqlResult<Len>
unsafe fn numeric_col_attribute(
&self,
attribute: Desc,
column_number: u16
) -> SqlResult<Len>
Safety Read more
sourcefn reset_parameters(&mut self) -> SqlResult<()>
fn reset_parameters(&mut self) -> SqlResult<()>
Sets the SQL_DESC_COUNT field of the APD to 0, releasing all parameter buffers set for the given StatementHandle. Read more
sourcefn describe_param(
&self,
parameter_number: u16
) -> SqlResult<ParameterDescription>
fn describe_param(
&self,
parameter_number: u16
) -> SqlResult<ParameterDescription>
Describes parameter marker associated with a prepared SQL statement. Read more
sourcefn param_data(&mut self) -> SqlResult<Option<Pointer>>
fn param_data(&mut self) -> SqlResult<Option<Pointer>>
Use to check if which additional parameters need data. Should be called after binding
parameters with an indicator set to crate::sys::DATA_AT_EXEC
or a value created with
crate::sys::len_data_at_exec
. Read more
sourcefn columns(
&mut self,
catalog_name: &SqlText<'_>,
schema_name: &SqlText<'_>,
table_name: &SqlText<'_>,
column_name: &SqlText<'_>
) -> SqlResult<()>
fn columns(
&mut self,
catalog_name: &SqlText<'_>,
schema_name: &SqlText<'_>,
table_name: &SqlText<'_>,
column_name: &SqlText<'_>
) -> SqlResult<()>
Executes a columns query using this statement handle.
sourcefn tables(
&mut self,
catalog_name: &SqlText<'_>,
schema_name: &SqlText<'_>,
table_name: &SqlText<'_>,
table_type: &SqlText<'_>
) -> SqlResult<()>
fn tables(
&mut self,
catalog_name: &SqlText<'_>,
schema_name: &SqlText<'_>,
table_name: &SqlText<'_>,
table_type: &SqlText<'_>
) -> SqlResult<()>
Returns the list of table, catalog, or schema names, and table types, stored in a specific data source. The driver returns the information as a result set. Read more
Auto Trait Implementations
impl<'env> RefUnwindSafe for StatementConnection<'env>
impl<'env> !Send for StatementConnection<'env>
impl<'env> !Sync for StatementConnection<'env>
impl<'env> Unpin for StatementConnection<'env>
impl<'env> UnwindSafe for StatementConnection<'env>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more