ROOT logo
ROOT » SQL » MYSQL » TMySQLStatement

class TMySQLStatement: public TSQLStatement


SQL statement class for MySQL

See TSQLStatement class documentation for more details.


Function Members (Methods)

public:
TMySQLStatement(const TMySQLStatement&)
TMySQLStatement(MYSQL_STMT* stmt, Bool_t errout = kTRUE)
virtual~TMySQLStatement()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual voidClose(Option_t* = "")
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTSQLStatement::EnableErrorOutput(Bool_t on = kTRUE)
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
static unsigned longGetAllocSizeLimit()
virtual Bool_tGetBinary(Int_t npar, void*& mem, Long_t& size)
virtual Int_tGetBufferLength() const
virtual Bool_tGetDate(Int_t npar, Int_t& year, Int_t& month, Int_t& day)
virtual Bool_tGetDatime(Int_t npar, Int_t& year, Int_t& month, Int_t& day, Int_t& hour, Int_t& min, Int_t& sec)
Int_tTSQLStatement::GetDay(Int_t)
virtual Double_tGetDouble(Int_t npar)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Int_tTSQLStatement::GetErrorCode() const
virtual const char*TSQLStatement::GetErrorMsg() const
virtual const char*GetFieldName(Int_t nfield)
Int_tTSQLStatement::GetHour(Int_t)
virtual const char*TObject::GetIconName() const
virtual Int_tGetInt(Int_t npar)
virtual Long_tGetLong(Int_t npar)
virtual Long64_tGetLong64(Int_t npar)
Int_tTSQLStatement::GetMinute(Int_t)
Int_tTSQLStatement::GetMonth(Int_t)
virtual const char*TObject::GetName() const
virtual Int_tGetNumAffectedRows()
virtual Int_tGetNumFields()
virtual Int_tGetNumParameters()
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Int_tTSQLStatement::GetSecond(Int_t)
virtual const char*GetString(Int_t npar)
virtual Bool_tGetTime(Int_t npar, Int_t& hour, Int_t& min, Int_t& sec)
virtual Bool_tGetTimestamp(Int_t npar, Int_t& year, Int_t& month, Int_t& day, Int_t& hour, Int_t& min, Int_t& sec, Int_t&)
virtual const char*TObject::GetTitle() const
virtual UInt_tGetUInt(Int_t npar)
virtual ULong64_tGetULong64(Int_t npar)
virtual UInt_tTObject::GetUniqueID() const
Int_tTSQLStatement::GetYear(Int_t)
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTSQLStatement::IsError() const
virtual Bool_tTObject::IsFolder() const
virtual Bool_tIsNull(Int_t npar)
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tNextIteration()
virtual Bool_tNextResultRow()
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TMySQLStatement&operator=(const TMySQLStatement&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Bool_tProcess()
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
static voidSetAllocSizeLimit(unsigned long sz)
virtual Bool_tSetBinary(Int_t npar, void* mem, Long_t size, Long_t maxsize = 0x1000)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual Bool_tSetDate(Int_t npar, Int_t year, Int_t month, Int_t day)
virtual Bool_tSetDatime(Int_t npar, Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec)
virtual Bool_tSetDouble(Int_t npar, Double_t value)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual Bool_tSetInt(Int_t npar, Int_t value)
virtual Bool_tSetLong(Int_t npar, Long_t value)
virtual Bool_tSetLong64(Int_t npar, Long64_t value)
virtual Bool_tTSQLStatement::SetMaxFieldSize(Int_t, Long_t)
virtual Bool_tSetNull(Int_t npar)
static voidTObject::SetObjectStat(Bool_t stat)
virtual Bool_tSetString(Int_t npar, const char* value, Int_t maxsize = 256)
virtual Bool_tSetTime(Int_t npar, Int_t hour, Int_t min, Int_t sec)
virtual voidTSQLStatement::SetTimeFormating(const char*)
virtual Bool_tSetTimestamp(Int_t npar, Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec, Int_t frac = 0)
virtual Bool_tSetUInt(Int_t npar, UInt_t value)
virtual Bool_tSetULong64(Int_t npar, ULong64_t value)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp)
virtual Bool_tStoreResult()
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
void*BeforeSet(const char* method, Int_t npar, Int_t sqltype, Bool_t sig = kTRUE, unsigned long size = 0)
voidTSQLStatement::ClearError()
long doubleConvertToNumeric(Int_t npar)
const char*ConvertToString(Int_t npar)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidFreeBuffers()
Bool_tIsResultSetMode() const
Bool_tIsSetParsMode() const
voidTObject::MakeZombie()
voidSetBuffersNumber(Int_t n)
voidTSQLStatement::SetError(Int_t code, const char* msg, const char* method = 0)
Bool_tSetSQLParamType(Int_t npar, int sqltype, bool sig, unsigned long sqlsize = 0)

Data Members

protected:
MYSQL_BIND*fBind! array of bind data
TMySQLStatement::TParamData*fBuffer! parameter definition structures
Int_tTSQLStatement::fErrorCodeerror code of last operation
TStringTSQLStatement::fErrorMsgerror message of last operation
Bool_tTSQLStatement::fErrorOutenable error output
Int_tfIterationCount! number of iteration
Bool_tfNeedParBind! indicates when parameters bind should be called
Int_tfNumBuffers! number of statement parameters
MYSQL_STMT*fStmt! executed statement
Int_tfWorkingMode! 1 - setting parameters, 2 - retrieving results
static ULong64_tfgAllocSizeLimit

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TMySQLStatement(MYSQL_STMT* stmt, Bool_t errout = kTRUE)
 Normal constructor.
 Checks if statement contains parameters tags.
