Workspace 6.21.5
Public Member Functions | List of all members
SqlDataModelResult Class Reference

Contains information about results of an operation on the SqlDataModel such as a fetch, insert or update.

#include <DataAnalysis/DataStructures/sqldatamodelresult.h>

Public Member Functions

 SqlDataModelResult (const QSqlError &sqlError)
 
 SqlDataModelResult (const QSqlQuery &failedQuery)
 
 SqlDataModelResult (SqlDataModelResultType type=NoError, const QString &text=QString(), const QString &queryText=QString())
 
QMap< QString, QVariant > boundValues () const
 
const QString & errorCode () const
 
bool isError () const
 
const QString & queryText () const
 
QString text () const
 
SqlDataModelResultType type () const
 

Constructor & Destructor Documentation

◆ SqlDataModelResult() [1/3]

SqlDataModelResult ( SqlDataModelResultType  type = NoError,
const QString &  text = QString(),
const QString &  queryText = QString() 
)
Parameters
typeThe type of result (or error type if it was an error)
textThe text description of the result.
queryTextThe SQL query text used to generate the result.

Constructs a result from its constituent parts.

◆ SqlDataModelResult() [2/3]

SqlDataModelResult ( const QSqlQuery &  failedQuery)
Parameters
failedQueryThe query which was last executed.

Constructs a result from an existing SQLError.

◆ SqlDataModelResult() [3/3]

SqlDataModelResult ( const QSqlError &  sqlError)
Parameters
sqlError

Constructs a result from an existing SQLError.

Member Function Documentation

◆ boundValues()

QMap< QString, QVariant > boundValues ( ) const
Returns
Values bound to the query for use with placeholders, if any were used.

◆ errorCode()

const QString & errorCode ( ) const
Returns
If applicable, the vendor specific error code associated with the type of error that occured.

◆ isError()

bool isError ( ) const
Returns
True if this result is a type of error, otherwise returns false.

◆ queryText()

const QString & queryText ( ) const
Returns
Returns the text of the executed query that resulted in this result (if available). Not always provided.

◆ text()

QString text ( ) const
Returns
The text description of the result. If it was an SQL error, this will contain the concatenated database and driver text.

◆ type()

SqlDataModelResultType type ( ) const
Returns
The type of error that this result represents.