NCBI C++ ToolKit
|
Search Toolkit Book for CTL_CursorResultExpl
#include <dbapi/driver/ctlib/interfaces.hpp>
Protected Member Functions | |
CTL_CursorResultExpl (CTL_LangCmd *cmd, const string &cursor_name) | |
virtual | ~CTL_CursorResultExpl (void) |
virtual EDB_ResType | ResultType (void) const |
Get type of the result. More... | |
virtual bool | Fetch (void) |
Fetch next row. More... | |
virtual int | CurrentItemNo (void) const |
Return current item number we can retrieve (0,1,...) Return "-1" if no more items left (or available) to read. More... | |
virtual int | GetColumnNum (void) const |
Return number of columns in the recordset. More... | |
virtual CDB_Object * | GetItem (CDB_Object *item_buff=0, I_Result::EGetItem policy=I_Result::eAppendLOB) |
Get a result item (you can use either GetItem or ReadItem). More... | |
virtual size_t | ReadItem (void *buffer, size_t buffer_size, bool *is_null=0) |
Read a result item body (for BLOB columns, mostly). More... | |
virtual I_BlobDescriptor * | GetBlobDescriptor (void) |
Get a descriptor for a BLOB column (for SendData). More... | |
I_BlobDescriptor * | GetBlobDescriptor (int item_num) |
virtual bool | SkipItem (void) |
Skip result item. More... | |
Protected Member Functions inherited from CTL_CursorResult | |
CTL_CursorResult (CS_COMMAND *pCmd, CTL_Connection &conn, const string &cursor_name) | |
virtual | ~CTL_CursorResult (void) |
void | x_InvalidateDescriptors (void) |
Protected Member Functions inherited from CTL_RowResult | |
CTL_RowResult (CS_COMMAND *cmd, CTL_Connection &conn) | |
virtual | ~CTL_RowResult (void) |
void | Close (void) |
I_BlobDescriptor * | GetBlobDescriptor (int item_num) |
CS_RETCODE | my_ct_get_data (CS_COMMAND *cmd, CS_INT item, CS_VOID *buffer, CS_INT buflen, CS_INT *outlen, bool &is_null) |
CDB_Object * | GetItemInternal (I_Result::EGetItem policy, CS_COMMAND *cmd, CS_INT item_no, CS_DATAFMT &fmt, CDB_Object *item_buf) |
CS_COMMAND * | x_GetSybaseCmd (void) const |
CS_RETCODE | Check (CS_RETCODE rc) |
CTL_Connection & | GetConnection (void) |
const CTL_Connection & | GetConnection (void) const |
const CTL_Connection::TDbgInfo & | GetDbgInfo (void) const |
void | SetCurrentItemNum (int num) |
int | GetCurrentItemNum (void) const |
void | IncCurrentItemNum (void) |
bool | IsDead (void) const |
const CDBParams * | GetLastParams (void) const |
void | CheckIsDead (void) const |
Private Member Functions | |
CDB_Result * | GetResultSet (void) const |
void | SetResultSet (CDB_Result *res) |
void | ClearResultSet (void) |
void | DumpResultSet (void) |
void | FetchAllResultSet (void) |
CTL_LangCmd & | GetCmd (void) |
CTL_LangCmd const & | GetCmd (void) const |
void | ClearFields (void) |
Private Attributes | |
CTL_LangCmd * | m_Cmd |
CDB_Result * | m_Res |
vector< CDB_Object * > | m_Fields |
vector< I_BlobDescriptor * > | m_BlobDescrs |
int | m_CurItemNo |
size_t | m_ReadBytes |
void * | m_ReadBuffer |
string | m_CursorName |
Friends | |
class | CTL_CursorCmdExpl |
struct | default_delete< CTL_CursorResultExpl > |
Definition at line 1330 of file interfaces.hpp.
|
protected |
Definition at line 1202 of file result.cpp.
|
protectedvirtual |
Definition at line 1574 of file result.cpp.
References ClearFields(), m_Res, NCBI_CATCH_ALL_X, and NCBI_CURRENT_FUNCTION.
|
private |
Definition at line 1215 of file result.cpp.
References free(), ITERATE, m_BlobDescrs, m_Fields, m_ReadBuffer, and NULL.
Referenced by Fetch(), and ~CTL_CursorResultExpl().
|
private |
|
protectedvirtual |
Return current item number we can retrieve (0,1,...) Return "-1" if no more items left (or available) to read.
Reimplemented from CTL_RowResult.
Definition at line 1318 of file result.cpp.
References m_CurItemNo.
|
private |
|
protectedvirtual |
Fetch next row.
Reimplemented from CTL_CursorResult.
Definition at line 1239 of file result.cpp.
References ClearFields(), CTL_Connection::CompleteBlobDescriptors(), CTL_BLOB_DESCRIPTOR_TYPE_MAGNUM, CDB_Result::CurrentItemNo(), DATABASE_DRIVER_ERROR_EX, eDB_RowResult, CDB_Result::Fetch(), CDB_Result::GetBlobDescriptor(), GetCmd(), CDB_Result::GetColumnNum(), CTL_RowResult::GetConnection(), CTL_RowResult::GetDbgInfo(), CDB_Result::GetDefineParams(), CDB_Result::GetItem(), CTL_LangCmd::HasMoreResults(), i, CDB_Object::IsBlobType(), CDB_Result::ItemDataType(), m_BlobDescrs, impl::CResult::m_CachedRowInfo, m_CurItemNo, m_CursorName, m_Fields, m_ReadBytes, m_Res, NULL, CTL_LangCmd::Result(), CDB_Result::ResultType(), and CTL_LangCmd::Send().
|
private |
|
protected |
Definition at line 1552 of file result.cpp.
References GetColumnNum(), m_BlobDescrs, NULL, and result.
|
inlineprotectedvirtual |
Get a descriptor for a BLOB column (for SendData).
Return NULL if this result doesn't (or can't) have a BLOB descriptor. NOTE: you need to call ReadItem (maybe even with buffer_size == 0) before calling this method!
Reimplemented from CTL_RowResult.
Definition at line 1348 of file interfaces.hpp.
|
inlineprivate |
|
inlineprivate |
Definition at line 1367 of file interfaces.hpp.
References _ASSERT.
|
protectedvirtual |
Return number of columns in the recordset.
Reimplemented from CTL_RowResult.
Definition at line 1324 of file result.cpp.
Referenced by GetBlobDescriptor(), GetItem(), ReadItem(), and SkipItem().
|
protectedvirtual |
Get a result item (you can use either GetItem or ReadItem).
If "item_buf" is not NULL, then use "*item_buf" (its type should be compatible with the type of retrieved item!) to retrieve the item to; otherwise allocate new "CDB_Object".
Reimplemented from CTL_RowResult.
Definition at line 1330 of file result.cpp.
References CDB_Stream::Append(), CDB_Object::AssignValue(), buffer, DATABASE_DRIVER_ERROR, I_Result::eAppendLOB, GetColumnNum(), CTL_RowResult::GetDbgInfo(), CDB_Object::GetType(), CDB_Object::IsBlobType(), m_CurItemNo, m_Fields, CDB_Stream::MoveTo(), NULL, CDB_Stream::Read(), read_size(), CDB_Stream::Size(), and total_size.
|
private |
|
protectedvirtual |
Read a result item body (for BLOB columns, mostly).
Return number of successfully read bytes. Set "*is_null" to TRUE if the item is <NULL>. Throw an exception on any error.
Reimplemented from CTL_RowResult.
Definition at line 1370 of file result.cpp.
References _cs_numeric::array, buffer, CHECK_DRIVER_ERROR, CS_BIGDATETIME_TYPE, cs_dt_crack, CS_MAX_NUMLEN, CS_SUCCEED, CTLibContext::CTLIB_GetContext(), ctx, CDB_String::Data(), data, CDB_LongChar::DataSize(), _cs_daterec::datedmonth, _cs_daterec::datedweek, _cs_daterec::datedyear, _cs_daterec::datehour, _cs_daterec::dateminute, _cs_daterec::datemonth, _cs_daterec::datemsecond, _cs_daterec::datesecfrac, _cs_daterec::datesecond, _cs_daterec::datesecprec, _cs_daterec::dateyear, _cs_datetime4::days, _cs_datetime::dtdays, _cs_datetime::dttime, eDB_BigDateTime, eDB_BigInt, eDB_Binary, eDB_Bit, eDB_Char, eDB_DateTime, eDB_Double, eDB_Float, eDB_Image, eDB_Int, eDB_LongBinary, eDB_LongChar, eDB_Numeric, eDB_SmallDateTime, eDB_SmallInt, eDB_Text, eDB_TinyInt, eDB_VarBinary, eDB_VarBinaryMax, eDB_VarChar, eDB_VarCharMax, free(), CDB_DateTime::Get300Secs(), GetColumnNum(), CDB_BigDateTime::GetCTime(), CTL_Connection::GetCTLibContext(), CDB_SmallDateTime::GetDays(), CDB_DateTime::GetDays(), CDB_SmallDateTime::GetMinutes(), CDB_Object::GetType(), CDB_Object::IsNULL(), kMicroSecondsPerSecond, CTL_RowResult::m_Connect, m_CurItemNo, m_Fields, m_ReadBuffer, m_ReadBytes, malloc(), _cs_datetime4::minutes, CDB_Stream::MoveTo(), NULL, _cs_numeric::precision, CDB_Numeric::Precision(), CDB_Numeric::RawData(), CDB_Stream::Read(), _cs_numeric::scale, CDB_Numeric::Scale(), CDB_VarBinary::Size(), CDB_Binary::Size(), CDB_LongBinary::Size(), CDB_Stream::Size(), CDB_String::Size(), t, CDB_VarBinary::Value(), CDB_Binary::Value(), and CDB_LongBinary::Value().
|
protectedvirtual |
Get type of the result.
Reimplemented from CTL_CursorResult.
Definition at line 1233 of file result.cpp.
References eDB_CursorResult.
|
private |
|
protectedvirtual |
Skip result item.
Reimplemented from CTL_CursorResult.
Definition at line 1564 of file result.cpp.
References GetColumnNum(), and m_CurItemNo.
|
friend |
Definition at line 1332 of file interfaces.hpp.
|
friend |
Definition at line 1332 of file interfaces.hpp.
|
private |
Definition at line 1381 of file interfaces.hpp.
Referenced by ClearFields(), Fetch(), and GetBlobDescriptor().
|
private |
Definition at line 1377 of file interfaces.hpp.
Referenced by CTL_RowResult::x_GetSybaseCmd().
|
private |
Definition at line 1382 of file interfaces.hpp.
Referenced by CurrentItemNo(), Fetch(), GetItem(), ReadItem(), and SkipItem().
|
private |
Definition at line 1385 of file interfaces.hpp.
Referenced by Fetch().
|
private |
Definition at line 1380 of file interfaces.hpp.
Referenced by ClearFields(), Fetch(), GetColumnNum(), GetItem(), and ReadItem().
|
private |
Definition at line 1384 of file interfaces.hpp.
Referenced by ClearFields(), and ReadItem().
|
private |
Definition at line 1383 of file interfaces.hpp.
Referenced by Fetch(), and ReadItem().
|
private |
Definition at line 1379 of file interfaces.hpp.
Referenced by Fetch(), CTL_Cmd::SetResult(), and ~CTL_CursorResultExpl().