~TMySQLStatement()
 Destructor.
void Close(Option_t* = "")
 Close statement.
Bool_t Process()
 Process statement.
Int_t GetNumAffectedRows()
 Return number of affected rows after statement is processed.
Int_t GetNumParameters()
 Return number of statement parameters.
Bool_t StoreResult()
 Store result of statement processing to access them
 via GetInt(), GetDouble() and so on methods.
Int_t GetNumFields()
 Return number of fields in result set.
const char* GetFieldName(Int_t nfield)
 Returns field name in result set.
Bool_t NextResultRow()
 Shift cursor to nect row in result set.
Bool_t NextIteration()
 Increment iteration counter for statement, where parameter can be set.
 Statement with parameters of previous iteration
 automatically will be applied to database.
void FreeBuffers()
 Release all buffers, used by statement.
void SetBuffersNumber(Int_t n)
 Allocate buffers for statement parameters/ result fields.
const char* ConvertToString(Int_t npar)
 Convert field value to string.
long double ConvertToNumeric(Int_t npar)
 Convert field to numeric value.
Bool_t IsNull(Int_t npar)
 Checks if field value is null.
Int_t GetInt(Int_t npar)
 Return field value as integer.
UInt_t GetUInt(Int_t npar)
 Return field value as unsigned integer.
Long_t GetLong(Int_t npar)
 Return field value as long integer.
Long64_t GetLong64(Int_t npar)
 Return field value as 64-bit integer.
ULong64_t GetULong64(Int_t npar)
 Return field value as unsigned 64-bit integer.
Double_t GetDouble(Int_t npar)
 Return field value as double.
const char * GetString(Int_t npar)
 Return field value as string.
Bool_t GetBinary(Int_t npar, void*& mem, Long_t& size)
 Return field value as binary array.
Bool_t GetDate(Int_t npar, Int_t& year, Int_t& month, Int_t& day)
 Return field value as date.
Bool_t GetTime(Int_t npar, Int_t& hour, Int_t& min, Int_t& sec)
 Return field value as time.
Bool_t GetDatime(Int_t npar, Int_t& year, Int_t& month, Int_t& day, Int_t& hour, Int_t& min, Int_t& sec)
 Return field value as date & time.
Bool_t GetTimestamp(Int_t npar, Int_t& year, Int_t& month, Int_t& day, Int_t& hour, Int_t& min, Int_t& sec, Int_t& )
 Return field value as time stamp.
Bool_t SetSQLParamType(Int_t npar, int sqltype, bool sig, unsigned long sqlsize = 0)
 Set parameter type to be used as buffer.
 Used in both setting data to database and retriving data from data base.
 Initialize proper MYSQL_BIND structure and allocate required buffers.
void * BeforeSet(const char* method, Int_t npar, Int_t sqltype, Bool_t sig = kTRUE, unsigned long size = 0)
 Check boundary condition before setting value of parameter.
 Return address of parameter buffer.
Bool_t SetNull(Int_t npar)
 Set NULL as parameter value.
 If NULL should be set for statement parameter during first iteration,
 one should call before proper Set... method to identify type of argument for
 the future. For instance, if one suppose to have double as type of parameter,
 code should look like:
    stmt->SetDouble(2, 0.);
    stmt->SetNull(2);
Bool_t SetInt(Int_t npar, Int_t value)
 Set parameter value as integer.
Bool_t SetUInt(Int_t npar, UInt_t value)
 Set parameter value as unsigned integer.
Bool_t SetLong(Int_t npar, Long_t value)
 Set parameter value as long integer.
Bool_t SetLong64(Int_t npar, Long64_t value)
 Set parameter value as 64-bit integer.
Bool_t SetULong64(Int_t npar, ULong64_t value)
 Set parameter value as unsigned 64-bit integer.
Bool_t SetDouble(Int_t npar, Double_t value)
 Set parameter value as double.
Bool_t SetString(Int_t npar, const char* value, Int_t maxsize = 256)
 Set parameter value as string.
Bool_t SetBinary(Int_t npar, void* mem, Long_t size, Long_t maxsize = 0x1000)
 Set parameter value as binary data.
Bool_t SetDate(Int_t npar, Int_t year, Int_t month, Int_t day)
 Set parameter value as date.
Bool_t SetTime(Int_t npar, Int_t hour, Int_t min, Int_t sec)
 Set parameter value as time.
Bool_t SetDatime(Int_t npar, Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec)
 Set parameter value as date & time.
Bool_t SetTimestamp(Int_t npar, Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec, Int_t frac = 0)
 Set parameter value as timestamp.
TMySQLStatement(MYSQL_STMT* stmt, Bool_t errout = kTRUE)
 Normal constructor.
 For MySQL version < 4.1 no statement is supported
Bool_t IsSetParsMode() const
{ return fWorkingMode==1; }
Bool_t IsResultSetMode() const
{ return fWorkingMode==2; }
unsigned long GetAllocSizeLimit()
{ return fgAllocSizeLimit; }
void SetAllocSizeLimit(unsigned long sz)
Int_t GetBufferLength() const
{ return 1; }