Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cODBCStatement Class Reference

#include <cODBCEnv.h>

Inheritance diagram for GrayLib::cODBCStatement:
GrayLib::cODBCBase ISQLStatement Gray::cRefBase IUnknown

Public Member Functions

 cODBCStatement (cODBCBase *pParent, const cSQLCmd &oCmd)
 
virtual bool SetSQLAttr (long nAttribute, void *pValue) override
 
virtual HRESULT CloseStatement (bool bDrop) override
 
virtual HRESULT ExecuteAndFetch (bool bResultsExpected) override
 
virtual void ExecCancel () override
 
virtual HRESULT FetchNext (bool bMore=false) override
 
virtual ITERATE_t ReadColumnCount () override
 
virtual bool ReadColumnInfo (SQL_COLUMN_t iColumn, OUT cSQLColumnInfo &info) override
 
void GetData_Raw (SQL_COLUMN_t iColumn, SQL_TYPE_t nType, OUT void *pBuffer, size_t nSizeBuffer, OUT INT_PTR *pnSizeRet)
 
bool GetColumnVarNumber (SQL_COLUMN_t iColumn, cSQLColumnInfo *pColInfo, OUT cVariant &vValRet, SQL_TYPE_t nCType)
 
bool GetColumnVarTime (SQL_COLUMN_t iColumn, OUT cVariant &vValRet)
 
bool GetColumnVarText (SQL_COLUMN_t iColumn, OUT cVariant &vValRet)
 
bool GetColumnVarBlob (SQL_COLUMN_t iColumn, cSQLColumnInfo *pColInfo, OUT cVariant &vValRet)
 
virtual bool GetColumnVar (SQL_COLUMN_t iColumn, cSQLColumnInfo *pColInfo, OUT cVariant &vValRet)
 
 IUNKNOWN_DISAMBIG (SUPER_t)
 
virtual HRESULT FillException (cSQLException *pException=nullptr) override
 
- Public Member Functions inherited from GrayLib::cODBCBase
 cODBCBase (SQLSMALLINT nSQLHandleType, cODBCBase *pParent)
 
virtual ~cODBCBase ()
 
bool isSQLRetOK2 () const noexcept
 
 IUNKNOWN_DISAMBIG (SUPER_t)
 
- Public Member Functions inherited from Gray::cRefBase
 cRefBase (int iRefCount=0) noexcept
 
virtual ~cRefBase ()
 
int get_RefCount () const noexcept
 
HASHCODE_t get_HashCode () const noexcept
 
 STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept
 
virtual void onFinalRelease ()
 
bool isValidObj () const noexcept
 
 STDMETHOD_ (ULONG, AddRef)(void) override
 
 STDMETHOD_ (ULONG, Release)(void) override
 
