Ananas Library
0.9.5
|
Public Slots | |
QSqlSelectCursor * | Cursor () const |
Return inner cursor which contains result of last call method ExecQuery or ExecScalar. More... | |
QVariant | Value (int col) const |
int | Size () const |
Return record count in result. | |
int | Count () const |
Return column count in result. | |
bool | ExecQuery (const QString &query) |
Function for query execution. More... | |
QVariant | ExecScalar (const QString &query) |
This function similar to described above ExecQuery(),. More... | |
bool | First () |
Make first record of result as current. More... | |
bool | Next () |
Make next record of result as current. More... | |
bool | Last () |
Make last record of result as current. More... | |
bool | Prev () |
Make previous record of result as current. More... | |
QString | SqlFieldName (aObject *obj, const QString &userFieldName, const QString &tableType="") const |
Gets sql name of field by its user name. More... | |
QString | SqlTableName (aObject *obj, const QString &tableType="") const |
Gets SQL name of primary or one of secondary object tables. More... | |
QString | SqlTableName (const QString &objName) const |
Not implemented yet. | |
QString | SqlFieldName (const QString &fieldName) const |
Not implemented yet. | |
QString | LastError () const |
Returns text representation last error or emty text, if no error occured. More... | |
Public Member Functions | |
aExtSQL () | |
Constructor. | |
virtual int | init (aDatabase *database) |
Init function, owerrides function in base class, creates inner database specific object and variables. | |
~aExtSQL () | |
Destructor. | |
![]() | |
AExtension (const char *name=0) | |
Additional Inherited Members | |
![]() | |
void | event (const QString &data) |
![]() | |
aDatabase * | db |
|
slot |
Return inner cursor which contains result of last call method ExecQuery or ExecScalar.
for bindings to external table (QDataTable etc.). Don't delete this cursor after use! \return Inner cursor.
|
slot |
Function for query execution.
Only select statement supported. If any error occured, returns false. Fom move to result records use First(), Next(), Last() and Prev() functions. For get information about last error occured use LastError() function. \param query (in) - sql query for execution. \return true, if no error occured.
|
slot |
This function similar to described above ExecQuery(),.
but return only first cell in first record or QVariant::Invalid, if no recornds returned or error occured. But if you know, that more than one record returned, you can navigate throw thouse records use function First(), Next() ... \param query (in) - sql query for execution. \return Query result or QVariant::Invalid
|
slot |
Make first record of result as current.
You should first call ExecQuery for call this function have sence. \return true if success
|
slot |
Make last record of result as current.
\return true if success
|
slot |
Returns text representation last error or emty text, if no error occured.
Returns driver text only.
|
slot |
Make next record of result as current.
\return true if success
|
slot |
Make previous record of result as current.
\return true if success
|
slot |
Gets sql name of field by its user name.
To every Ananas object user can add his own fields. Unfortunatly when you generate SQL query you should use sql field name instead of user field name. This function help do it easy. All what you need - create new object you want use in query, specify user field name and table (primary or one of secondary). See SqlTableName() for details about table naming. However, every sql table contains some system fields. That fields also can be used in query. See documentation on ananas object for details. \param obj (in) - Ananas object. Using as contex for field search. \param userFieldName (in) - User field name \param tableType (optional) - Table type. For catalogue group table mapped to "group" alias, For accumulation register every saldo table mapped to dimension user name alias. \return sql field name
References aObject::table().
|
slot |
Gets SQL name of primary or one of secondary object tables.
All Ananas objects except Report store theyr values in sql tables. For Catalogue this is group table and element table (pri), for Document - data header table, for Journal - always system journal table, for IRegister - one table for all data, for ARegister - main table for store operations (pri) and X table for store saldo, where X - dimensions count. So if you want get name of primary table, leave parameter \atableType or set in to empty string. If you want get name of secondary table, set parameter \atableType to "group" for catalogue group table or dimension user name for accumulation register saldo table for that dimension. \param obj (in) - Object for getting table name. \param tableType (optional) - Table type \return sql table name
References aObject::table().
|
slot |
Gets value of column number \acol (zero based) from current record or QVariant::Invalid if error occured or \acol value out of range.
col | (in) - Column Index |