API reference - Class QSqlResult

Notation used in Ruby API documentation

Module: QtSql

Description: Binding of QSqlResult

Class hierarchy: QSqlResult

Public constructors

new QSqlResult ptrnewCreates a new object of this class

Public methods

void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
[const]varianthandleVirtual method QVariant QSqlResult::handle()

Protected methods (static, non-static and constructors)

voidaddBindValue(variant val,
QSql_QFlags_ParamTypeFlag type)
Method void QSqlResult::addBindValue(const QVariant &val, QFlags<QSql::ParamTypeFlag> type)
[const]intatMethod int QSqlResult::at()
voidbindValue(int pos,
variant val,
QSql_QFlags_ParamTypeFlag type)
Virtual method void QSqlResult::bindValue(int pos, const QVariant &val, QFlags<QSql::ParamTypeFlag> type)
voidbindValue(string placeholder,
variant val,
QSql_QFlags_ParamTypeFlag type)
Virtual method void QSqlResult::bindValue(const QString &placeholder, const QVariant &val, QFlags<QSql::ParamTypeFlag> type)
[const]QSql_QFlags_ParamTypeFlagbindValueType(string placeholder)Method QFlags<QSql::ParamTypeFlag> QSqlResult::bindValueType(const QString &placeholder)
[const]QSql_QFlags_ParamTypeFlagbindValueType(int pos)Method QFlags<QSql::ParamTypeFlag> QSqlResult::bindValueType(int pos)
[const]unsigned intbindingSyntaxMethod QSqlResult::BindingSyntax QSqlResult::bindingSyntax()
[const]variantboundValue(string placeholder)Method QVariant QSqlResult::boundValue(const QString &placeholder)
[const]variantboundValue(int pos)Method QVariant QSqlResult::boundValue(int pos)
[const]intboundValueCountMethod int QSqlResult::boundValueCount()
[const]stringboundValueName(int pos)Method QString QSqlResult::boundValueName(int pos)
[const]variant[]boundValuesMethod QVector<QVariant> &QSqlResult::boundValues()
voidclearMethod void QSqlResult::clear()
variantdata(int i)Virtual method QVariant QSqlResult::data(int i)
voiddetachFromResultSetVirtual method void QSqlResult::detachFromResultSet()
[const]const QSqlDriver ptrdriverMethod const QSqlDriver *QSqlResult::driver()
boolexecVirtual method bool QSqlResult::exec()
boolexecBatch(bool arrayBind)Virtual method bool QSqlResult::execBatch(bool arrayBind)
[const]stringexecutedQueryMethod QString QSqlResult::executedQuery()
boolfetch(int i)Virtual method bool QSqlResult::fetch(int i)
boolfetchFirstVirtual method bool QSqlResult::fetchFirst()
boolfetchLastVirtual method bool QSqlResult::fetchLast()
boolfetchNextVirtual method bool QSqlResult::fetchNext()
boolfetchPreviousVirtual method bool QSqlResult::fetchPrevious()
[const]boolhasOutValuesMethod bool QSqlResult::hasOutValues()
[const]boolisActiveMethod bool QSqlResult::isActive()
[const]boolisForwardOnlyMethod bool QSqlResult::isForwardOnly()
boolisNull(int i)Virtual method bool QSqlResult::isNull(int i)
[const]boolisSelectMethod bool QSqlResult::isSelect()
[const]boolisValidMethod bool QSqlResult::isValid()
[const]QSqlErrorlastErrorMethod QSqlError QSqlResult::lastError()
[const]variantlastInsertIdVirtual method QVariant QSqlResult::lastInsertId()
[const]stringlastQueryMethod QString QSqlResult::lastQuery()
boolnextResultVirtual method bool QSqlResult::nextResult()
intnumRowsAffectedVirtual method int QSqlResult::numRowsAffected()
[const]QSql_NumericalPrecisionPolicynumericalPrecisionPolicyMethod QSql::NumericalPrecisionPolicy QSqlResult::numericalPrecisionPolicy()
boolprepare(string query)Virtual method bool QSqlResult::prepare(const QString &query)
[const]QSqlRecordrecordVirtual method QSqlRecord QSqlResult::record()
boolreset(string sqlquery)Virtual method bool QSqlResult::reset(const QString &sqlquery)
voidresetBindCountMethod void QSqlResult::resetBindCount()
boolsavePrepare(string sqlquery)Virtual method bool QSqlResult::savePrepare(const QString &sqlquery)
voidsetActive(bool a)Virtual method void QSqlResult::setActive(bool a)
voidsetAt(int at)Virtual method void QSqlResult::setAt(int at)
voidsetForwardOnly(bool forward)Virtual method void QSqlResult::setForwardOnly(bool forward)
voidsetLastError(const QSqlError e)Virtual method void QSqlResult::setLastError(const QSqlError &e)
voidsetNumericalPrecisionPolicy(const QSql_NumericalPrecisionPolicy policy)Virtual method void QSqlResult::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy)
voidsetQuery(string query)Virtual method void QSqlResult::setQuery(const QString &query)
voidsetSelect(bool s)Virtual method void QSqlResult::setSelect(bool s)
intsizeVirtual method int QSqlResult::size()
voidvirtual_hook(int id,
void * data)
Virtual method void QSqlResult::virtual_hook(int id, void *data)

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

