NCBI C++ ToolKit
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
CStatementBase Class Reference

Search Toolkit Book for CStatementBase

#include <dbapi/driver/odbc/interfaces.hpp>

+ Inheritance diagram for CStatementBase:
+ Collaboration diagram for CStatementBase:

Public Member Functions

 CStatementBase (CODBC_Connection &conn, const string &query)
 
 CStatementBase (CODBC_Connection &conn, const string &cursor_name, const string &query)
 
 ~CStatementBase (void)
 
SQLHSTMT GetHandle (void) const
 
CODBC_ConnectionGetConnection (void)
 
const CODBC_ConnectionGetConnection (void) const
 
void SetDbgInfo (const string &msg)
 
const CODBC_Connection::TDbgInfoGetDbgInfo (void) const
 
void ReportErrors (void) const
 
void ReportError (CDB_Exception &ex) const
 
CDBParamsGetBindParams (void)
 Binding. More...
 
const CDBParamsGetBindParams (void) const
 
bool CheckRC (int rc) const
 
int CheckSIE (int rc, const char *msg, unsigned int msg_num) const
 
int CheckSIENd (int rc, const char *msg, unsigned int msg_num) const
 
bool Close (void) const
 
bool Unbind (void) const
 
bool ResetParams (void) const
 
bool IsMultibyteClientEncoding (void) const
 
EEncoding GetClientEncoding (void) const
 
- Public Member Functions inherited from impl::CBaseCmd
 CBaseCmd (impl::CConnection &conn, const string &query)
 
 CBaseCmd (impl::CConnection &conn, const string &cursor_name, const string &query)
 
virtual ~CBaseCmd (void)
 
virtual bool Send (void)
 Send command to the server. More...
 
virtual bool Cancel (void)
 Cancel the command execution. More...
 
bool WasCanceled (void) const
 
virtual CDB_ResultResult (void)
 Get result set. More...
 
virtual bool HasMoreResults (void) const
 
virtual bool HasFailed (void) const
 
void DumpResults (void)
 Dump the results of the command if result processor is installed for this connection, it will be called for each result set. More...
 
virtual CDBParamsGetDefineParams (void)
 Get meta-information about defined parameters. More...
 
const CDBParamsGetLastParams (void) const
 
bool More (const string &query_text)
 Add more text to the language command. More...
 
const stringGetQuery (void) const
 
string GetCmdName (void) const
 
virtual void SetHints (CTempString hints)
 Set hints by one call. More...
 
virtual void AddHint (CDB_BCPInCmd::EBCP_Hints hint, unsigned int value)
 Add hint with value. More...
 
virtual void AddOrderHint (CTempString columns)
 Add "ORDER" hint. More...
 
virtual bool CommitBCPTrans (void)
 Complete batch – to store all rows transferred by far in this batch into the table. More...
 
virtual bool EndBCP (void)
 Complete the BCP and store all rows transferred in last batch into the table. More...
 
unsigned int GetRowsInCurrentBatch (void) const
 
- Public Member Functions inherited from impl::CCmdBase
 CCmdBase (impl::CConnection &conn)
 
virtual ~CCmdBase ()
 
bool WasSent (void) const
 
- Public Member Functions inherited from impl::CCommand
virtual ~CCommand (void)
 
void Release (void)
 

Protected Member Functions

virtual int RowCount (void) const
 Get the number of rows affected by the command Special case: negative on error or if there is no way that this command could ever affect any rows (like PRINT). More...
 
string Type2String (const CDB_Object &param) const
 
bool x_BindParam_ODBC (const CDB_Object &param, CMemPot &bind_guard, SQLLEN *indicator_base, unsigned int pos) const
 
SQLSMALLINT x_GetCType (const CDB_Object &param) const
 
SQLSMALLINT x_GetSQLType (const CDB_Object &param) const
 
SQLULEN x_GetMaxDataSize (const CDB_Object &param) const
 
SQLLEN x_GetCurDataSize (const CDB_Object &param) const
 
