13 #include "../Variant/cVariant.h"
14 #include "../Variant/cVarMap.h"
83 m_sCommand = sCommand;
89 virtual void ResetCommand();
92 static bool GRAYCALL IsValueTime(
const char* pszVal);
130 void SetWhereParenthesis();
132 void AddWhereCmd(
const char* pszWhereCmd,
bool bUseOr =
false);
142 void ResetCommandWhere();
164 virtual void ResetCommand()
override;
207 void SetCount(
const char* pszColumnName =
nullptr);
208 void SetCountWhereInt(
const char* pszColumnName,
int iValue);
210 void AddSelectCol(
const char* pszColumnName);
211 void _cdecl SetSelectColsF(
const char* pszColumnName, ...);
214 void put_GroupBy(
cStringA sColumnName);
215 void put_OrderBy(
cStringA sColumnName);
216 void put_Limit(
int iLimit=1);
218 virtual void ResetCommand()
override;
239 SUPER_t::ResetCommand();
256 virtual void ResetCommand()
override;
257 void MakeCommandInsert(
const cSQLConfigCmd& cfg,
bool bFieldNames =
true);
261 return(m_Values.
m_aTuples.GetSize() > 0);
302 virtual void ResetCommand()
override;
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
Definition: cSQLCmd.h:146
virtual SQLCMD_TYPE get_CmdType() const override
Definition: cSQLCmd.h:160
Definition: cSQLCmd.h:223
virtual SQLCMD_TYPE get_CmdType() const override
Definition: cSQLCmd.h:234
cSQLCmdWhere m_Where
Definition: cSQLCmd.h:230
virtual void ResetCommand() override
Definition: cSQLCmd.h:236
Definition: cSQLCmd.h:169
virtual SQLCMD_TYPE get_CmdType() const override
Definition: cSQLCmd.h:175
Definition: cSQLCmd.h:246
cVarMap m_Values
Named Fields and Values to set. allow me to poke stuff into this list directly. Similar to m_aParams ...
Definition: cSQLCmd.h:252
void AddColumn(const char *pszColumnName, const cVariant &vVal)
Definition: cSQLCmd.h:263
bool HasColumns() const
Definition: cSQLCmd.h:259
Definition: cSQLCmd.h:272
virtual SQLCMD_TYPE get_CmdType() const override
Definition: cSQLCmd.h:282
Definition: cSQLCmd.h:180
cStringA m_sGroupBy
Definition: cSQLCmd.h:193
cSQLCmdWhere m_Where
Definition: cSQLCmd.h:189
virtual bool isResultsExpected() const
Definition: cSQLCmd.h:202
cStringA m_sOrderBy
Definition: cSQLCmd.h:194
cStringA m_sSelect
What fields should be returned from Table and joins?
Definition: cSQLCmd.h:192
virtual SQLCMD_TYPE get_CmdType() const override
Definition: cSQLCmd.h:201
ITERATE_t m_iLimit
'TOP' if MSSQL or 'LIMIT' if MySQL. Should always be used with 'order by'. m_sOrderBy
Definition: cSQLCmd.h:195
Definition: cSQLCmd.h:288
virtual SQLCMD_TYPE get_CmdType() const override
Definition: cSQLCmd.h:300
cSQLCmdWhere m_Where
What records am i updating?
Definition: cSQLCmd.h:295
Definition: cSQLCmd.h:114
void ResetCommandWhere()
Definition: cSQLCmdWhere.cpp:192
static const char *const k_Param
Definition: cSQLCmd.h:121
cStringA get_Command() const
Definition: cSQLCmd.h:75
virtual void MakeCommand(const cSQLConfigCmd &cfg)=0
build the string from our args.
void put_Table(cStringA sTable)
Definition: cSQLCmd.h:64
void put_Command(cStringA sCommand)
Definition: cSQLCmd.h:80
virtual bool isResultsExpected() const
Definition: cSQLCmd.h:53
static const char * k_pszNULL
Definition: cSQLCmd.h:42
virtual SQLCMD_TYPE get_CmdType() const =0
cStringA m_sTable
The table ( 'From' if select ), delete, create.
Definition: cSQLCmd.h:45
cStringA m_sCommand
The resultant full SQL command. use MakeCommand() to build this up.
Definition: cSQLCmd.h:46
bool isCommandMade() const
Definition: cSQLCmd.h:71
cStringA get_Table() const
Definition: cSQLCmd.h:59
void ResetCommand0()
Definition: cSQLCmd.h:85
Definition: cSQLConfig.h:55
Definition: cVarMap.h:109
cArraySortHash< cVarTuple, ATOMCODE_t > m_aTuples
Hash sorted by ATOMCODE_t. NOT alphabetic sort.
Definition: cVarMap.h:115
HRESULT SetValVar(const ATOMCHAR_t *pszKey, const cVariant &vVal)
Definition: cVarMap.cpp:303
Definition: cVariant.h:26
bool IsEmpty() const noexcept
Definition: cString.h:176
Definition: cTimeDouble.h:21
VARTYPE_TYPE
< define types of structure/record elements. (COM uses VARTYPE=VARENUM for this) stored as BYTE
Definition: cVariantType.h:19
class __DECL_IMPORT cSQLCmdWhere
Definition: cSQLDatabase.h:22
SQLCMD_TYPE
Definition: cSQLCmd.h:22
@ SQLCMD_Delete
Delete selected rows.
Definition: cSQLCmd.h:30
@ SQLCMD_Create
Create a table.
Definition: cSQLCmd.h:27
@ SQLCMD_Update
Update existing row in the db. (similar to select + insert)
Definition: cSQLCmd.h:32
@ SQLCMD_Select
Return a selected set based on where criteria.
Definition: cSQLCmd.h:29
@ SQLCMD_Drop
Drop a table.
Definition: cSQLCmd.h:28
@ SQLCMD_Insert
Write a row into the db.
Definition: cSQLCmd.h:31
@ SQLCMD_SProc
Exec a stored procedure. May (or may not) return stuff or do anything.
Definition: cSQLCmd.h:26
class __DECL_IMPORT cSQLCmd
Definition: cSQLDatabase.h:20
SQL_COMPARE_TYPE
Definition: cSQLCmd.h:98
@ SQL_COMPARE_LessThan
Definition: cSQLCmd.h:103
@ SQL_COMPARE_Equals
Definition: cSQLCmd.h:101
@ SQL_COMPARE_Like
Definition: cSQLCmd.h:107
@ SQL_COMPARE_LessThanE
Definition: cSQLCmd.h:105
@ SQL_COMPARE_GreaterThanE
Definition: cSQLCmd.h:104
@ SQL_COMPARE_IS_NULL
Definition: cSQLCmd.h:108
@ SQL_COMPARE_IS_NOT_NULL
Definition: cSQLCmd.h:109
@ SQL_COMPARE_QTY
Definition: cSQLCmd.h:110
@ SQL_COMPARE_NotEqual
Definition: cSQLCmd.h:106
@ SQL_COMPARE_GreaterThan
Definition: cSQLCmd.h:102
class __DECL_IMPORT cSQLCmdUpdate
Definition: cSQLDatabase.h:21
int ITERATE_t
like size_t but signed
Definition: Index.h:28