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

#include <cSQLCmd.h>

Inheritance diagram for GrayLib::cSQLCmd:
GrayLib::cSQLCmdCreate GrayLib::cSQLCmdDelete GrayLib::cSQLCmdDrop GrayLib::cSQLCmdInsertBase GrayLib::cSQLCmdSelect GrayLib::cSQLCmdInsert GrayLib::cSQLCmdUpdate

Public Member Functions

 cSQLCmd (cStringA sTableName="", cStringA sCommand="")
 
virtual ~cSQLCmd ()
 
virtual SQLCMD_TYPE get_CmdType () const =0
 
virtual bool isResultsExpected () const
 
cStringA get_Table () const
 
void put_Table (cStringA sTable)
 
bool isCommandMade () const
 
cStringA get_Command () const
 
void put_Command (cStringA sCommand)
 
void ResetCommand0 ()
 
virtual void ResetCommand ()
 
virtual void MakeCommand (const cSQLConfigCmd &cfg)=0
 build the string from our args. More...
 

Static Public Member Functions

static bool GRAYCALL IsValueTime (const char *pszVal)
 
static cStringA GRAYCALL MakeValueTime (const cSQLConfigCmd &cfg, const cTimeDouble &date)
 
static cStringA GRAYCALL MakeValueStr (const cSQLConfigCmd &cfg, const cVariant &vVal)
 

Static Public Attributes

static const char * k_pszNULL = "NULL"
 

Protected Attributes

cStringA m_sTable
 The table ( 'From' if select ), delete, create. More...
 
cStringA m_sCommand
 The resultant full SQL command. use MakeCommand() to build this up. More...
 

Detailed Description

base class for building up a SQL command line of any SQLCMD_TYPE. Select, insert, delete, update, create, drop, exec procedure. base for cSQLCmdWhere and cSQLCmdInsert, (and cSQLCmdDelete indirectly)

Constructor & Destructor Documentation

◆ cSQLCmd()

GrayLib::cSQLCmd::cSQLCmd ( cStringA  sTableName = "",
cStringA  sCommand = "" 
)

◆ ~cSQLCmd()

GrayLib::cSQLCmd::~cSQLCmd ( )
virtual

Member Function Documentation

◆ get_CmdType()

virtual SQLCMD_TYPE GrayLib::cSQLCmd::get_CmdType ( ) const
pure virtual

◆ get_Command()

cStringA GrayLib::cSQLCmd::get_Command ( ) const
inline

ASSUME MakeCommand() was called.

◆ get_Table()

cStringA GrayLib::cSQLCmd::get_Table ( ) const
inline

Get the left table.

◆ isCommandMade()

bool GrayLib::cSQLCmd::isCommandMade ( ) const
inline

◆ isResultsExpected()

virtual bool GrayLib::cSQLCmd::isResultsExpected ( ) const
inlinevirtual

Was this a query?

Reimplemented in GrayLib::cSQLCmdSelect.

◆ IsValueTime()

bool GRAYCALL GrayLib::cSQLCmd::IsValueTime ( const char *  pszVal)
static

Check if it's an ODBC date string and process it as is. Add the remaining data to the right side of the comparison.

◆ MakeCommand()

virtual void GrayLib::cSQLCmd::MakeCommand ( const cSQLConfigCmd cfg)
pure virtual

◆ MakeValueStr()

cStringA GRAYCALL GrayLib::cSQLCmd::MakeValueStr ( const cSQLConfigCmd cfg,
const cVariant vVal 
)
static

Get a SQL text value from the cVariant. Add quotes or encoding as needed. NULL // null a field. {d'1972-01-15'} // for dates {ts'yyyy-mm-dd hh:mm:ss'} now() // time date

◆ MakeValueTime()

cStringA GRAYCALL GrayLib::cSQLCmd::MakeValueTime ( const cSQLConfigCmd cfg,
const cTimeDouble date 
)
static

Build time as a string that ODBC or other driver would like.

◆ put_Command()

void GrayLib::cSQLCmd::put_Command ( cStringA  sCommand)
inline

just set the string arbitrarily.

◆ put_Table()

void GrayLib::cSQLCmd::put_Table ( cStringA  sTable)
inline

Set the left table.

◆ ResetCommand()

void GrayLib::cSQLCmd::ResetCommand ( )
virtual

Clear just the command and NOT the table

Note
don't clear the m_sTable, set it to a new table if u want.

Reimplemented in GrayLib::cSQLCmdUpdate, GrayLib::cSQLCmdInsertBase, GrayLib::cSQLCmdDelete, GrayLib::cSQLCmdSelect, and GrayLib::cSQLCmdCreate.

◆ ResetCommand0()

void GrayLib::cSQLCmd::ResetCommand0 ( )
inline

Member Data Documentation

◆ k_pszNULL

const char * GrayLib::cSQLCmd::k_pszNULL = "NULL"
static

◆ m_sCommand

cStringA GrayLib::cSQLCmd::m_sCommand
protected

The resultant full SQL command. use MakeCommand() to build this up.

◆ m_sTable

cStringA GrayLib::cSQLCmd::m_sTable
protected

The table ( 'From' if select ), delete, create.


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