Struct odbc_safe::Statement [] [src]

pub struct Statement<'con, 'param, C = NoCursor, A = Unprepared> { /* fields omitted */ }

A Statement is most easily thought of as an SQL statement, such as SELECT * FROM Employee.

  • The statement's state
  • The current statement-level diagnostics
  • The addresses of the application variables bound to the statement's parameters and result set columns
  • The current settings of each statement attribute

See Statement Handles

Methods

impl<'con, 'param, S, A> Statement<'con, 'param, S, A>
[src]

Provides access to the raw ODBC Statement Handle

Binds a parameter to a parameter marker in an SQL Statement

Result

This method will destroy the statement and create a new one which may not outlive the bound parameter. This is to ensure that the statement will not derefernce an invalid pointer during execution. Use reset_parameters to reset the bound parameters and increase the 'param lifetime back to 'static.

Arguments

  • parameter_number - Index of the marker to bind to the parameter. Starting at 1
  • parameter_type - SQL Type of the parameter
  • value - Reference to bind to the marker

See SQLBindParameter Function

Unbinds the parameters from the parameter markers

impl<'con, 'param, C, A> Statement<'con, 'param, C, A> where
    C: CursorState, 
[src]

Returns the number of columns of the result set

See SQLNumResultCols

Advances Cursor to next row

See SQLFetch See Fetching a Row of Data

Closes the cursor. Cursors only need to be closed explicitly if the Statement handle is intended to be reused, but a result set is not consumed.

See SQLCloseCursor See Closing the Cursor

impl<'con, 'param> Statement<'con, 'param, NoCursor, Unprepared>
[src]

Allocates a new Statement

Prepares a Statement for execution by creating an Access Plan.

See SQLPrepare Function See Prepare and Execute a Statement (ODBC)

Executes a preparable statement, using the current values of the parametr marker variables.

impl<'con, 'param> Statement<'con, 'param, NoCursor, Prepared>
[src]

Executes a prepared statement, using the current values fo the parameter marker variables if any parameter markers exist in the statement.

See SQLExecute Function See Prepared Execution

impl<'con, 'param, A> Statement<'con, 'param, Positioned, A>
[src]

Retrieves data for a single column or output parameter.

See SQLGetData

Trait Implementations

impl<'con, 'param, C: Debug, A: Debug> Debug for Statement<'con, 'param, C, A>
[src]

Formats the value using the given formatter.

impl<'con, 'param, C> Diagnostics for Statement<'con, 'param, C>
[src]

Returns the current values of multiple fields of a diagnostic record that contains error, warning, and status information. Read more