MeVisLab Scripting Reference
|
#include <mlabScriptWrappers.h>
Inherits QObject.
Public Slots | |
Send SQL statements | |
| |
bool | exec (const QString &sqlStatement) |
bool | execQuery (const QString &sqlStatement) |
bool | exec () |
bool | execQuery () |
bool | prepare (const QString &sqlStatement) |
void | bindValue (const QString &name, const QVariant &value) |
void | bindValue (int i, const QVariant &value) |
bool | isActive () |
bool | isSelect () |
bool | isValid () |
int | rowsAffected () |
int | size () |
QVariant | lastInsertId () |
QString | lastQuery () |
QSqlQuery * | getQSqlQuery () |
QSqlDatabase * | getQSqlDatabase () |
QSqlRecord * | getQSqlRecord () |
Navigate query results. | |
| |
bool | next () |
bool | prev () |
bool | first () |
bool | last () |
Reading the current selected record. | |
| |
QVariant | value (int i) |
QList< QVariant > | values () |
QList< QVariant > | allValues () |
int | numValues () |
QStringList | fieldNames () |
QMap< QString, QVariant > | record () |
int | indexOfField (const QString &name) |
QVariant | valueOfField (const QString &name) |
The MLABSqlQuery object can be used to query an associated database.
|
slot |
Returns all records as a list of QValueList<QVariant>.
|
slot |
Binds the value of placeholder name.
|
slot |
Binds the value of placeholder i (starting from 0).
|
slot |
Executes a prepared query.
|
slot |
Executes the given SQL statement, returns whether it was successful.
Note that using "SELECT table.*" is a bad idea because the indexes of the fields will not have any order.
|
slot |
Executes a prepared query like exec() but with an aliased name because exec is a reserved keyword in Python.
|
slot |
Executes the given SQL statement, returns whether it was successful.
Note that using "SELECT table.*" is a bad idea because the indexes of the fields will not have any order. Executes the given SQL statement like exec() but with an aliased name because exec is a reserved keyword in Python.
|
slot |
Returns the names of the fields in the record.
|
slot |
Sets cursor to first result record of a select (returns false if no first record is available).
|
inlineslot |
Returns the underlying QSqlDatabase instance.
|
inlineslot |
Returns the underlying QSqlQuery instance.
|
inlineslot |
Returns the current QSqlRecord instance.
|
slot |
Returns the value index of the given field for usage with "value".
|
slot |
Returns whether a select statement is active and successful.
|
slot |
Returns whether the query is a select statement.
|
slot |
Returns whether the query is positioned on a valid record.
|
slot |
Sets cursor to last result record of a select (returns false if no last record is available).
|
slot |
Returns the object ID of the most recent inserted row if the database supports it.
An invalid QVariant will be returned if the query did not insert any value or if the database does not report the id back. If more than one row was touched by the insert, the behavior is undefined.
|
slot |
Returns the text of the current query being used, or an empty string if there is no current query text.
|
slot |
Sets cursor to next result record of a select (returns false if no next record is available).
|
slot |
Returns the number of values in the record.
|
slot |
Sets a prepared statement, use execQuery() to execute the statement.
Example 1 (with named placeholders and indices):
Example 2 (with named placeholder):
Example 3 (with question mark placeholders):
|
slot |
Sets cursor to previous result record of a select (returns false if no previous record is available).
|
slot |
Returns the current record of a select as map (fieldnames->values).
|
slot |
Returns the number of rows that where affected by the exec statement (NOT the number of records found with SELECT).
|
slot |
Returns the size of the resulting records of a SELECT statement (-1 if size is unknown).
|
slot |
Returns the field's value at position i of the current record of the select statement (in order of appearance in the select statement).
|
slot |
Returns the value for the named field in the current record.
|
slot |
Returns the values of the fields of the current record.