STDMETHOD() QueryInterface (const IID &riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
 
void IncRefCount ()
 
void DecRefCount ()
 
bool isStaticConstruct () const noexcept
 
void StaticConstruct ()
 
void StaticDestruct ()
 
bool isDestructing () noexcept
 
void SetDestructing ()
 

Static Public Member Functions

static SQL_TYPE_t GRAYCALL UpdateColType (cSQLColumnInfo *pColInfo)
 

Friends

class cODBCDatabase
 

Additional Inherited Members

- Public Attributes inherited from GrayLib::cODBCBase
const SQLSMALLINT m_nSQLHandleType
 SQL_HANDLE_STMT, SQL_HANDLE_DBC, SQL_HANDLE_ENV. More...
 
SQLHANDLE m_hSQL
 void* SQL_NULL_HANDLE More...
 
SQLRETURN m_nSQLRet
 SQL_SUCCESS. More...
 

Detailed Description

SQL_HANDLE_STMT

Constructor & Destructor Documentation

◆ cODBCStatement()

GrayLib::cODBCStatement::cODBCStatement ( cODBCBase pParent,
const cSQLCmd oCmd 
)
inline

Member Function Documentation

◆ CloseStatement()

HRESULT GrayLib::cODBCStatement::CloseStatement ( bool  bDrop)
overridevirtual

ISQLStatement Alternate / Replaces ::SQLFreeHandle() for SQL_HANDLE_STMT handle type.

◆ ExecCancel()

void GrayLib::cODBCStatement::ExecCancel ( )
overridevirtual

◆ ExecuteAndFetch()

HRESULT GrayLib::cODBCStatement::ExecuteAndFetch ( bool  bResultsExpected)
overridevirtual

ISQLStatement maybe SQL_ATTR_AUTOCOMMIT is in effect? This command may or may not have a data response. select vs insert or exec etc.

◆ FetchNext()

HRESULT GrayLib::cODBCStatement::FetchNext ( bool  bMore = false)
overridevirtual

ISQLStatement

Are there more results for the fetch? Current fetch returned HResult(FACILITY_WIN32,ERROR_DS_BUSY). Not really sure why this happens.

◆ FillException()

virtual HRESULT GrayLib::cODBCStatement::FillException ( cSQLException pException = nullptr)
inlineoverridevirtual

Reimplemented from GrayLib::cODBCBase.

◆ GetColumnVar()

bool GrayLib::cODBCStatement::GetColumnVar ( SQL_COLUMN_t  iColumn,
cSQLColumnInfo pColInfo,
OUT cVariant vValRet 
)
virtual

ISQLStatement Get a field value as a cVariant.

◆ GetColumnVarBlob()

bool GrayLib::cODBCStatement::GetColumnVarBlob ( SQL_COLUMN_t  iColumn,
cSQLColumnInfo pColInfo,
OUT cVariant vValRet 
)

◆ GetColumnVarNumber()

bool GrayLib::cODBCStatement::GetColumnVarNumber ( SQL_COLUMN_t  iColumn,
cSQLColumnInfo pColInfo,
OUT cVariant vValRet,
SQL_TYPE_t  nCType 
)

Get a field value as a cVariant. fixed length types can just be poked directly into memory.

◆ GetColumnVarText()

bool GrayLib::cODBCStatement::GetColumnVarText ( SQL_COLUMN_t  iColumn,
OUT cVariant vValRet 
)

◆ GetColumnVarTime()

bool GrayLib::cODBCStatement::GetColumnVarTime ( SQL_COLUMN_t  iColumn,
OUT cVariant vValRet 
)

◆ GetData_Raw()

void GrayLib::cODBCStatement::GetData_Raw ( SQL_COLUMN_t  iColumn,
SQL_TYPE_t  nType,
OUT void *  pBuffer,
size_t  nSizeBuffer,
OUT INT_PTR *  pnSizeRet 
)

◆ IUNKNOWN_DISAMBIG()

GrayLib::cODBCStatement::IUNKNOWN_DISAMBIG ( SUPER_t  )

◆ ReadColumnCount()

ITERATE_t GrayLib::cODBCStatement::ReadColumnCount ( )
overridevirtual

ISQLStatement Get number of columns not including column 0.

Note
This was SQLNumResultCols()?

◆ ReadColumnInfo()

bool GrayLib::cODBCStatement::ReadColumnInfo ( SQL_COLUMN_t  iColumn,
OUT cSQLColumnInfo info 
)
overridevirtual

◆ SetSQLAttr()

bool GrayLib::cODBCStatement::SetSQLAttr ( long  nAttribute,
void *  pValue 
)
overridevirtual

cODBCBase

  • nAttribute = SQL_ATTR_CURSOR_SCROLLABLE

Implements GrayLib::cODBCBase.

◆ UpdateColType()

SQL_TYPE_t GRAYCALL GrayLib::cODBCStatement::UpdateColType ( cSQLColumnInfo pColInfo)
static

Convert SQL_INTEGER to SQL_C_SLONG

Friends And Related Function Documentation

◆ cODBCDatabase

friend class cODBCDatabase
friend

The documentation for this class was generated from the following files: