![]() |
Qt 6.x
The Qt SDK
|
#include "qsql_odbc_p.h"
#include <qsqlrecord.h>
#include <qcoreapplication.h>
#include <qdatetime.h>
#include <qlist.h>
#include <qmath.h>
#include <qsqlerror.h>
#include <qsqlfield.h>
#include <qsqlindex.h>
#include <qstringconverter.h>
#include <qstringlist.h>
#include <qvariant.h>
#include <qvarlengtharray.h>
#include <QDebug>
#include <QSqlQuery>
#include <QtSql/private/qsqldriver_p.h>
#include <QtSql/private/qsqlresult_p.h>
#include "private/qtools_p.h"
#include "moc_qsql_odbc_p.cpp"
Go to the source code of this file.
Classes | |
class | QODBCDriverPrivate |
class | QODBCResult |
class | QODBCResultPrivate |
struct | DiagRecord |
Macros | |
#define | SQL_SS_TIME2 (-154) |
#define | ODBC_CHECK_DRIVER |
Functions | |
template<typename C , int SIZE = sizeof(SQLTCHAR)> | |
static QString | fromSQLTCHAR (const C &input, qsizetype size=-1) |
template<int SIZE = sizeof(SQLTCHAR)> | |
QStringConverter::Encoding | encodingForSqlTChar () |
static QVarLengthArray< SQLTCHAR > | toSQLTCHAR (const QString &input) |
static QList< DiagRecord > | qWarnODBCHandle (int handleType, SQLHANDLE handle) |
static QList< DiagRecord > | qODBCWarn (const SQLHANDLE hStmt, const SQLHANDLE envHandle=nullptr, const SQLHANDLE pDbC=nullptr) |
static QList< DiagRecord > | qODBCWarn (const QODBCResultPrivate *odbc) |
static QList< DiagRecord > | qODBCWarn (const QODBCDriverPrivate *odbc) |
static DiagRecord | combineRecords (const QList< DiagRecord > &records) |
static QSqlError | errorFromDiagRecords (const QString &err, QSqlError::ErrorType type, const QList< DiagRecord > &records) |
static QString | errorStringFromDiagRecords (const QList< DiagRecord > &records) |
template<class T > | |
static void | qSqlWarning (const QString &message, T &&val) |
static QSqlError | qMakeError (const QString &err, QSqlError::ErrorType type, const QODBCResultPrivate *p) |
static QSqlError | qMakeError (const QString &err, QSqlError::ErrorType type, const QODBCDriverPrivate *p) |
static QMetaType | qDecodeODBCType (SQLSMALLINT sqltype, bool isSigned=true) |
template<typename CT > | |
static QVariant | getStringDataImpl (SQLHANDLE hStmt, SQLUSMALLINT column, qsizetype colSize, SQLSMALLINT targetType) |
static QVariant | qGetStringData (SQLHANDLE hStmt, SQLUSMALLINT column, int colSize, bool unicode) |
static QVariant | qGetBinaryData (SQLHANDLE hStmt, int column) |
static QVariant | qGetIntData (SQLHANDLE hStmt, int column, bool isSigned=true) |
static QVariant | qGetDoubleData (SQLHANDLE hStmt, int column) |
static QVariant | qGetBigIntData (SQLHANDLE hStmt, int column, bool isSigned=true) |
static bool | isAutoValue (const SQLHANDLE hStmt, int column) |
static QSqlField | qMakeFieldInfo (const SQLHANDLE hStmt, int i, QString *errorMessage) |
static QSqlField | qMakeFieldInfo (const SQLHANDLE hStmt, const QODBCDriverPrivate *p) |
static QSqlField | qMakeFieldInfo (const QODBCResultPrivate *p, int i) |
static size_t | qGetODBCVersion (const QString &connOpts) |
static SQLRETURN | qt_string_SQLSetConnectAttr (SQLHDBC handle, SQLINTEGER attr, const QString &val) |
Variables | |
static constexpr int | COLNAMESIZE = 256 |
static constexpr SQLSMALLINT | TABLENAMESIZE = 128 |
static constexpr SQLSMALLINT | qParamType [4] = { SQL_PARAM_INPUT, SQL_PARAM_INPUT, SQL_PARAM_OUTPUT, SQL_PARAM_INPUT_OUTPUT } |
#define ODBC_CHECK_DRIVER |
Definition at line 37 of file qsql_odbc.cpp.
#define SQL_SS_TIME2 (-154) |
Definition at line 33 of file qsql_odbc.cpp.
|
static |
Definition at line 264 of file qsql_odbc.cpp.
References add(), QList< T >::begin(), DiagRecord::description, QList< T >::end(), and QList< T >::front().
Referenced by errorFromDiagRecords(), and errorStringFromDiagRecords().
QStringConverter::Encoding encodingForSqlTChar | ( | ) |
Definition at line 63 of file qsql_odbc.cpp.
References SIZE, QStringConverter::Utf16, QStringConverter::Utf32, and QStringConverter::Utf8.
Referenced by toSQLTCHAR().
|
static |
Definition at line 274 of file qsql_odbc.cpp.
References combineRecords(), and QList< T >::empty().
Referenced by qMakeError(), and qMakeError().
|
static |
Definition at line 285 of file qsql_odbc.cpp.
References combineRecords().
Referenced by QODBCResult::nextResult(), and qSqlWarning().
|
inlinestatic |
Definition at line 45 of file qsql_odbc.cpp.
References QString::fromUcs4(), QString::fromUtf16(), QString::fromUtf8(), qMin(), and SIZE.
Referenced by QODBCDriverPrivate::checkDBMS(), QODBCDriverPrivate::checkHasMultiResults(), QODBCDriverPrivate::checkUnicode(), QODBCResult::exec(), qMakeFieldInfo(), and qWarnODBCHandle().
|
static |
Definition at line 376 of file qsql_odbc.cpp.
References qSqlWarning(), and QString::size().
|
static |
Definition at line 555 of file qsql_odbc.cpp.
References QString::number(), qSqlWarning(), and QStringLiteral.
Referenced by qMakeFieldInfo().
|
static |
Definition at line 311 of file qsql_odbc.cpp.
References SQL_SS_TIME2, and QMetaType::UnknownType.
Referenced by qMakeFieldInfo(), and qMakeFieldInfo().
|
static |
Definition at line 534 of file qsql_odbc.cpp.
Referenced by QODBCResult::data().
|
static |
Definition at line 438 of file qsql_odbc.cpp.
References COLNAMESIZE, QByteArray::constData(), QVarLengthArray< T, Prealloc >::data(), qWarning, read(), QByteArray::resize(), QByteArray::size(), and QVLABaseBase::size().
Referenced by QODBCResult::data().
|
static |
Definition at line 514 of file qsql_odbc.cpp.
Referenced by QODBCResult::data().
|
static |
Definition at line 494 of file qsql_odbc.cpp.
Referenced by QODBCResult::data(), and qMakeFieldInfo().
|
static |
Definition at line 665 of file qsql_odbc.cpp.
References Qt::CaseInsensitive, and QString::contains().
Referenced by QODBCDriver::open().
|
static |
Definition at line 425 of file qsql_odbc.cpp.
Referenced by QODBCResult::data(), and qMakeFieldInfo().
|
static |
Definition at line 304 of file qsql_odbc.cpp.
References errorFromDiagRecords(), and qODBCWarn().
|
static |
Definition at line 297 of file qsql_odbc.cpp.
References errorFromDiagRecords(), and qODBCWarn().
Referenced by QODBCResult::exec(), QODBCResult::fetch(), QODBCResult::fetchFirst(), QODBCResult::fetchLast(), QODBCResult::fetchNext(), QODBCResult::fetchPrevious(), QODBCResult::nextResult(), QODBCResult::prepare(), and QODBCResult::reset().
|
static |
Definition at line 592 of file qsql_odbc.cpp.
References errorMessage(), i, QString::isEmpty(), qMakeFieldInfo(), and qSqlWarning().
|
static |
Definition at line 572 of file qsql_odbc.cpp.
References QVariant::isNull(), qDecodeODBCType(), qGetIntData(), qGetStringData(), QVariant::toInt(), QVariant::toString(), and var.
Definition at line 601 of file qsql_odbc.cpp.
References QString::clear(), COLNAMESIZE, QVarLengthArray< T, Prealloc >::data(), errorMessage(), fromSQLTCHAR(), i, isAutoValue(), QString::number(), qDecodeODBCType(), qSqlWarning(), QStringLiteral, QVLABaseBase::size(), and TABLENAMESIZE.
Referenced by QODBCResult::exec(), QODBCResult::nextResult(), qMakeFieldInfo(), and QODBCResult::reset().
|
static |
Definition at line 259 of file qsql_odbc.cpp.
References QODBCDriverPrivate::hDbc, QODBCDriverPrivate::hEnv, and qODBCWarn().
|
static |
Definition at line 254 of file qsql_odbc.cpp.
References QODBCResultPrivate::dpDbc(), QODBCResultPrivate::dpEnv(), QODBCResultPrivate::hStmt, and qODBCWarn().
|
static |
Definition at line 243 of file qsql_odbc.cpp.
References qWarnODBCHandle().
Referenced by QODBCResult::nextResult(), qMakeError(), qMakeError(), qODBCWarn(), qODBCWarn(), and qSqlWarning().
Definition at line 292 of file qsql_odbc.cpp.
References errorStringFromDiagRecords(), qODBCWarn(), and qWarning.
Referenced by QODBCResult::~QODBCResult(), QODBCDriverPrivate::checkDriver(), QODBCResult::exec(), getStringDataImpl(), isAutoValue(), QODBCResult::lastInsertId(), QODBCResult::numRowsAffected(), QODBCResult::prepare(), qMakeFieldInfo(), qMakeFieldInfo(), QODBCResult::reset(), QODBCDriverPrivate::setConnectionOptions(), and QODBCDriverPrivate::splitTableQualifier().
|
static |
Definition at line 691 of file qsql_odbc.cpp.
References QByteArray::data(), encoded, QByteArray::size(), and toSQLTCHAR().
Referenced by QODBCDriverPrivate::setConnectionOptions().
|
static |
Definition at line 206 of file qsql_odbc.cpp.
References QVarLengthArray< T, Prealloc >::data(), fromSQLTCHAR(), i, QString::number(), QVarLengthArray< T, Prealloc >::resize(), QVLABaseBase::size(), and state.
Referenced by qODBCWarn().
|
inlinestatic |
Definition at line 76 of file qsql_odbc.cpp.
References QStringEncoder::appendToBuffer(), encodingForSqlTChar(), and QStringEncoder::requiredSpace().
Referenced by QODBCDriverPrivate::checkUnicode(), QODBCResult::exec(), QODBCDriver::open(), QODBCResult::prepare(), QODBCDriver::primaryIndex(), qt_string_SQLSetConnectAttr(), QODBCDriver::record(), QODBCResult::reset(), and QODBCDriver::tables().
|
staticconstexpr |
Definition at line 39 of file qsql_odbc.cpp.
Referenced by qGetBinaryData(), and qMakeFieldInfo().
|
staticconstexpr |
Definition at line 42 of file qsql_odbc.cpp.
Referenced by QODBCResult::exec().
|
staticconstexpr |
Definition at line 40 of file qsql_odbc.cpp.
Referenced by qMakeFieldInfo().