VisualIB  1.0
IBExpress library for making use of Borland IBExpress outside of C++Builder
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
VIB::SQL Class Reference

VIB::SQL wraps the VisualIB VIBSQL C structure with a C++11 object with semantics compatible with those of Borland TIBSQL. More...

#include <classVIBSQL.h>

Classes

class  ParamClass
 Wrapper for a single Param object. More...
 
class  ParamsSetClass
 Wrapper class for Params property Reimplements Borland TIBXSQLDA. More...
 
class  SQLClass
 Wrapper class for the SQL property. More...
 

Public Member Functions

 SQL (VIBSQL *pvsql=NULL)
 Construct a VIB::SQL object.
 
virtual ~SQL ()
 Destroy the VIB::SQL instance, and the VIBSQL instance which it wraps.
 
int Call (int ErrCode, bool RaiseError)
 Call is an internal method used to make calls to the InterBase API, and gives the option of throwing an exception or returning an error.
 
void CheckClosed ()
 Throws an exception if the query is not closed.
 
void CheckOpen ()
 Throws an exception if the query is not open.
 
void CheckValidStatement ()
 Throws an exception if the query does not have a valid statement.
 
void Close ()
 Closes the query.
 
void ExecQuery ()
 Executes an SQL query.
 
void FreeHandle ()
 Frees InterBase resources associated with the query.
 
void Prepare ()
 Prepares a query for execution.
 
int FieldIndex (const std::string &FieldName)
 Undocumented method.
 
std::string GetUniqueRelationName ()
 Undocumented method.
 

Public Attributes

Property< bool > Bof
 Indicates whether or not a query is at the beginning of the dataset.
 
Property< VIBDatabase * > Database
 Sets or returns the database associated with the query.
 
Property< void *** > DBHandle
 Specifies the database handle for the query.
 
Property< bool > Eof
 Indicates wehther or not a query is at the end of the dataset.
 
Property< bool > GenerateParamNames
 Generates a list of parameter names for the query.
 
Property< bool > GoToFirstRecordOnExecute
 Goes to the first record in the result set upon opening the query.
 
Property< void ** > Handle
 Specifies the handle for the query.
 
Property< bool > Open
 Determines if the dataset is open.
 
Property< bool > ParamCheck
 Specifies whether the parameter list for an SQL query is regenerated if the SQL property changes at runtime.
 
Property< ParamsSetClass * > Params
 Returns the XSQLDA parameters.
 
Property< std::string > Plan
 Returns the plan for the query, once it has been prepared.
 
Property< bool > Prepared
 Indicates whether or not the query has been prepared.
 
Property< int > RecordCount
 Returns the current count of records from the query.
 
Property< int > RowsAffected
 Returns the number of rows affected by the query.
 
Property< SQLClass * > _SQL
 Sets the SQL query to be executed.
 
Property< VIBSQLTypes > SQLType
 Returns the type of query to be executed.
 
Property< VIBTransaction * > Transaction
 Sets or returns the transaction to be used by the query.
 
Property< void *** > TRHandle
 Specifies the transaction handle for the query.
 
Property< std::string > UniqueRelationName
 Indicates the unique relation name for a query that involves only one base table.
 

Protected Attributes

VIBSQLvsql
 Pointer to the wrapped VIBSQL instance.
 
SQLClass sc
 Instance of SQLClass property wrapper object.
 
ParamsSetClass psc
 Instance of ParamsSet property wrapper object.
 

Friends

class SQLClass
 
class ParamClass
 

Detailed Description

VIB::SQL wraps the VisualIB VIBSQL C structure with a C++11 object with semantics compatible with those of Borland TIBSQL.

Constructor & Destructor Documentation

VIB::SQL::SQL ( VIBSQL pvsql = NULL)

Construct a VIB::SQL object.

Parameters
[in]pvsqlPointer to a VIBSQL instance of which the VIB::SQL instance should take ownership.

Member Function Documentation

int VIB::SQL::Call ( int  ErrCode,
bool  RaiseError 
)

Call is an internal method used to make calls to the InterBase API, and gives the option of throwing an exception or returning an error.

Parameters
[in]ErrCodeInterBase API error code?
[in]RaiseErrorIf true, throws an exception.
Returns
An error message based on the error code (???)
Note
Reimplements TIBSQL::Call
void VIB::SQL::CheckClosed ( )

Throws an exception if the query is not closed.

Note
Reimplements TIBSQL::CheckClosed
void VIB::SQL::CheckOpen ( )

Throws an exception if the query is not open.

Note
Reimplements TIBSQL::CheckOpen
void VIB::SQL::CheckValidStatement ( )

Throws an exception if the query does not have a valid statement.

Note
Reimplements TIBSQL::CheckValidStatement
void VIB::SQL::Close ( )

Closes the query.

