ibpp_internals::StatementImpl Class Reference

#include <_ibpp.h>

Inheritance diagram for ibpp_internals::StatementImpl:

IBPP::IStatement

Detailed Description

Definition at line 1057 of file _ibpp.h.


Public Member Functions

IBPP::IStatementAddRef ()
int AffectedRows ()
void AttachDatabaseImpl (DatabaseImpl *)
void AttachTransactionImpl (TransactionImpl *)
void Close ()
const char * ColumnAlias (int)
const char * ColumnName (int)
int ColumnNum (const std::string &)
int ColumnNumAlias (const std::string &)
int Columns ()
int ColumnScale (int)
int ColumnSize (int)
int ColumnSubtype (int)
const char * ColumnTable (int)
IBPP::SDT ColumnType (int)
void CursorExecute (const std::string &cursor)
void CursorExecute (const std::string &cursor, const std::string &sql)
IBPP::Database DatabasePtr () const
void DetachDatabaseImpl ()
void DetachTransactionImpl ()
void Execute ()
void Execute (const std::string &sql)
void ExecuteImmediate (const std::string &)
bool Fetch (IBPP::Row &)
bool Fetch ()
bool Get (const std::string &, IBPP::Array &)
bool Get (const std::string &, IBPP::Blob &)
bool Get (const std::string &, IBPP::DBKey &)
bool Get (const std::string &, IBPP::Time &)
bool Get (const std::string &, IBPP::Date &)
bool Get (const std::string &, IBPP::Timestamp &)
bool Get (const std::string &, double &)
bool Get (const std::string &, double *)
bool Get (const std::string &, float &)
bool Get (const std::string &, float *)
bool Get (const std::string &, int64_t &)
bool Get (const std::string &, int64_t *)
bool Get (const std::string &, int32_t &)
bool Get (const std::string &, int32_t *)
bool Get (const std::string &, int16_t &)
bool Get (const std::string &, int16_t *)
bool Get (const std::string &, std::string &)
bool Get (const std::string &, void *, int &)
bool Get (const std::string &, char *)
bool Get (const std::string &, bool &)
bool Get (const std::string &, bool *)
bool Get (int, IBPP::Array &)
bool Get (int, IBPP::Blob &)
bool Get (int, IBPP::DBKey &)
bool Get (int, IBPP::Time &)
bool Get (int, IBPP::Date &)
bool Get (int, IBPP::Timestamp &)
bool Get (int, double &)
bool Get (int, double *)
bool Get (int, float &)
bool Get (int, float *)
bool Get (int, int64_t &)
bool Get (int, int64_t *)
bool Get (int, int32_t &)
bool Get (int, int32_t *)
bool Get (int, int16_t &)
bool Get (int, int16_t *)
bool Get (int, std::string &)
bool Get (int, void *, int &)
bool Get (int, char *)
bool Get (int, bool &)
bool Get (int, bool *)
isc_stmt_handle GetHandle ()
bool IsNull (const std::string &)
bool IsNull (int)
int Parameters ()
int ParameterScale (int)
int ParameterSize (int)
int ParameterSubtype (int)
IBPP::SDT ParameterType (int)
void Plan (std::string &)
void Prepare (const std::string &sql)
void Release ()
void Set (int, const IBPP::Array &)
void Set (int, const IBPP::Blob &)
void Set (int, const IBPP::DBKey &)
void Set (int, const IBPP::Time &)
void Set (int, const IBPP::Date &)
void Set (int, const IBPP::Timestamp &)
void Set (int, double)
void Set (int, float)
void Set (int, int64_t)
void Set (int, int32_t)
void Set (int, int16_t)
void Set (int, const std::string &)
void Set (int, const void *, int)
void Set (int, const char *)
void Set (int, bool)
void SetNull (int)
std::stringSql ()
 StatementImpl (DatabaseImpl *, TransactionImpl *, const std::string &)
IBPP::Transaction TransactionPtr () const
IBPP::STT Type ()
 ~StatementImpl ()

Private Member Functions

void CursorFree ()

Private Attributes

bool mCursorOpened
DatabaseImplmDatabase
isc_stmt_handle mHandle
RowImplmInRow
RowImplmOutRow
int mRefCount
bool mResultSetAvailable
std::string mSql
TransactionImplmTransaction
IBPP::STT mType

Friends

class TransactionImpl

Constructor & Destructor Documentation

StatementImpl::StatementImpl ( DatabaseImpl database,
TransactionImpl transaction,
const std::string sql 
)

Definition at line 1282 of file statement.cpp.

References AttachDatabaseImpl(), AttachTransactionImpl(), and Prepare().

01284         : mRefCount(0), mHandle(0), mDatabase(0), mTransaction(0),
01285         mInRow(0), mOutRow(0),
01286         mResultSetAvailable(false), mCursorOpened(false), mType(IBPP::stUnknown)
01287 {
01288         AttachDatabaseImpl(database);
01289         if (transaction != 0) AttachTransactionImpl(transaction);
01290         if (! sql.empty()) Prepare(sql);
01291 }

StatementImpl::~StatementImpl (  ) 

Definition at line 1293 of file statement.cpp.

References Close(), ibpp_internals::DatabaseImpl::DetachStatementImpl(), ibpp_internals::TransactionImpl::DetachStatementImpl(), mDatabase, and mTransaction.

01294 {
01295         try { Close(); }
01296                 catch (...) { }
01297         try { if (mTransaction != 0) mTransaction->DetachStatementImpl(this); }
01298                 catch (...) { }
01299         try { if (mDatabase != 0) mDatabase->DetachStatementImpl(this); }
01300                 catch (...) { }
01301 }


Member Function Documentation