addBindValue

Signature: void addBindValue (variant val, QSql_QFlags_ParamTypeFlag type)

Description: Method void QSqlResult::addBindValue(const QVariant &val, QFlags<QSql::ParamTypeFlag> type)

This method is protected and can only be called from inside a derived class.

at

Signature: [const] int at

Description: Method int QSqlResult::at()

This method is protected and can only be called from inside a derived class.

bindValue

(1) Signature: void bindValue (int pos, variant val, QSql_QFlags_ParamTypeFlag type)

Description: Virtual method void QSqlResult::bindValue(int pos, const QVariant &val, QFlags<QSql::ParamTypeFlag> type)

This method can be reimplemented in a derived class.

(2) Signature: void bindValue (string placeholder, variant val, QSql_QFlags_ParamTypeFlag type)

Description: Virtual method void QSqlResult::bindValue(const QString &placeholder, const QVariant &val, QFlags<QSql::ParamTypeFlag> type)

This method can be reimplemented in a derived class.

bindValueType

(1) Signature: [const] QSql_QFlags_ParamTypeFlag bindValueType (string placeholder)

Description: Method QFlags<QSql::ParamTypeFlag> QSqlResult::bindValueType(const QString &placeholder)

This method is protected and can only be called from inside a derived class.

(2) Signature: [const] QSql_QFlags_ParamTypeFlag bindValueType (int pos)

Description: Method QFlags<QSql::ParamTypeFlag> QSqlResult::bindValueType(int pos)

This method is protected and can only be called from inside a derived class.

bindingSyntax

Signature: [const] unsigned int bindingSyntax

Description: Method QSqlResult::BindingSyntax QSqlResult::bindingSyntax()

This method is protected and can only be called from inside a derived class.

boundValue

(1) Signature: [const] variant boundValue (string placeholder)

Description: Method QVariant QSqlResult::boundValue(const QString &placeholder)

This method is protected and can only be called from inside a derived class.

(2) Signature: [const] variant boundValue (int pos)

Description: Method QVariant QSqlResult::boundValue(int pos)

This method is protected and can only be called from inside a derived class.

boundValueCount

Signature: [const] int boundValueCount

Description: Method int QSqlResult::boundValueCount()

This method is protected and can only be called from inside a derived class.

boundValueName

Signature: [const] string boundValueName (int pos)

Description: Method QString QSqlResult::boundValueName(int pos)

This method is protected and can only be called from inside a derived class.

boundValues

Signature: [const] variant[] boundValues

Description: Method QVector<QVariant> &QSqlResult::boundValues()

This method is protected and can only be called from inside a derived class.

clear

Signature: void clear

Description: Method void QSqlResult::clear()

This method is protected and can only be called from inside a derived class.

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

data

Signature: variant data (int i)

Description: Virtual method QVariant QSqlResult::data(int i)

This method can be reimplemented in a derived class.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

detachFromResultSet

Signature: void detachFromResultSet

Description: Virtual method void QSqlResult::detachFromResultSet()

This method can be reimplemented in a derived class.

driver

Signature: [const] const QSqlDriver ptr driver

Description: Method const QSqlDriver *QSqlResult::driver()

This method is protected and can only be called from inside a derived class.

exec

Signature: bool exec

Description: Virtual method bool QSqlResult::exec()

This method can be reimplemented in a derived class.

Python specific notes:
This attribute is available as 'exec_' in Python.

execBatch

Signature: bool execBatch (bool arrayBind)

Description: Virtual method bool QSqlResult::execBatch(bool arrayBind)

This method can be reimplemented in a derived class.

executedQuery

Signature: [const] string executedQuery

Description: Method QString QSqlResult::executedQuery()

This method is protected and can only be called from inside a derived class.

fetch

Signature: bool fetch (int i)

Description: Virtual method bool QSqlResult::fetch(int i)

This method can be reimplemented in a derived class.

fetchFirst

Signature: bool fetchFirst

Description: Virtual method bool QSqlResult::fetchFirst()

This method can be reimplemented in a derived class.

fetchLast

Signature: bool fetchLast

Description: Virtual method bool QSqlResult::fetchLast()

This method can be reimplemented in a derived class.

fetchNext

Signature: bool fetchNext

Description: Virtual method bool QSqlResult::fetchNext()

