|
void | insert () |
| Insert a new record. More...
|
|
void | loadTable () |
| Reload the table. More...
|
|
Record & | newRec () |
| Return a reference to a Record object for insert. More...
|
|
Table & | operator= (const Table &) |
| Declared to avoid using of default assignment operator. More...
|
|
void | replace () |
| Insert (or replace) a new record. More...
|
|
| Table (const Table &) |
| Declared to avoid using of default copy constructor. More...
|
|
| Table (DBConn *db, string table, string fieldkey) |
| Constructor. More...
|
|
void | update () |
| Update the current record. More...
|
|
| ~Table () |
| Destructor. More...
|
|
void | close () |
| Close the statement and frees anything has been allocated. More...
|
|
void | customFillBuffer (char *buf, unsigned int &chunksize, bool firstTime) |
| Fills a buffer with a result-set. More...
|
|
void | execute (bool StoreResult=false) |
| Execute the prepared statement. More...
|
|
vector< string > | ExecutionDetails (string pre="") |
| Returns a vector of strings containing details of query execution. More...
|
|
bool | gotRecordSet () |
|
long long int | last_id () |
| Returns the last value generated for an AUTO_INCREMENT column. More...
|
|
Data & | lookup (string field, string table, string where="") |
| Returns the current record set. More...
|
|
unsigned int | nAffectedRows () |
| Returns number of affected records by the last execute() call. More...
|
|
Query & | operator= (const Query &) |
| Declared to avoid using of default assignment operator. More...
|
|
Record & | param () |
| Returns a reference to a Record object containing all the input parameters. More...
|
|
void | prepare (string SQL="") |
| Prepare the SQL statement. More...
|
|
void | prepare_with_parameters (int op, string fields, string table, string where="", int nrec=1) |
| Prepare a query with input parameters. More...
|
|
void | prepare_with_parameters (int op, char **fields, int nfields, string table, string where="", int nrec=1) |
| Wrapper around prepare_with_parameters(int, string, string, string). More...
|
|
| Query (const Query &) |
| Declared to avoid using of default copy constructor. More...
|
|
| Query (DBConn *lconn, bool call_newDBConn=false) |
| Constructor. More...
|
|
void | query (string SQL, bool StoreResult=false) |
| Wrapper aropund prepare() and execute(). More...
|
|
void | readTableList () |
| Reads the list of tables in the current database. More...
|
|
void | Result2Ascii (string fn) |
| Writes a table into an ASCII file using the customFillBuffer() method. More...
|
|
vector< string > | simpleQuery (string SQL, unsigned int &nrows, unsigned int &nfields) |
| Execute a query and return result in a vector of strings. More...
|
|
vector< string > | simpleQuery (string SQL) |
| Wrapper for simpleQuery(string, unsigned int&, unsigned int&). More...
|
|
vector< string > | tableInfo (string tbl) |
| Retrieve information about a table. More...
|
|
| ~Query () |
|
bool | alwaysSameStructure () |
|
void | dump (string fn) |
|
bool | eof () |
|
void | insert (Record *rec) |
| Insert a new record in the set. More...
|
|
void | insert (Record &rec) |
| Copy a new record in the set. More...
|
|
bool | know_nRows () |
|
Record & | metarec () |
|
int | nFields () |
| Returns number of fields. More...
|
|
unsigned int | nRows () |
|
RecordSet & | operator= (const RecordSet &) |
| Declared to avoid using of default assignment operator. More...
|
|
unsigned int | pos () |
|
Record * | prepRecToSend () |
|
Record & | rec () |
|
| RecordSet (const RecordSet &) |
| Declared to avoid using of default copy constructor. More...
|
|
| RecordSet () |
| Build an empty record set. More...
|
|
void | setFieldMap (string s="") |
| Set up a field map for each record in the recordset. More...
|
|
bool | setFirst () |
| Set the record pointer to the first position. More...
|
|
bool | setLast () |
| Set the record pointer to the last position. More...
|
|
bool | setNext () |
| Set the record pointer to the next position. More...
|
|
bool | setPos (unsigned int i) |
| Set the record pointer to the i-th position. More...
|
|
bool | setPrev () |
| Set the record pointer to the previous position in the set. More...
|
|
bool | setWhere (int i, string equalTo) |
| Set the record pointer to the position which satisfies a string condition. More...
|
|
bool | setWhere (int field, int equalTo) |
| Set the record pointer to the position which satisfies an integer condition. More...
|
|
virtual | ~RecordSet () |
| Destructor. More...
|
|
A class to directly set and retrieve value from a database table.
This class gives you direct access to the value of a table. Direct access means that you can use setFirst(), setLast(), setWhere() method of Query to find a specific record. While you can retrieve the values from the table with the usual rec() method you can also update the table. To update you need to move the record pointer to the record you want to update, then insert the new values using the rec() method, and call the update() method. Finally you can insert new records setting values in the internal array of Data through the newRec() method, and call insert();
- Warning
- For this class to work correctly the table must have a unique key on one integer field.
Definition at line 5999 of file mcs.hh.