![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cSQLStatement.h>
Public Member Functions | |
| cSQLStatementQ () | |
| virtual | ~cSQLStatementQ () |
| SQL_TYPE_t | SetColumnType (SQL_COLUMN_t iColumn, SQL_TYPE_t eType) |
| SQL_TYPE_t | RemoveColumn (SQL_COLUMN_t iColumn) |
| virtual HRESULT | ExecuteAndFetch (cSQLDatabase *pDatabase, cSQLCmd &oCmd, cExceptionHolder *pExceptionRet=nullptr) override |
| virtual HRESULT | FetchNext (bool bWaitIfBusy=false) override |
| virtual bool | GetColumnVar (SQL_COLUMN_t iColumn, OUT cVariant &vVal) override |
| bool | GetColumnVar (const char *pszFieldName, OUT cVariant &vVal) |
| STDMETHOD() | s_GetEnum (ITERATE_t i, OUT cStringA &rsPropName, OUT cVariant &rvValRet) override |
| STDMETHOD() | s_GetByName (const ATOMCHAR_t *pszPropName, OUT cVariant &vValRet) override |
Public Member Functions inherited from GrayLib::cSQLStatement | |
| cSQLStatement () | |
| virtual | ~cSQLStatement () |
| bool | isConnected () const |
| virtual cSQLDriver * | get_SQLDriver () const |
| What driver ultimately owns this? More... | |
| virtual cSQLBase * | get_SQLParent () const |
| void | ExecCancel () |
| bool | CloseStatement (bool bDrop=true, bool bThrowOnError=false) |
| bool | Close () |
| SQL_COLUMN_t | GetColumnCount () |
| cSQLColumnInfo * | GetColumnInfo (SQL_COLUMN_t iColumn=k_SQL_COL_FIRST) |
| SQL_COLUMN_t | FindColumn (const char *pszFieldName) |
| SQL_COLUMN_t | VerifyColumn (SQL_COLUMN_t iColumn, const char *pszFieldName) |
| bool | GetColumnString (SQL_COLUMN_t iColumn, OUT cStringA &sResult) |
| Get the data. string/chars is sometimes a special case here. More... | |
| cStringA | GetColumnStr (SQL_COLUMN_t iColumn=k_SQL_COL_FIRST) |
| int | GetColumnInt (SQL_COLUMN_t iColumn=k_SQL_COL_FIRST) |
| STDMETHOD() | s_GetEnum (ITERATE_t i, OUT cStringA &rsPropName, OUT cVariant &vValRet) override |
| cStringA | GetColumnStr (const char *pszFieldName) |
| These are slightly dangerous to use. you MUST know the order of the select in advance! (or use cSQLStatementQ) More... | |
| int | GetColumnInt (const char *pszFieldName) |
| bool | GetColumnVar (const char *pszFieldName, OUT cVariant &vVal) |
Public Member Functions inherited from GrayLib::cSQLBase | |
| virtual | ~cSQLBase () |
| HRESULT | FillException (cExceptionHolder &exh, cStringA sCommand, const cDebugSourceLine &src) const |
| HRESULT | ReturnError1 (cExceptionHolder &exh) const |
| HRESULT | ReturnError2 (cStringA sCommand, const cDebugSourceLine &src) const |
| bool | isISQLValid () const |
| The SQL handle. More... | |
| ITERATE_t | get_ChildHandleCount () const noexcept |
Public Member Functions inherited from Gray::CObject | |
| virtual | ~CObject () |
| virtual bool | isValidCheck () const noexcept |
| < memory allocation and structure definitions are valid. More... | |
| virtual void | AssertValid () const |
| < memory allocation and structure definitions are valid. More... | |
| virtual void | Serialize (cArchive &a) |
Public Attributes | |
| cArrayStruct< cVariant > | m_aColumnData |
| store data values for fields/columns. SQL_COLUMN_t = 1 based array More... | |
Public Attributes inherited from GrayLib::cSQLStatement | |
| cStringA | m_sFromTable |
| usually the table name. used for error text. More... | |
Public Attributes inherited from GrayLib::cSQLBase | |
| bool | m_bLogOnError |
| I want to log message if error. More... | |
Protected Member Functions | |
| int | ReadRecordset () |
Protected Member Functions inherited from GrayLib::cSQLStatement | |
| ISQLStatement * | get_ISQLStatement () const |
| ITERATE_t | ReadColumnCount () |
| bool | ReadColumnInfo (SQL_COLUMN_t iColumn, OUT cSQLColumnInfo &info) |
| ODBC data type (SQL_C_BINARY) More... | |
| bool | AllocISQLStatement (const cSQLCmd &oCmd) |
Protected Member Functions inherited from GrayLib::cSQLBase | |
| bool | AttachISQL (ISQLBase *pSQL) |
| void | FreeISQL () |
| bool | FreeISQLTested () |
| cSQLBase () | |
Protected Member Functions inherited from Gray::cNonCopyable | |
| cNonCopyable () noexcept | |
| Force the use of Factory creation via protected constructor. More... | |
| ~cNonCopyable () noexcept | |
Additional Inherited Members | |
Static Public Member Functions inherited from GrayLib::cSQLBase | |
| static const FILECHAR_t *GRAYCALL | RemoveDriverIdentification (const FILECHAR_t *pszError) |
Protected Attributes inherited from GrayLib::cSQLStatement | |
| cSQLDatabasePtr | m_pDatabase |
| parent/source Database. More... | |
| cArrayStruct< cSQLColumnInfo > | m_aColumnInfo |
| store metadata/description of the fields selected. 1 based. More... | |
Protected Attributes inherited from GrayLib::cSQLBase | |
| cIUnkPtr< ISQLBase > | m_pISQL |
| ISQLBase to some SQL implementation object -> a Driver/environment, connection or recordset/statement. More... | |
The results of a select query. Similar to .NET SQLTable. Queue up all the data fields returned for a Row. such that Props/Fields can be read in random order. Defeats the sequential field read requirement.
| GrayLib::cSQLStatementQ::cSQLStatementQ | ( | ) |
|
virtual |
|
overridevirtual |
Reimplemented from GrayLib::cSQLStatement.
|
overridevirtual |
fetches the next rowset of data from the result set and returns data for all bound columns Called after ExecuteAndFetch() repeat calling this until we get all rows.
Reimplemented from GrayLib::cSQLStatement.
|
inline |
Get column by name.
|
overridevirtual |
Reimplemented from GrayLib::cSQLStatement.
|
protected |
get all field/column results of a query row at once. cache all the data from all the columns into variants.
| SQL_TYPE_t GrayLib::cSQLStatementQ::RemoveColumn | ( | SQL_COLUMN_t | iColumn | ) |
setting to type SQL_TYPE_NULL will mean just ignore it.
|
override |
|
override |
TODO random access
| SQL_TYPE_t GrayLib::cSQLStatementQ::SetColumnType | ( | SQL_COLUMN_t | iColumn, |
| SQL_TYPE_t | eType | ||
| ) |
Alter the column type as recorded. usually used for RemoveColumn()
| cArrayStruct<cVariant> GrayLib::cSQLStatementQ::m_aColumnData |
store data values for fields/columns. SQL_COLUMN_t = 1 based array