NCBI C++ ToolKit
|
Search Toolkit Book for CTL_CursorCmd
#include <dbapi/driver/ctlib/interfaces.hpp>
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_Result * | OpenCursor (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_SendDataCmd * | SendDataCmd (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 Attributes | |
unsigned int | m_FetchSize |
Private Attributes inherited from CTL_CmdBase | |
int | m_RowCount |
CRef< TDbgInfo > | m_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_Result * | Create_Result (CResult &result) |
Definition at line 914 of file interfaces.hpp.
|
protected |
Definition at line 64 of file cursor.cpp.
References query, and CTL_CmdBase::SetExecCntxInfo().
|
protectedvirtual |
Definition at line 492 of file cursor.cpp.
References CloseForever(), impl::CBaseCmd::DetachInterface(), CTL_CmdBase::DropCmd(), NCBI_CATCH_ALL_X, and NCBI_CURRENT_FUNCTION.
|
protected |
Definition at line 79 of file cursor.cpp.
References CTL_CmdBase::Check(), CS_BUSY, CS_FAIL, CS_SUCCEED, DATABASE_DRIVER_ERROR, msg(), and CTL_CmdBase::SetHasFailed().
Referenced by CloseCursor(), Delete(), OpenCursor(), and Update().
|
protected |
Definition at line 105 of file cursor.cpp.
References CTL_CmdBase::Check(), CS_BUSY, CS_CANCELED, CS_FAIL, CS_PENDING, CS_SUCCEED, DATABASE_DRIVER_ERROR, msg(), and CTL_CmdBase::SetHasFailed().
Referenced by CloseCursor(), Delete(), OpenCursor(), ProcessResults(), and Update().
|
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().
|
protected |
Definition at line 427 of file cursor.cpp.
References _ASSERT, CTL_CmdBase::Check(), CloseCursor(), CS_BUSY, CS_CANCELED, CS_CURSOR_DEALLOC, CS_FAIL, CS_PENDING, CS_SUCCEED, CS_UNUSED, ct_cursor(), ct_send(), impl::CBaseCmd::CursorIsDeclared(), impl::CBaseCmd::DetachInterface(), CTL_Cmd::DropSybaseCmd(), CTL_CmdBase::IsDead(), ProcessResults(), and CTL_Cmd::x_GetSybaseCmd().
Referenced by ~CTL_CursorCmd().
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().
|
protectedvirtual |
Open the cursor.
Return NULL if cursor resulted in no data. Throw exception on error.
Reimplemented from impl::CBaseCmd.
Definition at line 172 of file cursor.cpp.
References CTL_CmdBase::Check(), CHECK_DRIVER_ERROR, CTL_CmdBase::CheckIsDead(), CheckSFB(), CheckSFBCP(), CloseCursor(), impl::CCommand::Create_Result(), CS_CMD_DONE, CS_CMD_FAIL, CS_CMD_SUCCEED, CS_CURSOR_DECLARE, CS_CURSOR_OPEN, CS_CURSOR_RESULT, CS_CURSOR_ROWS, CS_END_RESULTS, CS_RESTORE_OPEN, CS_SUCCEED, CS_UNUSED, ct_cursor(), ct_results(), ct_send(), impl::CBaseCmd::CursorIsDeclared(), data, DATABASE_DRIVER_WARNING, impl::CBaseCmd::GetBindParamsImpl(), impl::CBaseCmd::GetCmdName(), CTL_CmdBase::GetDbgInfo(), impl::CBaseCmd::GetQuery(), CTL_Cmd::GetResult(), CTL_Cmd::GetRowCount(), impl::CBaseCmd::HasFailed(), m_FetchSize, CTL_CmdBase::m_RowCount, CTL_Cmd::MakeCursorResult(), NULL, ProcessResults(), impl::CBaseCmd::SetCursorDeclared(), impl::CBaseCmd::SetCursorOpen(), CTL_CmdBase::SetHasFailed(), CTL_Cmd::SetResult(), ncbi::grid::netcache::search::fields::size, x_AssignParams(), and CTL_Cmd::x_GetSybaseCmd().
|
protected |
Definition at line 135 of file cursor.cpp.
References CTL_CmdBase::Check(), CheckSFBCP(), CS_CMD_DONE, CS_CMD_FAIL, CS_CMD_SUCCEED, CS_END_RESULTS, CS_SUCCEED, ct_results(), DATABASE_DRIVER_WARNING, CTL_Cmd::ProcessResultInternal(), CTL_CmdBase::SetHasFailed(), and CTL_Cmd::x_GetSybaseCmd().
Referenced by CloseCursor(), CloseForever(), Delete(), OpenCursor(), and Update().
|
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.
|
protectedvirtual |
Reimplemented from impl::CBaseCmd.
Definition at line 352 of file cursor.cpp.
References CTL_CmdBase::ConnSendDataCmd(), ncbi::grid::netcache::search::fields::size, and x_GetBlobDescriptor().
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().
|
protectedvirtual |
Reimplemented from impl::CBaseCmd.
Definition at line 343 of file cursor.cpp.
References data, x_GetBlobDescriptor(), and CTL_CmdBase::x_SendData().
Definition at line 505 of file cursor.cpp.
References CTL_Cmd::AssignCmdParam(), CS_INPUTVALUE, impl::CBaseCmd::GetBindParamsImpl(), impl::CDB_Params::GetParam(), impl::CDB_Params::GetParamName(), impl::CDB_Params::GetParamStatus(), i, impl::CDB_Params::LockBinding(), impl::CDB_Params::NofParams(), and _cs_datafmt::status.
Referenced by OpenCursor().
|
private |
Definition at line 311 of file cursor.cpp.
References CTL_CmdBase::CheckIsDead(), column, conn, CTL_BLOB_DESCRIPTOR_TYPE_MAGNUM, impl::CBaseCmd::CursorIsOpen(), _cs_iodesc::datatype, impl::CBaseCmd::GetCmdName(), CTL_CmdBase::GetConnection(), CTL_Cmd::GetResult(), CTL_Cmd::HaveResult(), CTL_BlobDescriptor::m_Desc, _cs_iodesc::name, NULL, and table.
Referenced by SendDataCmd(), and UpdateBlob().
|
friend |
Definition at line 916 of file interfaces.hpp.
|
private |
Definition at line 950 of file interfaces.hpp.
Referenced by OpenCursor().