|
|||
|
|||
|
#include <m_sqlv2.h>
Inheritance diagram for SQLresult:


Public Member Functions | |
| SQLresult (Module *s, Module *d, unsigned long i) | |
| Used by the SQL API to instantiate an SQLrequest. | |
| virtual int | Rows ()=0 |
| Return the number of rows in the result Note that if you have perfomed an INSERT or UPDATE query or other query which will not return rows, this will return the number of affected rows, and SQLresult::Cols() will contain 0. | |
| virtual int | Cols ()=0 |
| Return the number of columns in the result. | |
| virtual std::string | ColName (int column)=0 |
| Get a string name of the column by an index number. | |
| virtual int | ColNum (const std::string &column)=0 |
| Get an index number for a column from a string name. | |
| virtual SQLfield | GetValue (int row, int column)=0 |
| Get a string value in a given row and column This does not effect the internal cursor. | |
| virtual SQLfieldList & | GetRow ()=0 |
| Return a list of values in a row, this should increment an internal counter so you can repeatedly call it until it returns an empty vector. | |
| virtual SQLfieldMap & | GetRowMap ()=0 |
| As above, but return a map indexed by key name. | |
| virtual SQLfieldList * | GetRowPtr ()=0 |
| Like GetRow(), but returns a pointer to a dynamically allocated object which must be explicitly freed. | |
| virtual SQLfieldMap * | GetRowMapPtr ()=0 |
| As above, but return a map indexed by key name The internal cursor (row counter) is incremented by one. | |
| virtual void | Free (SQLfieldMap *fm)=0 |
| Overloaded function for freeing the lists and maps returned by GetRowPtr or GetRowMapPtr. | |
| virtual void | Free (SQLfieldList *fl)=0 |
| Overloaded function for freeing the lists and maps returned by GetRowPtr or GetRowMapPtr. | |
Public Attributes | |
| std::string | query |
| The original query string passed initially to the SQL API. | |
| std::string | dbid |
| The database ID the query was executed on. | |
| SQLerror | error |
| The error (if any) which occured. | |
| unsigned long | id |
| This will match query ID you were given when sending the request at an earlier time. | |
If you send a query to the SQL api, the response will arrive at your OnRequest method of your module at some later time, depending on the congestion of the SQL server and complexity of the query. The ID of this result will match the ID assigned to your original request. SQLresult contains its own internal cursor (row counter) which is incremented with each method call which retrieves a single row.
Definition at line 301 of file m_sqlv2.h.
|
||||||||||||||||
|
Used by the SQL API to instantiate an SQLrequest.
|
|
|
Get a string name of the column by an index number.
Implemented in MsSQLResult, MySQLresult, PgSQLresult, and SQLite3Result. Referenced by ModuleTestClient::OnRequest(). |
|
|
Get an index number for a column from a string name. An exception of type SQLbadColName will be thrown if the name given is invalid.
Implemented in MsSQLResult, MySQLresult, PgSQLresult, and SQLite3Result. |
|
|
Return the number of columns in the result. If you performed an UPDATE or INSERT which does not return a dataset, this value will be 0.
Implemented in MsSQLResult, MySQLresult, PgSQLresult, and SQLite3Result. Referenced by ModuleTestClient::OnRequest(). |
|
|
Overloaded function for freeing the lists and maps returned by GetRowPtr or GetRowMapPtr.
Implemented in MsSQLResult, MySQLresult, PgSQLresult, and SQLite3Result. |
|
|
Overloaded function for freeing the lists and maps returned by GetRowPtr or GetRowMapPtr.
Implemented in MsSQLResult, MySQLresult, PgSQLresult, and SQLite3Result. |
|
|
Return a list of values in a row, this should increment an internal counter so you can repeatedly call it until it returns an empty vector. This returns a reference to an internal object, the same object is used for all calls to this function and therefore the return value is only valid until you call this function again. It is also invalid if the SQLresult object is destroyed. The internal cursor (row counter) is incremented by one.
Implemented in MsSQLResult, MySQLresult, PgSQLresult, and SQLite3Result. |
|
|
As above, but return a map indexed by key name. The internal cursor (row counter) is incremented by one.
Implemented in MsSQLResult, MySQLresult, PgSQLresult, and SQLite3Result. Referenced by ModuleSQLOper::OnRequest(). |
|
|
As above, but return a map indexed by key name The internal cursor (row counter) is incremented by one.
Implemented in MsSQLResult, MySQLresult, PgSQLresult, and SQLite3Result. |
|
|
Like GetRow(), but returns a pointer to a dynamically allocated object which must be explicitly freed. For portability reasons this must be freed with SQLresult::Free() The internal cursor (row counter) is incremented by one.
Implemented in MsSQLResult, MySQLresult, PgSQLresult, and SQLite3Result. |
|
||||||||||||
|
Get a string value in a given row and column This does not effect the internal cursor.
Implemented in MsSQLResult, MySQLresult, PgSQLresult, and SQLite3Result. Referenced by QueryInfo::Go(), and ModuleTestClient::OnRequest(). |
|
|
Return the number of rows in the result Note that if you have perfomed an INSERT or UPDATE query or other query which will not return rows, this will return the number of affected rows, and SQLresult::Cols() will contain 0. In this case you SHOULD NEVER access any of the result set rows, as there arent any!
Implemented in MsSQLResult, MySQLresult, PgSQLresult, and SQLite3Result. Referenced by QueryInfo::Go(), ModuleTestClient::OnRequest(), ModuleSQLOper::OnRequest(), and ModuleSQLAuth::OnRequest(). |
|
|
The database ID the query was executed on.
Definition at line 309 of file m_sqlv2.h. Referenced by SQLConnection::DoLeadingQuery(), and SQLConn::Query(). |
|
|
The error (if any) which occured. If an error occured the value of error.id will be any other value than SQL_NO_ERROR. Definition at line 315 of file m_sqlv2.h. Referenced by SQLConn::DoConnectedPoll(), MySQLresult::MySQLresult(), ModuleTestClient::OnRequest(), ModuleSQLOper::OnRequest(), and ModuleSQLAuth::OnRequest(). |
|
|
This will match query ID you were given when sending the request at an earlier time.
Reimplemented from Request. Definition at line 320 of file m_sqlv2.h. Referenced by ModuleSQLOper::OnRequest(), ModuleSQLLog::OnRequest(), and ModuleSQLAuth::OnRequest(). |
|
|
The original query string passed initially to the SQL API.
Definition at line 306 of file m_sqlv2.h. Referenced by SQLConn::DoConnectedPoll(), SQLConnection::DoLeadingQuery(), and SQLConn::Query(). |