[][src]Struct odbc_api::Cursor

pub struct Cursor<'open_connection> { /* fields omitted */ }

Cursors are used to process and iterate the result sets returned by executing queries.

Implementations

impl<'o> Cursor<'o>[src]

pub fn describe_col(
    &self,
    column_number: USmallInt,
    column_description: &mut ColumnDescription
) -> Result<(), Error>
[src]

Fetch a column description using the column index.

Parameters

  • column_number: Column index. 0 is the bookmark column. The other column indices start with 1.
  • column_description: Holds the description of the column after the call. This method does not provide strong exception safety as the value of this argument is undefined in case of an error.

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

Number of columns in result set.

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

Returns the next rowset in the result set.

If any columns are bound, it returns the data in those columns. If the application has specified a pointer to a row status array or a buffer in which to return the number of rows fetched, fetch also returns this information. Calls to fetch can be mixed with calls to fetch_scroll.

pub unsafe fn set_row_array_size(&mut self, size: UInteger) -> 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.

pub unsafe fn set_num_rows_fetched(
    &mut self,
    num_rows: &mut ULen
) -> Result<(), Error>
[src]

Bind an integer to hold the number of rows retrieved with fetch in the current row set.

Safety

num_rows must not be moved and remain valid, as long as it remains bound to the cursor.

pub 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.

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

Release all columen buffers bound by bind_col. Except bookmark column.

pub unsafe fn bind_col(
    &mut self,
    column_number: USmallInt,
    target_type: CDataType,
    target_value: Pointer,
    target_length: Len,
    indicator: *mut Len
) -> Result<(), Error>
[src]

Binds application data buffers to columns in the result set

  • column_number: 0 is the bookmark column. It is not included in some result sets. All other columns are numbered starting with 1. It is an error to bind a higher-numbered column than there are columns in the result set. This error cannot be detected until the result set has been created, so it is returned by fetch, not bind_col.
  • target_type: The identifier of the C data type of the value buffer. When it is retrieving data from the data source with fetch, the driver converts the data to this type. When it sends data to the source, the driver converts the data from this type.
  • target_value: Pointer to the data buffer to bind to the column.
  • target_length: Length of target value in bytes. (Or for a single element in case of bulk aka. block fetching data).
  • indicator: Buffer is going to hold length or indicator values.

Safety

It is the callers responsibility to make sure the bound columns live until they are no longer bound.

pub fn is_unsigned_column(
    &self,
    column_number: USmallInt
) -> 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.

pub fn bind_row_set_buffer<'b, B>(
    self,
    row_set_buffer: &'b mut B
) -> Result<RowSetCursor<'b, 'o, B>, Error> where
    B: RowSetBuffer
[src]

Binds this cursor to a buffer holding a row set.

pub fn col_data_type(
    &self,
    column_number: USmallInt
) -> Result<SqlDataType, Error>
[src]

SqlDataType

column_number: Index of the column, starting at 1.

pub fn col_octet_length(&self, column_number: USmallInt) -> 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.

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

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

column_number: Index of the column, starting at 1.

pub fn col_precision(&self, column_number: USmallInt) -> 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.

pub fn col_scale(&self, column_number: USmallInt) -> 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.

pub fn col_name(
    &self,
    column_number: USmallInt,
    buf: &mut Vec<WChar>
) -> 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.

Trait Implementations

impl<'o> Drop for Cursor<'o>[src]

Auto Trait Implementations

impl<'open_connection> RefUnwindSafe for Cursor<'open_connection>

impl<'open_connection> !Send for Cursor<'open_connection>

impl<'open_connection> !Sync for Cursor<'open_connection>

impl<'open_connection> Unpin for Cursor<'open_connection>

impl<'open_connection> UnwindSafe for Cursor<'open_connection>

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.