Made to Order Software Corporation Logo

odbcpp: odbcpp::dynamic_record::bind_info_t Class Reference

Structure holding bind information for a dynamically allocated column. More...

Collaboration diagram for odbcpp::dynamic_record::bind_info_t:

List of all members.

Public Member Functions

 bind_info_t ()
 Initializes the structure to defaults.

Public Attributes

SQLSMALLINT f_bind_type
 The type used to bind the column.

SQLSMALLINT f_col
 The column number of this bind information.

smartptr< buffer_char_tf_data
 The data buffer where the variable will be loaded.

SQLSMALLINT f_decimal_digits
 The number of digits after the decimal point.

SQLLEN f_fetch_size
 The number of bytes that the fetch() command copied in this column variable.

std::string f_name
 The name of the column when available.

SQLULEN f_size
 The size of the buffer in bytes.

SQLSMALLINT f_target_type
 The type of the column.


Detailed Description

Structure holding bind information for a dynamically allocated column.

Whenever the statement::fetch() function is called, it wants to save the row data in user variables. This is done by first binding variables to a statement for each column.

This structure is used to define one such variable (a column).

The data is dynamically allocated and thus the f_data member must remain valid the whole time the fetch() command is to be used.

Definition at line 298 of file record.h.


Constructor & Destructor Documentation

odbcpp::dynamic_record::bind_info_t::bind_info_t (  )  [inline]

Initializes the structure to defaults.

The constructor ensures that the structure is initialized with proper defaults so it can be used in all cases.

Definition at line 299 of file record.h.


Member Data Documentation

The type used to bind the column.

This entry is the type used to bind the column. The exact column type is defined in the dynamic_record::f_target_type instead.

It is expected to be used with ODBC C types such as SQL_C_SHORT and SQL_C_VARTIME.

Definition at line 314 of file record.h.

Referenced by odbcpp::dynamic_record::bind_impl(), and odbcpp::dynamic_record::verify_column().

The column number of this bind information.

This number represents the column number of this bind information.

The column numbers start at 1.

Definition at line 312 of file record.h.

Referenced by odbcpp::dynamic_record::bind_impl(), and odbcpp::dynamic_record::column_number().

The data buffer where the variable will be loaded.

In the dynamic record, the data buffer is always dynamically allocated. The smart pointer and the buffer class automatically handle the memory buffer allocation and deallocation.

Definition at line 316 of file record.h.

Referenced by odbcpp::dynamic_record::bind_impl(), and odbcpp::dynamic_record::get().

The number of digits after the decimal point.

This number represents the number of digits after the decimal point in a numeric or a date type.

This number can be zero, but it cannot be negative.

Definition at line 315 of file record.h.

Referenced by odbcpp::dynamic_record::bind_impl(), and odbcpp::dynamic_record::get_decimal_digits().

The number of bytes that the fetch() command copied in this column variable.

This variable is used by the statement::fetch() call to save the size of the column in bytes at the time the data is read in our dynamic variable.

This should be equal or smaller to the f_size parameter.

Definition at line 318 of file record.h.

Referenced by odbcpp::dynamic_record::bind_impl(), odbcpp::dynamic_record::get(), odbcpp::dynamic_record::get_is_null(), odbcpp::dynamic_record::get_size(), and odbcpp::dynamic_record::verify_column().

The name of the column when available.

This variable is set to the name of the column the dynamic record was bound to whenever the system could give us that name.

Definition at line 311 of file record.h.

Referenced by odbcpp::dynamic_record::bind_impl(), odbcpp::dynamic_record::column_name(), and odbcpp::dynamic_record::verify_column().

The size of the buffer in bytes.

This variable holds the size of the variable as it was read by the SQLColDescribe() function.

This size may be larger than necessary for the type of the column.

Definition at line 317 of file record.h.

Referenced by odbcpp::dynamic_record::bind_impl(), and odbcpp::dynamic_record::get().

The type of the column.

This entry represents the type of the column. This represents the data type such as SMALLINT or VARCHAR. This type is not modified from what the system tells us it is.

It is expected to be used with ODBC C types such as SQL_C_SHORT and SQL_C_VARTIME.

Definition at line 313 of file record.h.

Referenced by odbcpp::dynamic_record::bind_impl(), and odbcpp::dynamic_record::get_type().


The documentation for this class was generated from the following files:
Generated on Mon Sep 19 12:52:27 2011 for odbcpp by  doxygen 1.6.3