Note
Reimplements TIBSQL::Close
void VIB::SQL::ExecQuery ( )

Executes an SQL query.

Note
Reimplements TIBSQL::ExecQuery
int VIB::SQL::FieldIndex ( const std::string &  FieldName)

Undocumented method.

Parameters
[in]FieldNameName of a field referenced by the query?
Returns
Index of the named field?
void VIB::SQL::FreeHandle ( )

Frees InterBase resources associated with the query.

Note
Reimplements TIBSQL::FreeHandle
std::string VIB::SQL::GetUniqueRelationName ( )

Undocumented method.

void VIB::SQL::Prepare ( )

Prepares a query for execution.

Note
Reimplements TIBSQL::Prepare

Member Data Documentation

Property<SQLClass *> VIB::SQL::_SQL

Sets the SQL query to be executed.

Note
Reimplements TIBSQL::SQL
API Difference - The name of this property is prefaced with an underscore not present in the TIBSQL class, due to the fact that a C++ class may not have a field with the same name as the class.
Property<bool> VIB::SQL::Bof

Indicates whether or not a query is at the beginning of the dataset.

Note
Read-only property.
Reimplements TIBSQL::Bof
Property<VIBDatabase *> VIB::SQL::Database

Sets or returns the database associated with the query.

Note
Reimplements TIBSQL::Database
API Difference - The value of the property is a VIBDatabase structure pointer. The corresponding TIBDatabase instance is hidden by the VisualIB C API abstraction.
Property<void ***> VIB::SQL::DBHandle

Specifies the database handle for the query.

Note
Reimplements TIBSQL::DBHandle
API Difference - the return value is equivalent to and could be cast to PISC_DB_HANDLE if the InterBase C API is visible in scope.
Property<bool> VIB::SQL::Eof

Indicates wehther or not a query is at the end of the dataset.

If this property is true immediately after the query is opened, then it means that the dataset is empty.

Note
Reimplements TIBSQL::Eof
Property<bool> VIB::SQL::GenerateParamNames

Generates a list of parameter names for the query.

Note
Reimplements TIBSQL::GenerateParamNames
Property<bool> VIB::SQL::GoToFirstRecordOnExecute

Goes to the first record in the result set upon opening the query.

True by default except when used internally by TIBDataSet.

Note
Reimplements TIBSQL::GoToFirstRecordOnExecute
Property<void **> VIB::SQL::Handle

Specifies the handle for the query.

Note
Reimplements TIBSQL::Handle
API Difference - void ** is equivalent to Ibexternals::PVoid
Property<bool> VIB::SQL::Open

Determines if the dataset is open.

Note
Read-only property.
Reimplements TIBSQL::Open
Property<bool> VIB::SQL::ParamCheck

Specifies whether the parameter list for an SQL query is regenerated if the SQL property changes at runtime.

This property is useful for DDL statements that contain parameters as part of the DDL statement and that are not parameters for the TIBSQL query.

Note
Reimplements TIBSQL::ParamCheck
Property<ParamsSetClass *> VIB::SQL::Params

Returns the XSQLDA parameters.

Note
Reimplements TIBSQL::Params
Property<std::string> VIB::SQL::Plan

Returns the plan for the query, once it has been prepared.

Note
Reimplements TIBSQL::Plan
Property<bool> VIB::SQL::Prepared

Indicates whether or not the query has been prepared.

Note
Read-only property.
Reimplements TIBSQL::Prepared
Property<int> VIB::SQL::RecordCount

Returns the current count of records from the query.

The value of this property changes as rows from the query are visited (it starts out 0 and increases for each row access).

Note
Reimplements TIBSQL::RecordCount
Property<int> VIB::SQL::RowsAffected

Returns the number of rows affected by the query.

This property is useful for INSERT, DELETE, and UPDATE statements.

Note
Reimplements TIBSQL::RowsAffected
Property<VIBSQLTypes> VIB::SQL::SQLType

Returns the type of query to be executed.

Note
Reimplements TIBSQL::SQLType
See Also
VIBSQLTypes
Property<VIBTransaction *> VIB::SQL::Transaction

Sets or returns the transaction to be used by the query.

Note
Reimplements TIBSQL::Transaction
API Difference - The value of the property is a pointer to an instance of VIBTransaction. The corresponding TIBTransaction object is hidden by the VisualIB C API abstraction.
Property<void ***> VIB::SQL::TRHandle

Specifies the transaction handle for the query.

Note
Reimplements TIBSQL::TRHandle
API Difference - The return value is equivalent to and could be cast to PISC_TR_HANDLE if the InterBase C API is visible in scope.
Property<std::string> VIB::SQL::UniqueRelationName

Indicates the unique relation name for a query that involves only one base table.

Note
Read-only property.
Reimplements TIBSQL::UniqueRelationName

The documentation for this class was generated from the following files: