Proud::COdbcRecordset Class Reference

Public Member Functions

bool MoveFirst ()
 
bool MoveLast ()
 
bool MovePrev ()
 
bool MoveNext ()
 
bool NextRecordSet ()
 
SQLLEN GetRowCount ()
 
SQLLEN GetCurrentRowIndex ()
 
SQLSMALLINT GetFieldCount ()
 
bool IsBof ()
 
bool IsEof ()
 
String GetFieldName (int fieldIndex)
 
OdbcSqlDataType GetFieldSqlType (int fieldIndex)
 
OdbcSqlDataType GetFieldSqlType (const String &fieldName)
 
SQLLEN GetFieldSizeOrNull (int fieldIndex)
 
SQLLEN GetFieldSizeOrNull (const String &fieldName)
 
SQLULEN GetFieldMaxSize (int fieldIndex)
 
SQLULEN GetFieldMaxSize (const String &fieldName)
 
SQLSMALLINT GetFieldPrecision (int fieldIndex)
 
SQLSMALLINT GetFieldPrecision (const String &fieldName)
 
bool GetFieldNullable (int fieldIndex)
 
bool GetFieldNullable (const String &fieldName)
 
const COdbcVariantGetFieldValue (int fieldIndex)
 
const COdbcVariantGetFieldValue (const String &fieldName)
 
void SetEnvironment (COdbcConnection *conn, void *hstmt, const SQLLEN &rowcount)
 

Detailed Description

It is a class that can control Recordset that has been received by SELECT.

Member Function Documentation

SQLLEN Proud::COdbcRecordset::GetCurrentRowIndex ( )

Return the current Row Index (ex> 0, 1, 2, ...). If Row Index is -1, its status is BOF and if it is same as Row Count, its status is EOF.

SQLSMALLINT Proud::COdbcRecordset::GetFieldCount ( )

Return the total number of Fields.

SQLULEN Proud::COdbcRecordset::GetFieldMaxSize ( int  fieldIndex)

Bring the maximum size (Database setting) of Field(Column) data.

Parameters
fieldIndexField(Column) Index (ex> 1, 2, 3, ...)
SQLULEN Proud::COdbcRecordset::GetFieldMaxSize ( const String fieldName)

Bring the maximum size (Database setting) of Field(Column) data.

Parameters
fieldnameIt is the name of Field(Column).
String Proud::COdbcRecordset::GetFieldName ( int  fieldIndex)

Get the name of Field(Column). It might not be executed normally at a query whose column name has not been defined, such as "SELECT COUNT(*) FROM TABLE". In this case, set Alias in the column name and use it like "SELECT COUNT(*) AS TOTAL FROM TABLE".

bool Proud::COdbcRecordset::GetFieldNullable ( int  fieldIndex)

Return whether or not it can input NULL by Field(Column) data (Database setting).

Parameters
fieldIndexField(Column) Index (ex> 1, 2, 3, ...)
bool Proud::COdbcRecordset::GetFieldNullable ( const String fieldName)

Return whether or not it can input NULL by Field(Column) data (Database setting).

Parameters
fieldnameIt is the name of Field(Column).
SQLSMALLINT Proud::COdbcRecordset::GetFieldPrecision ( int  fieldIndex)

Bring a decimal place of Field(Column) data. It is used at types like Real, Float, Double and Timestamp.

Parameters
fieldIndexField(Column) Index (ex> 1, 2, 3, ...)
SQLSMALLINT Proud::COdbcRecordset::GetFieldPrecision ( const String fieldName)

Bring a decimal place of Field(Column) data. It is used at types like Real, Float, Double and Timestamp.

Parameters
fieldnameIt is the name of Field(Column).
SQLLEN Proud::COdbcRecordset::GetFieldSizeOrNull ( int  fieldIndex)

Bring the current size of Field(Column) data. In case of NULL, it returns -1.

Parameters
fieldIndexField(Column) Index (ex> 1, 2, 3, ...)
SQLLEN Proud::COdbcRecordset::GetFieldSizeOrNull ( const String fieldName)

Bring the current size of Field(Column) data. In case of NULL, it returns -1.

Parameters
fieldnameIt is the name of Field(Column).
OdbcSqlDataType Proud::COdbcRecordset::GetFieldSqlType ( int  fieldIndex)

Get SqlDataType of Field(Column).

Parameters
fieldIndexField(Column) Index (ex> 1, 2, 3, ...)
OdbcSqlDataType Proud::COdbcRecordset::GetFieldSqlType ( const String fieldName)

Get SqlDataType of Field(Column).

Parameters
fieldnameIt is the name of Field(Column).
const COdbcVariant& Proud::COdbcRecordset::GetFieldValue ( int  fieldIndex)

Return Field(Column) data. In case you do not know the type of data, use GetFieldSqlType() to get to know. Refer to OdbcEnum.h for Default OdbcDataType that is mapped with OdbcSqlDataType. ex> int a = recordset.GetFieldValue(1);

Parameters
fieldIndexField(Column) Index (ex> 1, 2, 3, ...)
const COdbcVariant& Proud::COdbcRecordset::GetFieldValue ( const String fieldName)

Return Field(Column) data. In case you do not know the type of data, use GetFieldSqlType() to get to know. Refer to OdbcEnum.h for Default OdbcDataType that is mapped with OdbcSqlDataType. ex> int a = recordset.GetFieldValue("name");

Parameters
fieldnameIt is the name of Field(Column).
SQLLEN Proud::COdbcRecordset::GetRowCount ( )

Return the total number of Row.

bool Proud::COdbcRecordset::IsBof ( )

BOF indicates Index == -1 and it means there is no data that has been read.

bool Proud::COdbcRecordset::IsEof ( )

EOF indicates Index == GetRowCount() and it means all data has been read.

bool Proud::COdbcRecordset::MoveFirst ( )

Move to the first record. It cannot be used at Recordset of Stored Procedure.

bool Proud::COdbcRecordset::MoveLast ( )

Move to the last record. It cannot be used at Recordset of Stored Procedure.

bool Proud::COdbcRecordset::MoveNext ( )

Move to the next record. In order to gather this, you need to call this function first when gathering data.

bool Proud::COdbcRecordset::MovePrev ( )

Move to the previous record. It cannot be used at Recordset of Stored Procedure.

bool Proud::COdbcRecordset::NextRecordSet ( )

In case of bringing many RecordSets, you may convert it to the next RecordSet by using this function.