Struct odbc_api::handles::StatementImpl[][src]

pub struct StatementImpl<'s> { /* fields omitted */ }

Wraps a valid (i.e. successfully allocated) ODBC statement handle.

Implementations

impl<'s> StatementImpl<'s>[src]

pub unsafe fn new(handle: HStmt) -> Self[src]

Safety

handle must be a valid (successfully allocated) statement handle.

Trait Implementations

impl<'c> AsHandle for StatementImpl<'c>[src]

impl<'s> Drop for StatementImpl<'s>[src]

impl<'o> Statement for StatementImpl<'o>[src]

unsafe fn execute(&mut self) -> Result<bool, Error>[src]

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.

Safety

While self as always guaranteed to be a valid allocated handle, this function may dereference bound parameters. It is the callers responsibility to ensure these are still valid. One strategy is to reset potentially invalid parameters right before the call using reset_parameters.

Return

If an update, insert, or delete statement did not affect any rows at the data source false is returned.

fn num_result_cols(&self) -> Result<i16, Error>[src]

Number of columns in result set.

Can also be used to check, whether or not a result set has been created at all.

unsafe fn set_row_array_size(&mut self, size: u32) -> Result<(), Error>[src]

Sets the batch size for bulk cursors, if retrieving many rows at once.

Safety

It is the callers responsibility to ensure that buffers bound using bind_col can hold the specified amount of rows.

unsafe fn set_paramset_size(&mut self, size: u32) -> Result<(), Error>[src]

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.

Safety

The bound buffers must at least hold the number of elements specified in this call then the statement is executed.

unsafe fn set_row_bind_type(&mut self, row_size: u32) -> Result<(), Error>[src]

Sets the binding type to columnar binding for batch cursors.

Any Positive number indicates a row wise binding with that row length. 0 indicates a columnar binding.

Safety

It is the callers responsibility to ensure that the bound buffers match the memory layout specified by this function.

unsafe fn bind_input_parameter(
    &mut self,
    parameter_number: u16,
    parameter: &impl HasDataType
) -> Result<(), Error>
[src]

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.

See https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlbindparameter-function.

Safety

  • It is up to the caller to ensure the lifetimes of the bound parameters.
  • Calling this function may influence other statements that share the APD.

unsafe fn bind_parameter(
    &mut self,
    parameter_number: u16,
    input_output_type: ParamType,
    parameter: &mut impl CDataMut + HasDataType
) -> Result<(), Error>
[src]

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.

See https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlbindparameter-function.

Safety

  • It is up to the caller to ensure the lifetimes of the bound parameters.
  • Calling this function may influence other statements that share the APD.

fn is_unsigned_column(&self, column_number: u16) -> Result<bool, Error>[src]

true if a given column in a result set is unsigned or not a numeric type, false otherwise.

column_number: Index of the column, starting at 1.

fn col_type(&self, column_number: u16) -> Result<SqlDataType, Error>[src]

Returns a number identifying the SQL type of the column in the result set.

column_number: Index of the column, starting at 1.

fn col_concise_type(&self, column_number: u16) -> Result<SqlDataType, Error>[src]

The concise data type. For the datetime and interval data types, this field returns the concise data type; for example, TIME or INTERVAL_YEAR.

column_number: Index of the column, starting at 1.

fn col_data_type(&self, column_number: u16) -> Result<DataType, Error>[src]

Data type of the specified column.

column_number: Index of the column, starting at 1.

fn col_octet_length(&self, column_number: u16) -> Result<Len, Error>[src]

Returns the size in bytes of the columns. For variable sized types the maximum size is returned, excluding a terminating zero.

column_number: Index of the column, starting at 1.

fn col_display_size(&self, column_number: u16) -> Result<Len, Error>[src]

Maximum number of characters required to display data from the column.

column_number: Index of the column, starting at 1.

fn col_precision(&self, column_number: u16) -> Result<Len, Error>[src]

Precision of the column.

Denotes the applicable precision. For data types SQL_TYPE_TIME, SQL_TYPE_TIMESTAMP, and all the interval data types that represent a time interval, its value is the applicable precision of the fractional seconds component.

fn col_scale(&self, column_number: u16) -> Result<Len, Error>[src]

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.

fn col_name(&self, column_number: u16, buf: &mut Vec<u16>) -> Result<(), Error>[src]

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.

unsafe fn numeric_col_attribute(
    &self,
    attribute: Desc,
    column_number: u16
) -> Result<Len, Error>
[src]

Safety

It is the callers responsibility to ensure that attribute refers to a numeric attribute.

fn reset_parameters(&mut self) -> Result<(), Error>[src]

Sets the SQL_DESC_COUNT field of the APD to 0, releasing all parameter buffers set for the given StatementHandle.

fn describe_param(
    &self,
    parameter_number: u16
) -> Result<ParameterDescription, Error>
[src]

Describes parameter marker associated with a prepared SQL statement.

Parameters

  • parameter_number: Parameter marker number ordered sequentially in increasing parameter order, starting at 1.

Auto Trait Implementations

impl<'s> RefUnwindSafe for StatementImpl<'s>

impl<'s> !Send for StatementImpl<'s>

impl<'s> !Sync for StatementImpl<'s>

impl<'s> Unpin for StatementImpl<'s>

impl<'s> UnwindSafe for StatementImpl<'s>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.