SQLLEN x_GetIndicator (const CDB_Object &param) const
 
SQLPOINTER x_GetData (const CDB_Object &param, CMemPot &bind_guard) const
 
- Protected Member Functions inherited from impl::CBaseCmd
void DetachInterface (void)
 
void SetRecompile (bool recompile=true)
 Set the "recompile before execute" flag for the stored proc. More...
 
bool NeedToRecompile (void) const
 
virtual void SetHasFailed (bool flag=true)
 
const CDB_ParamsGetBindParamsImpl (void) const
 
CDB_ParamsGetBindParamsImpl (void)
 
const CDB_ParamsGetDefineParamsImpl (void) const
 
CDB_ParamsGetDefineParamsImpl (void)
 
virtual CDB_ResultOpenCursor (void)
 Open the cursor. More...
 
virtual bool Update (const string &table_name, const string &upd_query)
 Update the last fetched row. More...
 
virtual bool UpdateBlob (unsigned int item_num, CDB_Stream &data, bool log_it=true)
 
virtual CDB_SendDataCmdSendDataCmd (unsigned int item_num, size_t size, bool log_it=true, bool dump_results=true)
 
virtual bool Delete (const string &table_name)
 Delete the last fetched row. More...
 
virtual bool CloseCursor (void)
 Close the cursor. More...
 
bool CursorIsOpen (void) const
 
void SetCursorOpen (bool flag=true)
 
bool CursorIsDeclared (void) const
 
void SetCursorDeclared (bool flag=true)
 
- Protected Member Functions inherited from impl::CCmdBase
void SetWasSent (bool flag=true)
 
impl::CConnectionGetConnImpl (void) const
 

Protected Attributes

SQLLEN m_RowCount
 

Private Member Functions

void x_Init (void)
 

Private Attributes

SQLHSTMT m_Cmd
 
CODBC_Reporter m_Reporter
 
bool m_IsActive
 

Friends

class CODBC_Connection
 

Additional Inherited Members

- Static Public Member Functions inherited from impl::CCommand
static CDB_ResultCreate_Result (CResult &result)
 

Detailed Description

Definition at line 360 of file interfaces.hpp.

Constructor & Destructor Documentation

◆ CStatementBase() [1/2]

CStatementBase::CStatementBase ( CODBC_Connection conn,
const string query 
)

Definition at line 848 of file connection.cpp.

References x_Init().

◆ CStatementBase() [2/2]

CStatementBase::CStatementBase ( CODBC_Connection conn,
const string cursor_name,
const string query 
)

Definition at line 858 of file connection.cpp.

References x_Init().

◆ ~CStatementBase()

CStatementBase::~CStatementBase ( void  )

Member Function Documentation

◆ CheckRC()

bool CStatementBase::CheckRC ( int  rc) const

◆ CheckSIE()

int CStatementBase::CheckSIE ( int  rc,
const char *  msg,
unsigned int  msg_num 
) const

◆ CheckSIENd()

int CStatementBase::CheckSIENd ( int  rc,
const char *  msg,
unsigned int  msg_num 
) const

◆ Close()

bool CStatementBase::Close ( void  ) const

◆ GetBindParams() [1/2]

CDBParams& CStatementBase::GetBindParams ( void  )
inlinevirtual

Binding.

Get meta-information about binded parameters.

Reimplemented from impl::CBaseCmd.

Reimplemented in CODBC_CursorCmdBase, and CODBC_RPCCmd.

Definition at line 404 of file interfaces.hpp.

Referenced by CODBC_CursorCmdBase::GetBindParams().

◆ GetBindParams() [2/2]

const CDBParams& CStatementBase::GetBindParams ( void  ) const
inline

Definition at line 408 of file interfaces.hpp.

◆ GetClientEncoding()

EEncoding CStatementBase::GetClientEncoding ( void  ) const
inline

◆ GetConnection() [1/2]

CODBC_Connection& CStatementBase::GetConnection ( void  )
inline