IBPP::IStatement * StatementImpl::AddRef (  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1207 of file statement.cpp.

References ASSERTION, and mRefCount.

01208 {
01209         ASSERTION(mRefCount >= 0);
01210         ++mRefCount;
01211 
01212         return this;
01213 }

int StatementImpl::AffectedRows (  )  [virtual]

Implements IBPP::IStatement.

Definition at line 384 of file statement.cpp.

References _, ibpp_internals::GDS::Call(), ibpp_internals::IBS::Errors(), ibpp_internals::gds, ibpp_internals::DatabaseImpl::GetHandle(), ibpp_internals::RB::GetValue(), isc_info_req_delete_count, isc_info_req_insert_count, isc_info_req_select_count, isc_info_req_update_count, isc_info_sql_records, ibpp_internals::GDS::m_dsql_sql_info, mDatabase, mHandle, mType, ibpp_internals::RB::Self(), ibpp_internals::IBS::Self(), ibpp_internals::RB::Size(), IBPP::stDelete, IBPP::stInsert, IBPP::stSelect, and IBPP::stUpdate.

00385 {
00386         if (mHandle == 0)
00387                 throw LogicExceptionImpl("Statement::AffectedRows", _("No statement has been prepared."));
00388         if (mDatabase == 0)
00389                 throw LogicExceptionImpl("Statement::AffectedRows", _("A Database must be attached."));
00390         if (mDatabase->GetHandle() == 0)
00391                 throw LogicExceptionImpl("Statement::AffectedRows", _("Database must be connected."));
00392 
00393         int count;
00394         IBS status;
00395         RB result;
00396         char itemsReq[] = {isc_info_sql_records};
00397 
00398         (*gds.Call()->m_dsql_sql_info)(status.Self(), &mHandle, 1, itemsReq,
00399                 result.Size(), result.Self());
00400         if (status.Errors()) throw SQLExceptionImpl(status,
00401                         "Statement::AffectedRows", _("isc_dsql_sql_info failed."));
00402 
00403         if (mType == IBPP::stInsert)
00404                         count = result.GetValue(isc_info_sql_records, isc_info_req_insert_count);
00405         else if (mType == IBPP::stUpdate)
00406                         count = result.GetValue(isc_info_sql_records, isc_info_req_update_count);
00407         else if (mType == IBPP::stDelete)
00408                         count = result.GetValue(isc_info_sql_records, isc_info_req_delete_count);
00409         else if (mType == IBPP::stSelect)
00410                         count = result.GetValue(isc_info_sql_records, isc_info_req_select_count);
00411         else    count = 0;      // Returns zero count for unknown cases
00412 
00413         return count;
00414 }

void StatementImpl::AttachDatabaseImpl ( DatabaseImpl database  ) 

Definition at line 1226 of file statement.cpp.

References _, ibpp_internals::DatabaseImpl::AttachStatementImpl(), ibpp_internals::DatabaseImpl::DetachStatementImpl(), and mDatabase.

Referenced by StatementImpl().

01227 {
01228         if (database == 0)
01229                 throw LogicExceptionImpl("Statement::AttachDatabase",
01230                         _("Can't attach a 0 IDatabase object."));
01231 
01232         if (mDatabase != 0) mDatabase->DetachStatementImpl(this);
01233         mDatabase = database;
01234         mDatabase->AttachStatementImpl(this);
01235 }

void StatementImpl::AttachTransactionImpl ( TransactionImpl transaction  ) 

Definition at line 1246 of file statement.cpp.

References _, ibpp_internals::TransactionImpl::AttachStatementImpl(), ibpp_internals::TransactionImpl::DetachStatementImpl(), and mTransaction.

Referenced by StatementImpl().

01247 {
01248         if (transaction == 0)
01249                 throw LogicExceptionImpl("Statement::AttachTransaction",
01250                         _("Can't attach a 0 ITransaction object."));
01251 
01252         if (mTransaction != 0) mTransaction->DetachStatementImpl(this);
01253         mTransaction = transaction;
01254         mTransaction->AttachStatementImpl(this);
01255 }

void StatementImpl::Close (  )  [virtual]

Implements IBPP::IStatement.

Definition at line 476 of file statement.cpp.

References _, ibpp_internals::GDS::Call(), DSQL_drop, ibpp_internals::IBS::Errors(), ibpp_internals::gds, ibpp_internals::GDS::m_dsql_free_statement, mCursorOpened, mHandle, mInRow, mOutRow, mResultSetAvailable, mType, ibpp_internals::RowImpl::Release(), ibpp_internals::IBS::Self(), and IBPP::stUnknown.

Referenced by DetachDatabaseImpl(), DetachTransactionImpl(), ExecuteImmediate(), Fetch(), Prepare(), and ~StatementImpl().

00477 {
00478         // Free all statement resources.
00479         // Used before preparing a new statement or from destructor.
00480 
00481         if (mInRow != 0) { mInRow->Release(); mInRow = 0; }
00482         if (mOutRow != 0) { mOutRow->Release(); mOutRow = 0; }
00483 
00484         mResultSetAvailable = false;
00485         mCursorOpened = false;
00486         mType = IBPP::stUnknown;
00487 
00488         if (mHandle != 0)
00489         {
00490                 IBS status;
00491                 (*gds.Call()->m_dsql_free_statement)(status.Self(), &mHandle, DSQL_drop);
00492                 mHandle = 0;
00493                 if (status.Errors())
00494                         throw SQLExceptionImpl(status, "Statement::Close(DSQL_drop)",
00495                                 _("isc_dsql_free_statement failed."));
00496         }
00497 }

const char * StatementImpl::ColumnAlias ( int  varnum  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1091 of file statement.cpp.

References _, ibpp_internals::RowImpl::ColumnAlias(), and mOutRow.

01092 {
01093         if (mOutRow == 0)
01094                 throw LogicExceptionImpl("Statement::Columns", _("The row is not initialized."));
01095 
01096         return mOutRow->ColumnAlias(varnum);
01097 }

const char * StatementImpl::ColumnName ( int  varnum  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1083 of file statement.cpp.

References _, ibpp_internals::RowImpl::ColumnName(), and mOutRow.

01084 {
01085         if (mOutRow == 0)
01086                 throw LogicExceptionImpl("Statement::Columns", _("The row is not initialized."));
01087 
01088         return mOutRow->ColumnName(varnum);
01089 }

int StatementImpl::ColumnNum ( const std::string name  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1075 of file statement.cpp.

References _, ibpp_internals::RowImpl::ColumnNum(), and mOutRow.

01076 {
01077         if (mOutRow == 0)
01078                 throw LogicExceptionImpl("Statement::ColumnNum", _("The row is not initialized."));
01079 
01080         return mOutRow->ColumnNum(name);
01081 }

int ibpp_internals::StatementImpl::ColumnNumAlias ( const std::string  ) 

int StatementImpl::Columns (  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1067 of file statement.cpp.

References _, ibpp_internals::RowImpl::Columns(), and mOutRow.

01068 {
01069         if (mOutRow == 0)
01070                 throw LogicExceptionImpl("Statement::Columns", _("The row is not initialized."));
01071 
01072         return mOutRow->Columns();
01073 }

int StatementImpl::ColumnScale ( int  varnum  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1137 of file statement.cpp.

References _, ibpp_internals::RowImpl::ColumnScale(), mHandle, and mOutRow.

01138 {
01139         if (mHandle == 0)
01140                 throw LogicExceptionImpl("Statement::ColumnScale", _("No statement has been prepared."));
01141         if (mOutRow == 0)
01142                 throw LogicExceptionImpl("Statement::ColumnScale", _("The row is not initialized."));
01143 
01144         return mOutRow->ColumnScale(varnum);
01145 }

int StatementImpl::ColumnSize ( int  varnum  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1127 of file statement.cpp.

References _, ibpp_internals::RowImpl::ColumnSize(), mHandle, and mOutRow.

01128 {
01129         if (mHandle == 0)
01130                 throw LogicExceptionImpl("Statement::ColumnSize", _("No statement has been prepared."));
01131         if (mOutRow == 0)
01132                 throw LogicExceptionImpl("Statement::ColumnSize", _("The row is not initialized."));
01133 
01134         return mOutRow->ColumnSize(varnum);
01135 }

int StatementImpl::ColumnSubtype ( int  varnum  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1117 of file statement.cpp.

References _, ibpp_internals::RowImpl::ColumnSubtype(), mHandle, and mOutRow.

01118 {
01119         if (mHandle == 0)
01120                 throw LogicExceptionImpl("Statement::ColumnSubtype", _("No statement has been prepared."));
01121         if (mOutRow == 0)
01122                 throw LogicExceptionImpl("Statement::ColumnSubtype", _("The statement does not return results."));
01123 
01124     return mOutRow->ColumnSubtype(varnum);
01125 }

const char * StatementImpl::ColumnTable ( int  varnum  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1099 of file statement.cpp.

References _, ibpp_internals::RowImpl::ColumnTable(), and mOutRow.

01100 {
01101         if (mOutRow == 0)
01102                 throw LogicExceptionImpl("Statement::Columns", _("The row is not initialized."));
01103 
01104         return mOutRow->ColumnTable(varnum);
01105 }

IBPP::SDT StatementImpl::ColumnType ( int  varnum  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1107 of file statement.cpp.

References _, ibpp_internals::RowImpl::ColumnType(), mHandle, and mOutRow.

01108 {
01109         if (mHandle == 0)
01110                 throw LogicExceptionImpl("Statement::ColumnType", _("No statement has been prepared."));
01111         if (mOutRow == 0)
01112                 throw LogicExceptionImpl("Statement::ColumnType", _("The statement does not return results."));
01113 
01114     return mOutRow->ColumnType(varnum);
01115 }

void ibpp_internals::StatementImpl::CursorExecute ( const std::string cursor  )  [inline, virtual]

Implements IBPP::IStatement.

Definition at line 1100 of file _ibpp.h.

01100 { CursorExecute(cursor, std::string()); }

void StatementImpl::CursorExecute ( const std::string cursor,
const std::string sql 
) [virtual]

Implements IBPP::IStatement.

Definition at line 311 of file statement.cpp.

References _, ibpp_internals::GDS::Call(), CursorFree(), ibpp_internals::IBS::Errors(), ibpp_internals::gds, ibpp_internals::TransactionImpl::GetHandlePtr(), ibpp_internals::GDS::m_dsql_execute, ibpp_internals::GDS::m_dsql_set_cursor_name, mCursorOpened, mHandle, mInRow, ibpp_internals::RowImpl::MissingValues(), mOutRow, mResultSetAvailable, mSql, mTransaction, mType, Prepare(), ibpp_internals::IBS::Reset(), ibpp_internals::RowImpl::Self(), ibpp_internals::IBS::Self(), and IBPP::stSelectUpdate.

00312 {
00313         if (cursor.empty())
00314                 throw LogicExceptionImpl("Statement::CursorExecute", _("Cursor name can't be 0."));
00315 
00316         if (! sql.empty()) Prepare(sql);
00317 
00318         if (mHandle == 0)
00319                 throw LogicExceptionImpl("Statement::CursorExecute", _("No statement has been prepared."));
00320         if (mType != IBPP::stSelectUpdate)
00321                 throw LogicExceptionImpl("Statement::CursorExecute", _("Statement must be a SELECT FOR UPDATE."));
00322         if (mOutRow == 0)
00323                 throw LogicExceptionImpl("Statement::CursorExecute", _("Statement would return no rows."));
00324 
00325         // Check that a value has been set for each input parameter
00326         if (mInRow != 0 && mInRow->MissingValues())
00327                 throw LogicExceptionImpl("Statement::CursorExecute",
00328                         _("All parameters must be specified."));
00329 
00330         CursorFree();   // Free a previous 'cursor' if any
00331 
00332         IBS status;
00333         (*gds.Call()->m_dsql_execute)(status.Self(), mTransaction->GetHandlePtr(),
00334                 &mHandle, 1, mInRow == 0 ? 0 : mInRow->Self());
00335         if (status.Errors())
00336         {
00337                 //Close();      Commented because Execute error should not free the statement
00338                 std::string context = "Statement::CursorExecute( ";
00339                 context.append(mSql).append(" )");
00340                 throw SQLExceptionImpl(status, context.c_str(),
00341                         _("isc_dsql_execute failed"));
00342         }
00343 
00344         status.Reset();
00345         (*gds.Call()->m_dsql_set_cursor_name)(status.Self(), &mHandle, const_cast<char*>(cursor.c_str()), 0);
00346         if (status.Errors())
00347         {
00348                 //Close();      Commented because Execute error should not free the statement
00349                 throw SQLExceptionImpl(status, "Statement::CursorExecute",
00350                         _("isc_dsql_set_cursor_name failed"));
00351         }
00352 
00353         mResultSetAvailable = true;
00354         mCursorOpened = true;
00355 }

void StatementImpl::CursorFree (  )  [private]

Definition at line 1266 of file statement.cpp.

References _, ibpp_internals::GDS::Call(), DSQL_close, ibpp_internals::IBS::Errors(), ibpp_internals::gds, ibpp_internals::GDS::m_dsql_free_statement, mCursorOpened, mHandle, and ibpp_internals::IBS::Self().

Referenced by CursorExecute(), Execute(), and Fetch().

01267 {
01268         if (mCursorOpened)
01269         {
01270                 mCursorOpened = false;
01271                 if (mHandle != 0)
01272                 {
01273                         IBS status;
01274                         (*gds.Call()->m_dsql_free_statement)(status.Self(), &mHandle, DSQL_close);
01275                         if (status.Errors())
01276                                 throw SQLExceptionImpl(status, "StatementImpl::CursorFree(DSQL_close)",
01277                                         _("isc_dsql_free_statement failed."));
01278                 }
01279         }
01280 }

IBPP::Database StatementImpl::DatabasePtr (  )  const [virtual]

Implements IBPP::IStatement.

Definition at line 1197 of file statement.cpp.

References mDatabase.

01198 {
01199         return mDatabase;
01200 }

void StatementImpl::DetachDatabaseImpl (  ) 

Definition at line 1237 of file statement.cpp.

References Close(), ibpp_internals::DatabaseImpl::DetachStatementImpl(), and mDatabase.

01238 {
01239         if (mDatabase == 0) return;
01240 
01241         Close();
01242         mDatabase->DetachStatementImpl(this);
01243         mDatabase = 0;
01244 }

void StatementImpl::DetachTransactionImpl (  ) 

Definition at line 1257 of file statement.cpp.

References Close(), ibpp_internals::TransactionImpl::DetachStatementImpl(), and mTransaction.

01258 {
01259         if (mTransaction == 0) return;
01260 
01261         Close();
01262         mTransaction->DetachStatementImpl(this);
01263         mTransaction = 0;
01264 }

void ibpp_internals::StatementImpl::Execute (  )  [inline, virtual]

Implements IBPP::IStatement.

Definition at line 1097 of file _ibpp.h.

01097 { Execute(std::string()); }

void StatementImpl::Execute ( const std::string sql  )  [virtual]

Implements IBPP::IStatement.

Definition at line 259 of file statement.cpp.

References _, ibpp_internals::GDS::Call(), CursorFree(), ibpp_internals::IBS::Errors(), ibpp_internals::gds, ibpp_internals::TransactionImpl::GetHandlePtr(), ibpp_internals::GDS::m_dsql_execute, ibpp_internals::GDS::m_dsql_execute2, mCursorOpened, mHandle, mInRow, ibpp_internals::RowImpl::MissingValues(), mOutRow, mResultSetAvailable, mSql, mTransaction, mType, Prepare(), ibpp_internals::RowImpl::Self(), ibpp_internals::IBS::Self(), and IBPP::stSelect.

00260 {
00261         if (! sql.empty()) Prepare(sql);
00262 
00263         if (mHandle == 0)
00264                 throw LogicExceptionImpl("Statement::Execute",
00265                         _("No statement has been prepared."));
00266 
00267         // Check that a value has been set for each input parameter
00268         if (mInRow != 0 && mInRow->MissingValues())
00269                 throw LogicExceptionImpl("Statement::Execute",
00270                         _("All parameters must be specified."));
00271 
00272         CursorFree();   // Free a previous 'cursor' if any
00273 
00274         IBS status;
00275         if (mType == IBPP::stSelect)
00276         {
00277                 // Could return a result set (none, single or multi rows)
00278                 (*gds.Call()->m_dsql_execute)(status.Self(), mTransaction->GetHandlePtr(),
00279                         &mHandle, 1, mInRow == 0 ? 0 : mInRow->Self());
00280                 if (status.Errors())
00281                 {
00282                         //Close();      Commented because Execute error should not free the statement
00283                         std::string context = "Statement::Execute( ";
00284                         context.append(mSql).append(" )");
00285                         throw SQLExceptionImpl(status, context.c_str(),
00286                                 _("isc_dsql_execute failed"));
00287                 }
00288                 if (mOutRow != 0)
00289                 {
00290                         mResultSetAvailable = true;
00291                         mCursorOpened = true;
00292                 }
00293         }
00294         else
00295         {
00296                 // Should return at most a single row
00297                 (*gds.Call()->m_dsql_execute2)(status.Self(), mTransaction->GetHandlePtr(),
00298                         &mHandle, 1, mInRow == 0 ? 0 : mInRow->Self(),
00299                         mOutRow == 0 ? 0 : mOutRow->Self());
00300                 if (status.Errors())
00301                 {
00302                         //Close();      Commented because Execute error should not free the statement
00303                         std::string context = "Statement::Execute( ";
00304                         context.append(mSql).append(" )");
00305                         throw SQLExceptionImpl(status, context.c_str(),
00306                                 _("isc_dsql_execute2 failed"));
00307                 }
00308         }
00309 }

void StatementImpl::ExecuteImmediate ( const std::string sql  )  [virtual]

Implements IBPP::IStatement.

Definition at line 357 of file statement.cpp.

References _, ibpp_internals::GDS::Call(), Close(), ibpp_internals::DatabaseImpl::Dialect(), ibpp_internals::IBS::Errors(), ibpp_internals::gds, ibpp_internals::TransactionImpl::GetHandle(), ibpp_internals::DatabaseImpl::GetHandle(), ibpp_internals::TransactionImpl::GetHandlePtr(), ibpp_internals::DatabaseImpl::GetHandlePtr(), ibpp_internals::GDS::m_dsql_execute_immediate, mDatabase, mTransaction, and ibpp_internals::IBS::Self().

00358 {
00359         if (mDatabase == 0)
00360                 throw LogicExceptionImpl("Statement::ExecuteImmediate", _("An IDatabase must be attached."));
00361         if (mDatabase->GetHandle() == 0)
00362                 throw LogicExceptionImpl("Statement::ExecuteImmediate", _("IDatabase must be connected."));
00363         if (mTransaction == 0)
00364                 throw LogicExceptionImpl("Statement::ExecuteImmediate", _("An ITransaction must be attached."));
00365         if (mTransaction->GetHandle() == 0)
00366                 throw LogicExceptionImpl("Statement::ExecuteImmediate", _("ITransaction must be started."));
00367         if (sql.empty())
00368                 throw LogicExceptionImpl("Statement::ExecuteImmediate", _("SQL statement can't be 0."));
00369 
00370         IBS status;
00371         Close();
00372     (*gds.Call()->m_dsql_execute_immediate)(status.Self(), mDatabase->GetHandlePtr(),
00373         mTransaction->GetHandlePtr(), 0, const_cast<char*>(sql.c_str()),
00374                 short(mDatabase->Dialect()), 0);
00375     if (status.Errors())
00376         {
00377                 std::string context = "Statement::ExecuteImmediate( ";
00378                 context.append(sql).append(" )");
00379                 throw SQLExceptionImpl(status, context.c_str(),
00380                         _("isc_dsql_execute_immediate failed"));
00381         }
00382 }

bool StatementImpl::Fetch ( IBPP::Row row  )  [virtual]

Implements IBPP::IStatement.

Definition at line 443 of file statement.cpp.

References _, ibpp_internals::GDS::Call(), IBPP::Ptr< T >::clear(), Close(), CursorFree(), ibpp_internals::IBS::Errors(), ibpp_internals::gds, ibpp_internals::GDS::m_dsql_fetch, mCursorOpened, mHandle, mOutRow, mResultSetAvailable, ibpp_internals::RowImpl::Self(), and ibpp_internals::IBS::Self().

00444 {
00445         if (! mResultSetAvailable)
00446                 throw LogicExceptionImpl("Statement::Fetch(row)",
00447                         _("No statement has been executed or no result set available."));
00448 
00449         RowImpl* rowimpl = new RowImpl(*mOutRow);
00450         row = rowimpl;
00451 
00452         IBS status;
00453         int code = (*gds.Call()->m_dsql_fetch)(status.Self(), &mHandle, 1,
00454                                         rowimpl->Self());
00455         if (code == 100)        // This special code means "no more rows"
00456         {
00457                 mResultSetAvailable = false;
00458                 // Oddly enough, fetching rows up to the last one seems to open
00459                 // an 'implicit' cursor that needs to be closed.
00460                 mCursorOpened = true;
00461                 CursorFree();   // Free the explicit or implicit cursor/result-set
00462                 row.clear();
00463                 return false;
00464         }
00465         if (status.Errors())
00466         {
00467                 Close();
00468                 row.clear();
00469                 throw SQLExceptionImpl(status, "Statement::Fetch(row)",
00470                         _("isc_dsql_fetch failed."));
00471         }
00472 
00473         return true;
00474 }

bool StatementImpl::Fetch (  )  [virtual]

Implements IBPP::IStatement.

Definition at line 416 of file statement.cpp.

References _, ibpp_internals::GDS::Call(), Close(), CursorFree(), ibpp_internals::IBS::Errors(), ibpp_internals::gds, ibpp_internals::GDS::m_dsql_fetch, mCursorOpened, mHandle, mOutRow, mResultSetAvailable, ibpp_internals::RowImpl::Self(), and ibpp_internals::IBS::Self().

00417 {
00418         if (! mResultSetAvailable)
00419                 throw LogicExceptionImpl("Statement::Fetch",
00420                         _("No statement has been executed or no result set available."));
00421 
00422         IBS status;
00423         int code = (*gds.Call()->m_dsql_fetch)(status.Self(), &mHandle, 1, mOutRow->Self());
00424         if (code == 100)        // This special code means "no more rows"
00425         {
00426                 mResultSetAvailable = false;
00427                 // Oddly enough, fetching rows up to the last one seems to open
00428                 // an 'implicit' cursor that needs to be closed.
00429                 mCursorOpened = true;
00430                 CursorFree();   // Free the explicit or implicit cursor/result-set
00431                 return false;
00432         }
00433         if (status.Errors())
00434         {
00435                 Close();
00436                 throw SQLExceptionImpl(status, "Statement::Fetch",
00437                         _("isc_dsql_fetch failed."));
00438         }
00439 
00440         return true;
00441 }

bool ibpp_internals::StatementImpl::Get ( const std::string ,
IBPP::Array  
) [virtual]

Implements IBPP::IStatement.

bool StatementImpl::Get ( const std::string name,
IBPP::Blob retblob 
) [virtual]

Implements IBPP::IStatement.

Definition at line 1033 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

01034 {
01035         if (mOutRow == 0)
01036                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
01037 
01038         return mOutRow->Get(name, retblob);
01039 }

bool StatementImpl::Get ( const std::string name,
IBPP::DBKey retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 1041 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

01042 {
01043         if (mOutRow == 0)
01044                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
01045 
01046         return mOutRow->Get(name, retvalue);
01047 }

bool StatementImpl::Get ( const std::string name,
IBPP::Time retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 1025 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

01026 {
01027         if (mOutRow == 0)
01028                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
01029 
01030         return mOutRow->Get(name, retvalue);
01031 }

bool StatementImpl::Get ( const std::string name,
IBPP::Date retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 1017 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

01018 {
01019         if (mOutRow == 0)
01020                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
01021 
01022         return mOutRow->Get(name, retvalue);
01023 }

bool StatementImpl::Get ( const std::string name,
IBPP::Timestamp retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 1009 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

01010 {
01011         if (mOutRow == 0)
01012                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
01013 
01014         return mOutRow->Get(name, retvalue);
01015 }

bool StatementImpl::Get ( const std::string name,
double &  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 1001 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

01002 {
01003         if (mOutRow == 0)
01004                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
01005 
01006         return mOutRow->Get(name, retvalue);
01007 }

bool StatementImpl::Get ( const std::string name,
double *  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 991 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00992 {
00993         if (mOutRow == 0)
00994                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00995         if (retvalue == 0)
00996                 throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
00997 
00998         return mOutRow->Get(name, *retvalue);
00999 }

bool StatementImpl::Get ( const std::string name,
float &  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 983 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00984 {
00985         if (mOutRow == 0)
00986                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00987 
00988         return mOutRow->Get(name, retvalue);
00989 }

bool StatementImpl::Get ( const std::string name,
float *  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 973 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00974 {
00975         if (mOutRow == 0)
00976                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00977         if (retvalue == 0)
00978                 throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
00979 
00980         return mOutRow->Get(name, *retvalue);
00981 }

bool StatementImpl::Get ( const std::string name,
int64_t &  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 965 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00966 {
00967         if (mOutRow == 0)
00968                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00969 
00970         return mOutRow->Get(name, retvalue);
00971 }

bool StatementImpl::Get ( const std::string name,
int64_t *  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 955 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00956 {
00957         if (mOutRow == 0)
00958                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00959         if (retvalue == 0)
00960                 throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
00961 
00962         return mOutRow->Get(name, *retvalue);
00963 }

bool StatementImpl::Get ( const std::string name,
int32_t &  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 947 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00948 {
00949         if (mOutRow == 0)
00950                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00951 
00952         return mOutRow->Get(name, retvalue);
00953 }

bool StatementImpl::Get ( const std::string name,
int32_t *  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 937 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00938 {
00939         if (mOutRow == 0)
00940                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00941         if (retvalue == 0)
00942                 throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
00943 
00944         return mOutRow->Get(name, *retvalue);
00945 }

bool StatementImpl::Get ( const std::string name,
int16_t &  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 929 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00930 {
00931         if (mOutRow == 0)
00932                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00933 
00934         return mOutRow->Get(name, retvalue);
00935 }

bool StatementImpl::Get ( const std::string name,
int16_t *  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 919 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00920 {
00921         if (mOutRow == 0)
00922                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00923         if (retvalue == 0)
00924                 throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
00925 
00926         return mOutRow->Get(name, *retvalue);
00927 }

bool StatementImpl::Get ( const std::string name,
std::string retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 911 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00912 {
00913         if (mOutRow == 0)
00914                 throw LogicExceptionImpl("Statement::GetString", _("The row is not initialized."));
00915 
00916         return mOutRow->Get(name, retvalue);
00917 }

bool StatementImpl::Get ( const std::string name,
void *  retvalue,
int &  count 
) [virtual]

Implements IBPP::IStatement.

Definition at line 903 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00904 {
00905         if (mOutRow == 0)
00906                 throw LogicExceptionImpl("Statement::Get[void*,int]", _("The row is not initialized."));
00907 
00908         return mOutRow->Get(name, retvalue, count);
00909 }

bool StatementImpl::Get ( const std::string name,
char *  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 895 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00896 {
00897         if (mOutRow == 0)
00898                 throw LogicExceptionImpl("Statement::Get[char*]", _("The row is not initialized."));
00899 
00900         return mOutRow->Get(name, retvalue);
00901 }

bool StatementImpl::Get ( const std::string name,
bool retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 887 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00888 {
00889         if (mOutRow == 0)
00890                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00891 
00892         return mOutRow->Get(name, retvalue);
00893 }

bool StatementImpl::Get ( const std::string name,
bool retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 877 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00878 {
00879         if (mOutRow == 0)
00880                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00881         if (retvalue == 0)
00882                 throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
00883 
00884         return mOutRow->Get(name, *retvalue);
00885 }

bool ibpp_internals::StatementImpl::Get ( int  ,
IBPP::Array  
) [virtual]

Implements IBPP::IStatement.

bool StatementImpl::Get ( int  column,
IBPP::Blob blob 
) [virtual]

Implements IBPP::IStatement.

Definition at line 835 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00836 {
00837         if (mOutRow == 0)
00838                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00839 
00840         return mOutRow->Get(column, blob);
00841 }

bool StatementImpl::Get ( int  column,
IBPP::DBKey key 
) [virtual]

Implements IBPP::IStatement.

Definition at line 843 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00844 {
00845         if (mOutRow == 0)
00846                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00847 
00848         return mOutRow->Get(column, key);
00849 }

bool StatementImpl::Get ( int  column,
IBPP::Time time 
) [virtual]

Implements IBPP::IStatement.

Definition at line 827 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00828 {
00829         if (mOutRow == 0)
00830                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00831 
00832         return mOutRow->Get(column, time);
00833 }

bool StatementImpl::Get ( int  column,
IBPP::Date date 
) [virtual]

Implements IBPP::IStatement.

Definition at line 819 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00820 {
00821         if (mOutRow == 0)
00822                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00823 
00824         return mOutRow->Get(column, date);
00825 }

bool StatementImpl::Get ( int  column,
IBPP::Timestamp timestamp 
) [virtual]

Implements IBPP::IStatement.

Definition at line 811 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00812 {
00813         if (mOutRow == 0)
00814                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00815 
00816         return mOutRow->Get(column, timestamp);
00817 }

bool StatementImpl::Get ( int  column,
double &  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 803 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00804 {
00805         if (mOutRow == 0)
00806                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00807 
00808         return mOutRow->Get(column, retvalue);
00809 }

bool StatementImpl::Get ( int  column,
double *  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 793 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00794 {
00795         if (mOutRow == 0)
00796                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00797         if (retvalue == 0)
00798                 throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
00799 
00800         return mOutRow->Get(column, *retvalue);
00801 }

bool StatementImpl::Get ( int  column,
float &  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 785 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00786 {
00787         if (mOutRow == 0)
00788                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00789 
00790         return mOutRow->Get(column, retvalue);
00791 }

bool StatementImpl::Get ( int  column,
float *  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 775 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00776 {
00777         if (mOutRow == 0)
00778                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00779         if (retvalue == 0)
00780                 throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
00781 
00782         return mOutRow->Get(column, *retvalue);
00783 }

bool StatementImpl::Get ( int  column,
int64_t &  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 767 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00768 {
00769         if (mOutRow == 0)
00770                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00771 
00772         return mOutRow->Get(column, retvalue);
00773 }

bool StatementImpl::Get ( int  column,
int64_t *  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 757 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00758 {
00759         if (mOutRow == 0)
00760                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00761         if (retvalue == 0)
00762                 throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
00763 
00764         return mOutRow->Get(column, *retvalue);
00765 }

bool StatementImpl::Get ( int  column,
int32_t &  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 749 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00750 {
00751         if (mOutRow == 0)
00752                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00753 
00754         return mOutRow->Get(column, retvalue);
00755 }

bool StatementImpl::Get ( int  column,
int32_t *  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 739 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00740 {
00741         if (mOutRow == 0)
00742                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00743         if (retvalue == 0)
00744                 throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
00745 
00746         return mOutRow->Get(column, *retvalue);
00747 }

bool StatementImpl::Get ( int  column,
int16_t &  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 731 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00732 {
00733         if (mOutRow == 0)
00734                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00735 
00736         return mOutRow->Get(column, retvalue);
00737 }

bool StatementImpl::Get ( int  column,
int16_t *  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 721 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00722 {
00723         if (mOutRow == 0)
00724                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00725         if (retvalue == 0)
00726                 throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
00727 
00728         return mOutRow->Get(column, *retvalue);
00729 }

bool StatementImpl::Get ( int  column,
std::string retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 713 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00714 {
00715         if (mOutRow == 0)
00716                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00717 
00718         return mOutRow->Get(column, retvalue);
00719 }

bool StatementImpl::Get ( int  column,
void *  bindata,
int &  userlen 
) [virtual]

Implements IBPP::IStatement.

Definition at line 705 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00706 {
00707         if (mOutRow == 0)
00708                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00709 
00710         return mOutRow->Get(column, bindata, userlen);
00711 }

bool StatementImpl::Get ( int  column,
char *  retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 697 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00698 {
00699         if (mOutRow == 0)
00700                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00701 
00702         return mOutRow->Get(column, retvalue);
00703 }

bool StatementImpl::Get ( int  column,
bool retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 689 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00690 {
00691         if (mOutRow == 0)
00692                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00693 
00694         return mOutRow->Get(column, retvalue);
00695 }

bool StatementImpl::Get ( int  column,
bool retvalue 
) [virtual]

Implements IBPP::IStatement.

Definition at line 679 of file statement.cpp.

References _, ibpp_internals::RowImpl::Get(), and mOutRow.

00680 {
00681         if (mOutRow == 0)
00682                 throw LogicExceptionImpl("Statement::Get", _("The row is not initialized."));
00683         if (retvalue == 0)
00684                 throw LogicExceptionImpl("Statement::Get", _("Null pointer detected"));
00685 
00686         return mOutRow->Get(column, *retvalue);
00687 }

isc_stmt_handle ibpp_internals::StatementImpl::GetHandle (  )  [inline]

Definition at line 1082 of file _ibpp.h.

01082 { return mHandle; }

bool StatementImpl::IsNull ( const std::string name  )  [virtual]

Implements IBPP::IStatement.

Definition at line 869 of file statement.cpp.

References _, ibpp_internals::RowImpl::IsNull(), and mOutRow.

00870 {
00871         if (mOutRow == 0)
00872                 throw LogicExceptionImpl("Statement::IsNull", _("The row is not initialized."));
00873 
00874         return mOutRow->IsNull(name);
00875 }

bool StatementImpl::IsNull ( int  column  )  [virtual]

Implements IBPP::IStatement.

Definition at line 671 of file statement.cpp.

References _, ibpp_internals::RowImpl::IsNull(), and mOutRow.

00672 {
00673         if (mOutRow == 0)
00674                 throw LogicExceptionImpl("Statement::IsNull", _("The row is not initialized."));
00675 
00676         return mOutRow->IsNull(column);
00677 }

int StatementImpl::Parameters (  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1147 of file statement.cpp.

References _, ibpp_internals::RowImpl::Columns(), mHandle, and mInRow.

01148 {
01149         if (mHandle == 0)
01150                 throw LogicExceptionImpl("Statement::Parameters", _("No statement has been prepared."));
01151         if (mInRow == 0)
01152                 throw LogicExceptionImpl("Statement::Parameters", _("The statement uses no parameters."));
01153 
01154         return mInRow->Columns();
01155 }

int StatementImpl::ParameterScale ( int  varnum  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1187 of file statement.cpp.

References _, ibpp_internals::RowImpl::ColumnScale(), mHandle, and mInRow.

01188 {
01189         if (mHandle == 0)
01190                 throw LogicExceptionImpl("Statement::ParameterScale", _("No statement has been prepared."));
01191         if (mInRow == 0)
01192                 throw LogicExceptionImpl("Statement::ParameterScale", _("The statement uses no parameters."));
01193 
01194         return mInRow->ColumnScale(varnum);
01195 }

int StatementImpl::ParameterSize ( int  varnum  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1177 of file statement.cpp.

References _, ibpp_internals::RowImpl::ColumnSize(), mHandle, and mInRow.

01178 {
01179         if (mHandle == 0)
01180                 throw LogicExceptionImpl("Statement::ParameterSize", _("No statement has been prepared."));
01181         if (mInRow == 0)
01182                 throw LogicExceptionImpl("Statement::ParameterSize", _("The statement uses no parameters."));
01183 
01184         return mInRow->ColumnSize(varnum);
01185 }

int StatementImpl::ParameterSubtype ( int  varnum  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1167 of file statement.cpp.

References _, ibpp_internals::RowImpl::ColumnSubtype(), mHandle, and mInRow.

01168 {
01169         if (mHandle == 0)
01170                 throw LogicExceptionImpl("Statement::ParameterSubtype", _("No statement has been prepared."));
01171         if (mInRow == 0)
01172                 throw LogicExceptionImpl("Statement::ParameterSubtype", _("The statement uses no parameters."));
01173 
01174     return mInRow->ColumnSubtype(varnum);
01175 }

IBPP::SDT StatementImpl::ParameterType ( int  varnum  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1157 of file statement.cpp.

References _, ibpp_internals::RowImpl::ColumnType(), mHandle, and mInRow.

01158 {
01159         if (mHandle == 0)
01160                 throw LogicExceptionImpl("Statement::ParameterType", _("No statement has been prepared."));
01161         if (mInRow == 0)
01162                 throw LogicExceptionImpl("Statement::ParameterType", _("The statement uses no parameters."));
01163 
01164     return mInRow->ColumnType(varnum);
01165 }

void StatementImpl::Plan ( std::string plan  )  [virtual]

Implements IBPP::IStatement.

Definition at line 237 of file statement.cpp.

References _, ibpp_internals::GDS::Call(), ibpp_internals::IBS::Errors(), ibpp_internals::gds, ibpp_internals::DatabaseImpl::GetHandle(), ibpp_internals::RB::GetString(), isc_info_sql_get_plan, ibpp_internals::GDS::m_dsql_sql_info, mDatabase, mHandle, ibpp_internals::RB::Self(), ibpp_internals::IBS::Self(), and ibpp_internals::RB::Size().

00238 {
00239         if (mHandle == 0)
00240                 throw LogicExceptionImpl("Statement::Plan", _("No statement has been prepared."));
00241         if (mDatabase == 0)
00242                 throw LogicExceptionImpl("Statement::Plan", _("A Database must be attached."));
00243         if (mDatabase->GetHandle() == 0)
00244                 throw LogicExceptionImpl("Statement::Plan", _("Database must be connected."));
00245 
00246         IBS status;
00247         RB result(4096);
00248         char itemsReq[] = {isc_info_sql_get_plan};
00249 
00250         (*gds.Call()->m_dsql_sql_info)(status.Self(), &mHandle, 1, itemsReq,
00251                                                                    result.Size(), result.Self());
00252         if (status.Errors()) throw SQLExceptionImpl(status,
00253                                                                 "Statement::Plan", _("isc_dsql_sql_info failed."));
00254 
00255         result.GetString(isc_info_sql_get_plan, plan);
00256         if (plan[0] == '\n') plan.erase(0, 1);
00257 }

void StatementImpl::Prepare ( const std::string sql  )  [virtual]

Implements IBPP::IStatement.

Definition at line 44 of file statement.cpp.

References _, ibpp_internals::RowImpl::AddRef(), ibpp_internals::RowImpl::AllocatedSize(), ibpp_internals::RowImpl::AllocVariables(), ibpp_internals::GDS::Call(), Close(), ibpp_internals::RowImpl::Columns(), ibpp_internals::DatabaseImpl::Dialect(), ibpp_internals::IBS::Errors(), ibpp_internals::gds, ibpp_internals::TransactionImpl::GetHandle(), ibpp_internals::DatabaseImpl::GetHandle(), ibpp_internals::TransactionImpl::GetHandlePtr(), ibpp_internals::DatabaseImpl::GetHandlePtr(), isc_info_sql_stmt_ddl, isc_info_sql_stmt_delete, isc_info_sql_stmt_exec_procedure, isc_info_sql_stmt_insert, isc_info_sql_stmt_savepoint, isc_info_sql_stmt_select, isc_info_sql_stmt_select_for_upd, isc_info_sql_stmt_set_generator, isc_info_sql_stmt_type, isc_info_sql_stmt_update, ibpp_internals::GDS::m_dsql_allocate_statement, ibpp_internals::GDS::m_dsql_describe, ibpp_internals::GDS::m_dsql_describe_bind, ibpp_internals::GDS::m_dsql_prepare, ibpp_internals::GDS::m_dsql_sql_info, mDatabase, mHandle, mInRow, mOutRow, mSql, mTransaction, mType, ibpp_internals::RowImpl::Release(), ibpp_internals::IBS::Reset(), ibpp_internals::RowImpl::Resize(), ibpp_internals::RowImpl::Self(), ibpp_internals::IBS::Self(), XSQLVAR::sqltype, XSQLDA::sqlvar, IBPP::stDDL, IBPP::stDelete, IBPP::stExecProcedure, IBPP::stInsert, IBPP::stSavePoint, IBPP::stSelect, IBPP::stSelectUpdate, IBPP::stSetGenerator, IBPP::stUnknown, IBPP::stUnsupported, and IBPP::stUpdate.

Referenced by CursorExecute(), Execute(), and StatementImpl().

00045 {
00046         if (mDatabase == 0)
00047                 throw LogicExceptionImpl("Statement::Prepare", _("An IDatabase must be attached."));
00048         if (mDatabase->GetHandle() == 0)
00049                 throw LogicExceptionImpl("Statement::Prepare", _("IDatabase must be connected."));
00050         if (mTransaction == 0)
00051                 throw LogicExceptionImpl("Statement::Prepare", _("An ITransaction must be attached."));
00052         if (mTransaction->GetHandle() == 0)
00053                 throw LogicExceptionImpl("Statement::Prepare", _("ITransaction must be started."));
00054         if (sql.empty())
00055                 throw LogicExceptionImpl("Statement::Prepare", _("SQL statement can't be 0."));
00056 
00057         // Saves the SQL sentence, only for reporting reasons in case of errors
00058         mSql = sql;
00059 
00060         IBS status;
00061 
00062         // Free all resources currently attached to this Statement, then allocate
00063         // a new statement descriptor.
00064         Close();
00065         (*gds.Call()->m_dsql_allocate_statement)(status.Self(), mDatabase->GetHandlePtr(), &mHandle);
00066         if (status.Errors())
00067                 throw SQLExceptionImpl(status, "Statement::Prepare",
00068                         _("isc_dsql_allocate_statement failed"));
00069 
00070         // Empirical estimate of parameters count and output columns count.
00071         // This is by far not an exact estimation, which would require parsing the
00072         // SQL statement. If the SQL statement contains '?' and ',' in string
00073         // constants, this count will obviously be wrong, but it will be exagerated.
00074         // It won't hurt. We just try to not have to re-allocate those descriptors later.
00075         // So we prefer to get them a little bit larger than needed than the other way.
00076         int16_t inEstimate = 0;
00077         int16_t outEstimate = 1;
00078         for (size_t i = 0; i < strlen(sql.c_str()); i++)
00079         {
00080                 if (sql[i] == '?') ++inEstimate;
00081                 if (sql[i] == ',') ++outEstimate;
00082         }
00083 
00084         /*
00085         DebugStream()<< "Prepare(\""<< sql<< "\")"<< fds;
00086         DebugStream()<< _("Estimation: ")<< inEstimate<< _(" IN parameters and ")
00087                         << outEstimate<< _(" OUT columns")<< fds;
00088         */
00089 
00090         // Allocates output descriptor and prepares the statement
00091         mOutRow = new RowImpl(mDatabase->Dialect(), outEstimate, mDatabase, mTransaction);
00092         mOutRow->AddRef();
00093 
00094         status.Reset();
00095         (*gds.Call()->m_dsql_prepare)(status.Self(), mTransaction->GetHandlePtr(),
00096                 &mHandle, (short)sql.length(), const_cast<char*>(sql.c_str()),
00097                         short(mDatabase->Dialect()), mOutRow->Self());
00098         if (status.Errors())
00099         {
00100                 Close();
00101                 std::string context = "Statement::Prepare( ";
00102                 context.append(mSql).append(" )");
00103                 throw SQLExceptionImpl(status, context.c_str(),
00104                         _("isc_dsql_prepare failed"));
00105         }
00106 
00107         // Read what kind of statement was prepared
00108         status.Reset();
00109         char itemsReq[] = {isc_info_sql_stmt_type};
00110         char itemsRes[8];
00111         (*gds.Call()->m_dsql_sql_info)(status.Self(), &mHandle, 1, itemsReq,
00112                 sizeof(itemsRes), itemsRes);
00113         if (status.Errors())
00114         {
00115                 Close();
00116                 throw SQLExceptionImpl(status, "Statement::Prepare",
00117                         _("isc_dsql_sql_info failed"));
00118         }
00119         if (itemsRes[0] == isc_info_sql_stmt_type)
00120         {
00121                 switch (itemsRes[3])
00122                 {
00123                         case isc_info_sql_stmt_select :         mType = IBPP::stSelect; break;
00124                         case isc_info_sql_stmt_insert :         mType = IBPP::stInsert; break;
00125                         case isc_info_sql_stmt_update :         mType = IBPP::stUpdate; break;
00126                         case isc_info_sql_stmt_delete :         mType = IBPP::stDelete; break;
00127                         case isc_info_sql_stmt_ddl :            mType = IBPP::stDDL; break;
00128                         case isc_info_sql_stmt_exec_procedure : mType = IBPP::stExecProcedure; break;
00129                         case isc_info_sql_stmt_select_for_upd : mType = IBPP::stSelectUpdate; break;
00130                         case isc_info_sql_stmt_set_generator :  mType = IBPP::stSetGenerator; break;
00131                         case isc_info_sql_stmt_savepoint :      mType = IBPP::stSavePoint; break;
00132                         default : mType = IBPP::stUnsupported;
00133                 }
00134         }
00135         if (mType == IBPP::stUnknown || mType == IBPP::stUnsupported)
00136         {
00137                 Close();
00138                 throw LogicExceptionImpl("Statement::Prepare",
00139                         _("Unknown or unsupported statement type"));
00140         }
00141 
00142         if (mOutRow->Columns() == 0)
00143         {
00144                 // Get rid of the output descriptor, if it wasn't required (no output)
00145                 mOutRow->Release();
00146                 mOutRow = 0;
00147                 /*
00148                 DebugStream()<< _("Dropped output descriptor which was not required")<< fds;
00149                 */
00150         }
00151         else if (mOutRow->Columns() > mOutRow->AllocatedSize())
00152         {
00153                 // Resize the output descriptor (which is too small).
00154                 // The statement does not need to be prepared again, though the
00155                 // output columns must be described again.
00156 
00157                 /*
00158                 DebugStream()<< _("Resize output descriptor from ")
00159                         << mOutRow->AllocatedSize()<< _(" to ")<< mOutRow->Columns()<< fds;
00160                 */
00161 
00162                 mOutRow->Resize(mOutRow->Columns());
00163                 status.Reset();
00164                 (*gds.Call()->m_dsql_describe)(status.Self(), &mHandle, 1, mOutRow->Self());
00165                 if (status.Errors())
00166                 {
00167                         Close();
00168                         throw SQLExceptionImpl(status, "Statement::Prepare",
00169                                 _("isc_dsql_describe failed"));
00170                 }
00171         }
00172 
00173         if (inEstimate > 0)
00174         {
00175                 // Ready an input descriptor
00176                 mInRow = new RowImpl(mDatabase->Dialect(), inEstimate, mDatabase, mTransaction);
00177                 mInRow->AddRef();
00178 
00179                 status.Reset();
00180                 (*gds.Call()->m_dsql_describe_bind)(status.Self(), &mHandle, 1, mInRow->Self());
00181                 if (status.Errors())
00182                 {
00183                         Close();
00184                         throw SQLExceptionImpl(status, "Statement::Prepare",
00185                                 _("isc_dsql_describe_bind failed"));
00186                 }
00187 
00188                 if (mInRow->Columns() == 0)
00189                 {
00190                         // Get rid of the input descriptor, if it wasn't required (no parameters)
00191                         mInRow->Release();
00192                         mInRow = 0;
00193                         /*
00194                         DebugStream()<< _("Dropped input descriptor which was not required")<< fds;
00195                         */
00196                 }
00197                 else if (mInRow->Columns() > mInRow->AllocatedSize())
00198                 {
00199                         // Resize the input descriptor (which is too small).
00200                         // The statement does not need to be prepared again, though the
00201                         // parameters must be described again.
00202 
00203                         /*
00204                         DebugStream()<< _("Resize input descriptor from ")
00205                                         << mInRow->AllocatedSize()<< _(" to ")
00206                                         << mInRow->Columns()<< fds;
00207                         */
00208 
00209                         mInRow->Resize(mInRow->Columns());
00210                         status.Reset();
00211                         (*gds.Call()->m_dsql_describe_bind)(status.Self(), &mHandle, 1, mInRow->Self());
00212                         if (status.Errors())
00213                         {
00214                                 Close();
00215                                 throw SQLExceptionImpl(status, "Statement::Prepare",
00216                                         _("isc_dsql_describe_bind failed"));
00217                         }
00218                 }
00219         }
00220 
00221         // Allocates variables of the input descriptor
00222         if (mInRow != 0)
00223         {
00224                 // Turn on 'can be NULL' on each input parameter
00225                 for (int i = 0; i < mInRow->Columns(); i++)
00226                 {
00227                         XSQLVAR* var = &(mInRow->Self()->sqlvar[i]);
00228                         if (! (var->sqltype & 1)) var->sqltype += short(1);
00229                 }
00230                 mInRow->AllocVariables();
00231         }
00232 
00233         // Allocates variables of the output descriptor
00234         if (mOutRow != 0) mOutRow->AllocVariables();
00235 }

void StatementImpl::Release (  )  [virtual]

Implements IBPP::IStatement.

Definition at line 1215 of file statement.cpp.

References ASSERTION, and mRefCount.

01216 {
01217         // Release cannot throw, except in DEBUG builds on assertion
01218         ASSERTION(mRefCount >= 0);
01219         --mRefCount;
01220         try { if (mRefCount <= 0) delete this; }
01221                 catch (...) { }
01222 }

void ibpp_internals::StatementImpl::Set ( int  ,
const IBPP::Array  
) [virtual]

Implements IBPP::IStatement.

void StatementImpl::Set ( int  param,
const IBPP::Blob blob 
) [virtual]

Implements IBPP::IStatement.

Definition at line 629 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00630 {
00631         if (mHandle == 0)
00632                 throw LogicExceptionImpl("Statement::Set[Blob]", _("No statement has been prepared."));
00633         if (mInRow == 0)
00634                 throw LogicExceptionImpl("Statement::Set[Blob]", _("The statement does not take parameters."));
00635 
00636         mInRow->Set(param, blob);
00637 }

void StatementImpl::Set ( int  param,
const IBPP::DBKey key 
) [virtual]

Implements IBPP::IStatement.

Definition at line 649 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00650 {
00651         if (mHandle == 0)
00652                 throw LogicExceptionImpl("Statement::Set[DBKey]", _("No statement has been prepared."));
00653         if (mInRow == 0)
00654                 throw LogicExceptionImpl("Statement::Set[DBKey]", _("The statement does not take parameters."));
00655 
00656         mInRow->Set(param, key);
00657 }

void StatementImpl::Set ( int  param,
const IBPP::Time value 
) [virtual]

Implements IBPP::IStatement.

Definition at line 619 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00620 {
00621         if (mHandle == 0)
00622                 throw LogicExceptionImpl("Statement::Set[Time]", _("No statement has been prepared."));
00623         if (mInRow == 0)
00624                 throw LogicExceptionImpl("Statement::Set[Time]", _("The statement does not take parameters."));
00625 
00626         mInRow->Set(param, value);
00627 }

void StatementImpl::Set ( int  param,
const IBPP::Date value 
) [virtual]

Implements IBPP::IStatement.

Definition at line 609 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00610 {
00611         if (mHandle == 0)
00612                 throw LogicExceptionImpl("Statement::Set[Date]", _("No statement has been prepared."));
00613         if (mInRow == 0)
00614                 throw LogicExceptionImpl("Statement::Set[Date]", _("The statement does not take parameters."));
00615 
00616         mInRow->Set(param, value);
00617 }

void StatementImpl::Set ( int  param,
const IBPP::Timestamp value 
) [virtual]

Implements IBPP::IStatement.

Definition at line 599 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00600 {
00601         if (mHandle == 0)
00602                 throw LogicExceptionImpl("Statement::Set[Timestamp]", _("No statement has been prepared."));
00603         if (mInRow == 0)
00604                 throw LogicExceptionImpl("Statement::Set[Timestamp]", _("The statement does not take parameters."));
00605 
00606         mInRow->Set(param, value);
00607 }

void StatementImpl::Set ( int  param,
double  value 
) [virtual]

Implements IBPP::IStatement.

Definition at line 589 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00590 {
00591         if (mHandle == 0)
00592                 throw LogicExceptionImpl("Statement::Set[double]", _("No statement has been prepared."));
00593         if (mInRow == 0)
00594                 throw LogicExceptionImpl("Statement::Set[double]", _("The statement does not take parameters."));
00595 
00596         mInRow->Set(param, value);
00597 }

void StatementImpl::Set ( int  param,
float  value 
) [virtual]

Implements IBPP::IStatement.

Definition at line 579 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00580 {
00581         if (mHandle == 0)
00582                 throw LogicExceptionImpl("Statement::Set[float]", _("No statement has been prepared."));
00583         if (mInRow == 0)
00584                 throw LogicExceptionImpl("Statement::Set[float]", _("The statement does not take parameters."));
00585 
00586         mInRow->Set(param, value);
00587 }

void StatementImpl::Set ( int  param,
int64_t  value 
) [virtual]

Implements IBPP::IStatement.

Definition at line 569 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00570 {
00571         if (mHandle == 0)
00572                 throw LogicExceptionImpl("Statement::Set[int64_t]", _("No statement has been prepared."));
00573         if (mInRow == 0)
00574                 throw LogicExceptionImpl("Statement::Set[int64_t]", _("The statement does not take parameters."));
00575 
00576         mInRow->Set(param, value);
00577 }

void StatementImpl::Set ( int  param,
int32_t  value 
) [virtual]

Implements IBPP::IStatement.

Definition at line 559 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00560 {
00561         if (mHandle == 0)
00562                 throw LogicExceptionImpl("Statement::Set[int32_t]", _("No statement has been prepared."));
00563         if (mInRow == 0)
00564                 throw LogicExceptionImpl("Statement::Set[int32_t]", _("The statement does not take parameters."));
00565 
00566         mInRow->Set(param, value);
00567 }

void StatementImpl::Set ( int  param,
int16_t  value 
) [virtual]

Implements IBPP::IStatement.

Definition at line 549 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00550 {
00551         if (mHandle == 0)
00552                 throw LogicExceptionImpl("Statement::Set[int16_t]", _("No statement has been prepared."));
00553         if (mInRow == 0)
00554                 throw LogicExceptionImpl("Statement::Set[int16_t]", _("The statement does not take parameters."));
00555 
00556         mInRow->Set(param, value);
00557 }

void StatementImpl::Set ( int  param,
const std::string s 
) [virtual]

Implements IBPP::IStatement.

Definition at line 539 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00540 {
00541         if (mHandle == 0)
00542                 throw LogicExceptionImpl("Statement::Set[string]", _("No statement has been prepared."));
00543         if (mInRow == 0)
00544                 throw LogicExceptionImpl("Statement::Set[string]", _("The statement does not take parameters."));
00545 
00546         mInRow->Set(param, s);
00547 }

void StatementImpl::Set ( int  param,
const void *  bindata,
int  len 
) [virtual]

Implements IBPP::IStatement.

Definition at line 529 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00530 {
00531         if (mHandle == 0)
00532                 throw LogicExceptionImpl("Statement::Set[void*]", _("No statement has been prepared."));
00533         if (mInRow == 0)
00534                 throw LogicExceptionImpl("Statement::Set[void*]", _("The statement does not take parameters."));
00535 
00536         mInRow->Set(param, bindata, len);
00537 }

void StatementImpl::Set ( int  param,
const char *  cstring 
) [virtual]

Implements IBPP::IStatement.

Definition at line 519 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00520 {
00521         if (mHandle == 0)
00522                 throw LogicExceptionImpl("Statement::Set[char*]", _("No statement has been prepared."));
00523         if (mInRow == 0)
00524                 throw LogicExceptionImpl("Statement::Set[char*]", _("The statement does not take parameters."));
00525 
00526         mInRow->Set(param, cstring);
00527 }

void StatementImpl::Set ( int  param,
bool  value 
) [virtual]

Implements IBPP::IStatement.

Definition at line 509 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::Set().

00510 {
00511         if (mHandle == 0)
00512                 throw LogicExceptionImpl("Statement::Set[bool]", _("No statement has been prepared."));
00513         if (mInRow == 0)
00514                 throw LogicExceptionImpl("Statement::Set[bool]", _("The statement does not take parameters."));
00515 
00516         mInRow->Set(param, value);
00517 }

void StatementImpl::SetNull ( int  param  )  [virtual]

Implements IBPP::IStatement.

Definition at line 499 of file statement.cpp.

References _, mHandle, mInRow, and ibpp_internals::RowImpl::SetNull().

00500 {
00501         if (mHandle == 0)
00502                 throw LogicExceptionImpl("Statement::SetNull", _("No statement has been prepared."));
00503         if (mInRow == 0)
00504                 throw LogicExceptionImpl("Statement::SetNull", _("The statement does not take parameters."));
00505 
00506         mInRow->SetNull(param);
00507 }

std::string& ibpp_internals::StatementImpl::Sql (  )  [inline, virtual]

Implements IBPP::IStatement.

Definition at line 1105 of file _ibpp.h.

01105 { return mSql; }

IBPP::Transaction StatementImpl::TransactionPtr (  )  const [virtual]

Implements IBPP::IStatement.

Definition at line 1202 of file statement.cpp.

References mTransaction.

01203 {
01204         return mTransaction;
01205 }

IBPP::STT ibpp_internals::StatementImpl::Type (  )  [inline, virtual]

Implements IBPP::IStatement.

Definition at line 1106 of file _ibpp.h.

01106 { return mType; }


Friends And Related Function Documentation

friend class TransactionImpl [friend]

Definition at line 1062 of file _ibpp.h.


Field Documentation

bool ibpp_internals::StatementImpl::mCursorOpened [private]

Definition at line 1073 of file _ibpp.h.

Referenced by Close(), CursorExecute(), CursorFree(), Execute(), and Fetch().

DatabaseImpl* ibpp_internals::StatementImpl::mDatabase [private]

Definition at line 1067 of file _ibpp.h.

Referenced by AffectedRows(), AttachDatabaseImpl(), DatabasePtr(), DetachDatabaseImpl(), ExecuteImmediate(), Plan(), Prepare(), and ~StatementImpl().

isc_stmt_handle ibpp_internals::StatementImpl::mHandle [private]

Definition at line 1065 of file _ibpp.h.

Referenced by AffectedRows(), Close(), ColumnScale(), ColumnSize(), ColumnSubtype(), ColumnType(), CursorExecute(), CursorFree(), Execute(), Fetch(), Parameters(), ParameterScale(), ParameterSize(), ParameterSubtype(), ParameterType(), Plan(), Prepare(), Set(), and SetNull().

RowImpl* ibpp_internals::StatementImpl::mInRow [private]

Definition at line 1069 of file _ibpp.h.

Referenced by Close(), CursorExecute(), Execute(), Parameters(), ParameterScale(), ParameterSize(), ParameterSubtype(), ParameterType(), Prepare(), Set(), and SetNull().

RowImpl* ibpp_internals::StatementImpl::mOutRow [private]

Definition at line 1071 of file _ibpp.h.

Referenced by Close(), ColumnAlias(), ColumnName(), ColumnNum(), Columns(), ColumnScale(), ColumnSize(), ColumnSubtype(), ColumnTable(), ColumnType(), CursorExecute(), Execute(), Fetch(), Get(), IsNull(), and Prepare().

int ibpp_internals::StatementImpl::mRefCount [private]

Definition at line 1064 of file _ibpp.h.

Referenced by AddRef(), and Release().

bool ibpp_internals::StatementImpl::mResultSetAvailable [private]

Definition at line 1072 of file _ibpp.h.

Referenced by Close(), CursorExecute(), Execute(), and Fetch().

std::string ibpp_internals::StatementImpl::mSql [private]

Definition at line 1075 of file _ibpp.h.

Referenced by CursorExecute(), Execute(), and Prepare().

TransactionImpl* ibpp_internals::StatementImpl::mTransaction [private]

Definition at line 1068 of file _ibpp.h.

Referenced by AttachTransactionImpl(), CursorExecute(), DetachTransactionImpl(), Execute(), ExecuteImmediate(), Prepare(), TransactionPtr(), and ~StatementImpl().

IBPP::STT ibpp_internals::StatementImpl::mType [private]

Definition at line 1074 of file _ibpp.h.

Referenced by AffectedRows(), Close(), CursorExecute(), Execute(), and Prepare().


The documentation for this class was generated from the following files:
Generated on Sun Jul 29 04:12:21 2012 for TerraLib - Development Source by  doxygen 1.5.3