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

Search Toolkit Book for CTL_CursorCmd

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

+ Inheritance diagram for CTL_CursorCmd:
+ Collaboration diagram for CTL_CursorCmd:

Protected Member Functions

 CTL_CursorCmd (CTL_Connection &conn, const string &cursor_name, const string &query, unsigned int fetch_size)
 
virtual ~CTL_CursorCmd (void)
 
void CloseForever (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 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...
 
virtual bool CloseCursor (void)
 Close the cursor. More...
 
CS_RETCODE CheckSFB (CS_RETCODE rc, const char *msg, unsigned int msg_num)
 
CS_RETCODE CheckSFBCP (CS_RETCODE rc, const char *msg, unsigned int msg_num)
 
bool ProcessResults (void)
 

Private Member Functions

bool x_AssignParams (bool just_declare=false)
 
I_BlobDescriptorx_GetBlobDescriptor (unsigned int item_num)
 
- Private Member Functions inherited from CTL_Cmd
 CTL_Cmd (CTL_Connection &conn, const string &query)
 
 CTL_Cmd (CTL_Connection &conn, const string &cursor_name, const string &query)
 
virtual ~CTL_Cmd (void)
 
CS_COMMANDx_GetSybaseCmd (void) const
 
void SetSybaseCmd (CS_COMMAND *cmd)
 
bool AssignCmdParam (CDB_Object &param, const string &param_name, CS_DATAFMT &param_fmt, bool declare_only=false)
 
void GetRowCount (int *cnt)
 
CTL_RowResultGetResult (void)
 
void DeleteResult (void)
 
void DeleteResultInternal (void)
 
void MarkEndOfReply (void)
 
bool HaveResult (void) const
 
void SetResult (CTL_RowResult *result)
 
CTL_RowResultMakeCursorResult (void)
 
CTL_RowResultMakeRowResult (void)
 
CTL_RowResultMakeParamResult (void)
 
CTL_RowResultMakeComputeResult (void)
 
CTL_RowResultMakeStatusResult (void)
 
bool ProcessResultInternal (CDB_Result &res)
 
bool ProcessResultInternal (CS_INT res_type)
 
CS_RETCODE CheckSFB_Internal (CS_RETCODE rc, const char *msg, unsigned int msg_num)
 
void DropSybaseCmd (void)
 
- Private Member Functions inherited from CTL_CmdBase
 CTL_CmdBase (CTL_Connection &conn, const string &query)
 
 CTL_CmdBase (CTL_Connection &conn, const string &cursor_name, const string &query)
 
virtual ~CTL_CmdBase (void)
 
CS_RETCODE Check (CS_RETCODE rc)
 
CTL_ConnectionGetConnection (void)
 
const CTL_ConnectionGetConnection (void) const
 
void DropCmd (impl::CCommand &cmd)
 
bool x_SendData (I_BlobDescriptor &desc, CDB_Stream &img, bool log_it=true)
 
CDB_SendDataCmdConnSendDataCmd (I_BlobDescriptor &desc, size_t data_size, bool log_it=true, bool dump_results=true)
 
bool IsMultibyteClientEncoding (void) const
 
EEncoding GetClientEncoding (void) const
 
virtual bool x_Cancel (ECancelType)
 
void SetExecCntxInfo (const string &info)
 
const stringGetExecCntxInfo (void) const
 
bool IsDead (void) const
 
void SetDead (bool flag=true)
 
void CheckIsDead (void)
 
virtual void SetHasFailed (bool flag=true)
 
const TDbgInfoGetDbgInfo (void) const
 
bool GetTimedOut (void) const
 
void SetTimedOut (bool val)
 
ERetriable GetRetriable (void) const
 
void SetRetriable (ERetriable val)
 
void EnsureActiveStatus (void)
 
- Private 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 CDBParamsGetBindParams (void)
 Binding. 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
 
void DetachInterface (void)
 
void SetRecompile (bool recompile=true)
 Set the "recompile before execute" flag for the stored proc. More...
 
bool NeedToRecompile (void) const
 
const CDB_ParamsGetBindParamsImpl (void) const
 
CDB_ParamsGetBindParamsImpl (void)
 
const CDB_ParamsGetDefineParamsImpl (void) const
 
CDB_ParamsGetDefineParamsImpl (void)
 
bool CursorIsOpen (void) const
 
void SetCursorOpen (bool flag=true)
 
bool CursorIsDeclared (void) const
 
void SetCursorDeclared (bool flag=true)
 
- Private Member Functions inherited from impl::CCmdBase
 CCmdBase (impl::CConnection &conn)
 
virtual ~CCmdBase ()
 
bool WasSent (void) const
 
void SetWasSent (bool flag=true)
 
impl::CConnectionGetConnImpl (void) const
 
- Private Member Functions inherited from impl::CCommand
virtual ~CCommand (void)
 
void Release (void)
 

Private Attributes

unsigned int m_FetchSize
 
- Private Attributes inherited from CTL_CmdBase
int m_RowCount
 
CRef< TDbgInfom_DbgInfo
 

Friends

class CTL_Connection
 

Additional Inherited Members

- Private Types inherited from CTL_CmdBase
enum  ECancelType { eAsyncCancel = CS_CANCEL_ATTN , eSyncCancel = CS_CANCEL_ALL }
 
typedef CTL_Connection::TDbgInfo TDbgInfo
 
- Static Private Member Functions inherited from impl::CCommand
static CDB_ResultCreate_Result (CResult &result)
 

Detailed Description

Definition at line 913 of file interfaces.hpp.

Constructor & Destructor Documentation

◆ CTL_CursorCmd()

CTL_CursorCmd::CTL_CursorCmd ( CTL_Connection conn,
const string cursor_name,
const string query,
unsigned int  fetch_size 
)
protected

Definition at line 64 of file cursor.cpp.

References query, and CTL_CmdBase::SetExecCntxInfo().

◆ ~CTL_CursorCmd()

CTL_CursorCmd::~CTL_CursorCmd ( void  )
protectedvirtual

Member Function Documentation

◆ CheckSFB()

CS_RETCODE CTL_CursorCmd::CheckSFB ( CS_RETCODE  rc,
const char *  msg,
unsigned int  msg_num 
)
protected

◆ CheckSFBCP()

CS_RETCODE CTL_CursorCmd::CheckSFBCP ( CS_RETCODE  rc,
const char *  msg,
unsigned int  msg_num 
)
protected

◆ CloseCursor()

bool CTL_CursorCmd::CloseCursor ( void  )
protectedvirtual

Close the cursor.

Return FALSE if the cursor is closed already (or not opened yet)

Reimplemented from impl::CBaseCmd.

Definition at line 390 of file cursor.cpp.

References CheckSFB(), CheckSFBCP(), CS_CURSOR_CLOSE, CS_UNUSED, ct_cursor(), ct_send(), impl::CBaseCmd::CursorIsOpen(), CTL_Cmd::DeleteResult(), CTL_CmdBase::IsDead(), ProcessResults(), result, impl::CBaseCmd::SetCursorOpen(), and CTL_Cmd::x_GetSybaseCmd().

Referenced by CloseForever(), and OpenCursor().

◆ CloseForever()

void CTL_CursorCmd::CloseForever ( void  )
protected

◆ Delete()

bool CTL_CursorCmd::Delete ( const string table_name)
protectedvirtual

Delete the last fetched row.

NOTE: the cursor must be declared for delete in CDB_Connection::Cursor()

Reimplemented from impl::CBaseCmd.

Definition at line 362 of file cursor.cpp.

References CTL_CmdBase::CheckIsDead(), CheckSFB(), CheckSFBCP(), CS_CURSOR_DELETE, CS_UNUSED, ct_cursor(), ct_send(), impl::CBaseCmd::CursorIsOpen(), ProcessResults(), table_name, and CTL_Cmd::x_GetSybaseCmd().

◆ OpenCursor()

CDB_Result * CTL_CursorCmd::OpenCursor ( void  )
protectedvirtual

◆ ProcessResults()

bool CTL_CursorCmd::ProcessResults ( void  )
protected

◆ RowCount()

int CTL_CursorCmd::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.

Definition at line 384 of file cursor.cpp.

References CTL_CmdBase::m_RowCount.

◆ SendDataCmd()

CDB_SendDataCmd * CTL_CursorCmd::SendDataCmd ( unsigned int  item_num,
size_t  size,
bool  log_it = true,
bool  dump_results = true 
)
protectedvirtual

◆ Update()

bool CTL_CursorCmd::Update ( const string table_name,
const string upd_query 
)
protectedvirtual

Update the last fetched row.

NOTE: the cursor must be declared for update in CDB_Connection::Cursor()

Reimplemented from impl::CBaseCmd.

Definition at line 288 of file cursor.cpp.

References CTL_CmdBase::CheckIsDead(), CheckSFB(), CheckSFBCP(), CS_CURSOR_UPDATE, CS_UNUSED, ct_cursor(), ct_send(), impl::CBaseCmd::CursorIsOpen(), ProcessResults(), table_name, and CTL_Cmd::x_GetSybaseCmd().

◆ UpdateBlob()

bool CTL_CursorCmd::UpdateBlob ( unsigned int  item_num,
CDB_Stream data,
bool  log_it = true 
)
protectedvirtual

Reimplemented from impl::CBaseCmd.

Definition at line 343 of file cursor.cpp.

References data, x_GetBlobDescriptor(), and CTL_CmdBase::x_SendData().

◆ x_AssignParams()

bool CTL_CursorCmd::x_AssignParams ( bool  just_declare = false)
private

◆ x_GetBlobDescriptor()

I_BlobDescriptor * CTL_CursorCmd::x_GetBlobDescriptor ( unsigned int  item_num)
private

Friends And Related Function Documentation

◆ CTL_Connection

friend class CTL_Connection
friend

Definition at line 915 of file interfaces.hpp.

Member Data Documentation

◆ m_FetchSize

unsigned int CTL_CursorCmd::m_FetchSize
private

Definition at line 949 of file interfaces.hpp.

Referenced by OpenCursor().


The documentation for this class was generated from the following files:
Modified on Mon May 27 04:38:41 2024 by modify_doxy.py rev. 669887