◆ GetConnection() [2/2]

const CODBC_Connection& CStatementBase::GetConnection ( void  ) const
inline

Definition at line 377 of file interfaces.hpp.

References impl::CCmdBase::GetConnImpl().

◆ GetDbgInfo()

const CODBC_Connection::TDbgInfo& CStatementBase::GetDbgInfo ( void  ) const
inline

◆ GetHandle()

SQLHSTMT CStatementBase::GetHandle ( void  ) const
inline

◆ IsMultibyteClientEncoding()

bool CStatementBase::IsMultibyteClientEncoding ( void  ) const
inline

◆ ReportError()

void CStatementBase::ReportError ( CDB_Exception ex) const
inline

◆ ReportErrors()

void CStatementBase::ReportErrors ( void  ) const
inline

◆ ResetParams()

bool CStatementBase::ResetParams ( void  ) const
inline

◆ RowCount()

int CStatementBase::RowCount ( void  ) const
protectedvirtual

Get the number of rows affected by the command Special case: negative on error or if there is no way that this command could ever affect any rows (like PRINT).

Implements impl::CBaseCmd.

Reimplemented in CODBC_BCPInCmd, CODBC_CursorCmdBase, CODBC_RPCCmd, and CODBC_LangCmd.

Definition at line 1602 of file connection.cpp.

References m_RowCount.

◆ SetDbgInfo()

void CStatementBase::SetDbgInfo ( const string msg)
inline

◆ Type2String()

string CStatementBase::Type2String ( const CDB_Object param) const
protected

◆ Unbind()

bool CStatementBase::Unbind ( void  ) const
inline

Definition at line 422 of file interfaces.hpp.

References CheckRC(), m_Cmd, SQL_UNBIND, and SQLFreeStmt().

◆ x_BindParam_ODBC()

bool CStatementBase::x_BindParam_ODBC ( const CDB_Object param,
CMemPot bind_guard,
SQLLEN indicator_base,
unsigned int  pos 
) const
protected

◆ x_GetCType()

SQLSMALLINT CStatementBase::x_GetCType ( const CDB_Object param) const
protected

◆ x_GetCurDataSize()

SQLLEN CStatementBase::x_GetCurDataSize ( const CDB_Object param) const
protected

◆ x_GetData()

SQLPOINTER CStatementBase::x_GetData ( const CDB_Object param,
CMemPot bind_guard 
) const
protected

◆ x_GetIndicator()

SQLLEN CStatementBase::x_GetIndicator ( const CDB_Object param) const
protected

◆ x_GetMaxDataSize()

SQLULEN CStatementBase::x_GetMaxDataSize ( const CDB_Object param) const
protected

◆ x_GetSQLType()

SQLSMALLINT CStatementBase::x_GetSQLType ( const CDB_Object param) const
protected

◆ x_Init()

void CStatementBase::x_Init ( void  )
private

Friends And Related Function Documentation

◆ CODBC_Connection

friend class CODBC_Connection
friend

Definition at line 362 of file interfaces.hpp.

Member Data Documentation

◆ m_Cmd

SQLHSTMT CStatementBase::m_Cmd
private

Definition at line 462 of file interfaces.hpp.

Referenced by Close(), GetHandle(), ResetParams(), Unbind(), x_Init(), and ~CStatementBase().

◆ m_IsActive

bool CStatementBase::m_IsActive
private

Definition at line 464 of file interfaces.hpp.

Referenced by x_Init(), CODBC_Connection::~CODBC_Connection(), and ~CStatementBase().

◆ m_Reporter

CODBC_Reporter CStatementBase::m_Reporter
private

Definition at line 463 of file interfaces.hpp.

Referenced by GetDbgInfo(), ReportError(), ReportErrors(), SetDbgInfo(), and x_Init().

◆ m_RowCount

SQLLEN CStatementBase::m_RowCount
protected

The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:54 2024 by modify_doxy.py rev. 669887