This method can be reimplemented in a derived class.

fetchPrevious

Signature: bool fetchPrevious

Description: Virtual method bool QSqlResult::fetchPrevious()

This method can be reimplemented in a derived class.

handle

Signature: [const] variant handle

Description: Virtual method QVariant QSqlResult::handle()

This method can be reimplemented in a derived class.

hasOutValues

Signature: [const] bool hasOutValues

Description: Method bool QSqlResult::hasOutValues()

This method is protected and can only be called from inside a derived class.

isActive

Signature: [const] bool isActive

Description: Method bool QSqlResult::isActive()

This method is protected and can only be called from inside a derived class.

isForwardOnly

Signature: [const] bool isForwardOnly

Description: Method bool QSqlResult::isForwardOnly()

This method is protected and can only be called from inside a derived class.

isNull

Signature: bool isNull (int i)

Description: Virtual method bool QSqlResult::isNull(int i)

This method can be reimplemented in a derived class.

isSelect

Signature: [const] bool isSelect

Description: Method bool QSqlResult::isSelect()

This method is protected and can only be called from inside a derived class.

isValid

Signature: [const] bool isValid

Description: Method bool QSqlResult::isValid()

This method is protected and can only be called from inside a derived class.

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

lastError

Signature: [const] QSqlError lastError

Description: Method QSqlError QSqlResult::lastError()

This method is protected and can only be called from inside a derived class.

lastInsertId

Signature: [const] variant lastInsertId

Description: Virtual method QVariant QSqlResult::lastInsertId()

This method can be reimplemented in a derived class.

lastQuery

Signature: [const] string lastQuery

Description: Method QString QSqlResult::lastQuery()

This method is protected and can only be called from inside a derived class.

new

Signature: [static] new QSqlResult ptr new

Description: Creates a new object of this class

Python specific notes:
This method is the default initializer of the object.

nextResult

Signature: bool nextResult

Description: Virtual method bool QSqlResult::nextResult()

This method can be reimplemented in a derived class.

numRowsAffected

Signature: int numRowsAffected

Description: Virtual method int QSqlResult::numRowsAffected()

This method can be reimplemented in a derived class.

numericalPrecisionPolicy

Signature: [const] QSql_NumericalPrecisionPolicy numericalPrecisionPolicy

Description: Method QSql::NumericalPrecisionPolicy QSqlResult::numericalPrecisionPolicy()

This method is protected and can only be called from inside a derived class.

prepare

Signature: bool prepare (string query)

Description: Virtual method bool QSqlResult::prepare(const QString &query)

This method can be reimplemented in a derived class.

record

Signature: [const] QSqlRecord record

Description: Virtual method QSqlRecord QSqlResult::record()

This method can be reimplemented in a derived class.

reset

Signature: bool reset (string sqlquery)

Description: Virtual method bool QSqlResult::reset(const QString &sqlquery)

This method can be reimplemented in a derived class.

resetBindCount

Signature: void resetBindCount

Description: Method void QSqlResult::resetBindCount()

This method is protected and can only be called from inside a derived class.

savePrepare

Signature: bool savePrepare (string sqlquery)

Description: Virtual method bool QSqlResult::savePrepare(const QString &sqlquery)

This method can be reimplemented in a derived class.

setActive

Signature: void setActive (bool a)

Description: Virtual method void QSqlResult::setActive(bool a)

This method can be reimplemented in a derived class.

setAt

Signature: void setAt (int at)

Description: Virtual method void QSqlResult::setAt(int at)

This method can be reimplemented in a derived class.

setForwardOnly

Signature: void setForwardOnly (bool forward)

Description: Virtual method void QSqlResult::setForwardOnly(bool forward)

This method can be reimplemented in a derived class.

setLastError

Signature: void setLastError (const QSqlError e)

Description: Virtual method void QSqlResult::setLastError(const QSqlError &e)

This method can be reimplemented in a derived class.

setNumericalPrecisionPolicy

Signature: void setNumericalPrecisionPolicy (const QSql_NumericalPrecisionPolicy policy)

Description: Virtual method void QSqlResult::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy)

This method can be reimplemented in a derived class.

setQuery

Signature: void setQuery (string query)

Description: Virtual method void QSqlResult::setQuery(const QString &query)

This method can be reimplemented in a derived class.

setSelect

Signature: void setSelect (bool s)

Description: Virtual method void QSqlResult::setSelect(bool s)

This method can be reimplemented in a derived class.

size

Signature: int size

Description: Virtual method int QSqlResult::size()

This method can be reimplemented in a derived class.

Python specific notes:
This method is also available as 'len(object)'.

virtual_hook

Signature: void virtual_hook (int id, void * data)

Description: Virtual method void QSqlResult::virtual_hook(int id, void *data)

This method can be reimplemented in a derived class.