Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qsql_oci.cpp File Reference
#include "qsql_oci_p.h"
#include <qcoreapplication.h>
#include <qdatetime.h>
#include <qdebug.h>
#include <qlist.h>
#include <qmetatype.h>
#include <qshareddata.h>
#include <qsqlerror.h>
#include <qsqlfield.h>
#include <qsqlindex.h>
#include <qsqlquery.h>
#include <QtSql/private/qsqlcachedresult_p.h>
#include <QtSql/private/qsqldriver_p.h>
#include <qstringlist.h>
#include <qvariant.h>
#include <qvarlengtharray.h>
#include <oci.h>
#include <stdlib.h>
+ Include dependency graph for qsql_oci.cpp:

Go to the source code of this file.

Classes

class  QOCIRowId
 
class  QOCIDateTime
 
struct  TempStorage
 
class  QOCIDriverPrivate
 
class  QOCIResult
 
class  QOCIResultPrivate
 
struct  OraFieldInfo
 
class  QOCICols
 
struct  QOCIBatchColumn
 
struct  QOCIBatchCleanupHandler
 

Macros

#define QOCI_DYNAMIC_CHUNK_SIZE   65535
 
#define QOCI_PREFETCH_MEM   10240
 
#define QOCI_THREADED
 

Typedefs

typedef QVarLengthArray< sb2, 32 > IndicatorArray
 
typedef QVarLengthArray< ub2, 32 > SizeArray
 
typedef QSharedDataPointer< QOCIRowIdQOCIRowIdPointer
 

Enumerations

enum  { QOCIEncoding = 2002 }
 
enum  Expression { OrExpression , AndExpression }
 

Functions

 Q_DECLARE_OPAQUE_POINTER (OCIEnv *)
 
 Q_DECLARE_OPAQUE_POINTER (OCIStmt *)
 
static QByteArray qMakeOCINumber (const qlonglong &ll, OCIError *err)
 
static QByteArray qMakeOCINumber (const qulonglong &ull, OCIError *err)
 
static qlonglong qMakeLongLong (const char *ociNumber, OCIError *err)
 
static qulonglong qMakeULongLong (const char *ociNumber, OCIError *err)
 
static QString qOraWarn (OCIError *err, int *errorCode=0)
 
static void qOraWarning (const char *msg, OCIError *err)
 
static QSqlError qMakeError (const QString &errString, QSqlError::ErrorType type, OCIError *err)
 
static void qOraOutValue (QVariant &value, TempStorage &tmpStorage, OCIEnv *env, OCIError *err)
 
static int qOraErrorNumber (OCIError *err)
 
QMetaType qDecodeOCIType (const QString &ocitype, QSql::NumericalPrecisionPolicy precisionPolicy)
 
QMetaType qDecodeOCIType (int ocitype, QSql::NumericalPrecisionPolicy precisionPolicy)
 
static QSqlField qFromOraInf (const OraFieldInfo &ofi)
 
template<class T , int sz>
int qReadLob (T &buf, const QOCIResultPrivate *d, OCILobLocator *lob)
 
static void qParseOpts (const QString &options, QOCIDriverPrivate *d)
 
static QString make_where_clause (const QString &user, Expression e)
 
void qSplitTableAndOwner (const QString &tname, QString *tbl, QString *owner)
 

Variables

static const ub2 qOraCharset = OCI_UCS2ID
 

Macro Definition Documentation

◆ QOCI_DYNAMIC_CHUNK_SIZE

#define QOCI_DYNAMIC_CHUNK_SIZE   65535

Definition at line 37 of file qsql_oci.cpp.

◆ QOCI_PREFETCH_MEM

#define QOCI_PREFETCH_MEM   10240

Definition at line 38 of file qsql_oci.cpp.

◆ QOCI_THREADED

#define QOCI_THREADED

Definition at line 43 of file qsql_oci.cpp.

Typedef Documentation

◆ IndicatorArray

typedef QVarLengthArray<sb2, 32> IndicatorArray

Definition at line 76 of file qsql_oci.cpp.

◆ QOCIRowIdPointer

Definition at line 174 of file qsql_oci.cpp.

◆ SizeArray

typedef QVarLengthArray<ub2, 32> SizeArray

Definition at line 77 of file qsql_oci.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
QOCIEncoding 

Definition at line 57 of file qsql_oci.cpp.

◆ Expression

enum Expression
Enumerator
OrExpression 
AndExpression 

Definition at line 2423 of file qsql_oci.cpp.

Function Documentation

◆ make_where_clause()

static QString make_where_clause ( const QString user,
Expression  e 
)
static

Definition at line 2428 of file qsql_oci.cpp.

References QLatin1StringView::chop(), e, and QLatin1StringView::size().

Referenced by QOCIDriver::tables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Q_DECLARE_OPAQUE_POINTER() [1/2]

Q_DECLARE_OPAQUE_POINTER ( OCIEnv )

◆ Q_DECLARE_OPAQUE_POINTER() [2/2]

Q_DECLARE_OPAQUE_POINTER ( OCIStmt *  )

◆ qDecodeOCIType() [1/2]

QMetaType qDecodeOCIType ( const QString ocitype,
QSql::NumericalPrecisionPolicy  precisionPolicy 
)

Definition at line 617 of file qsql_oci.cpp.

References QByteArray::constData(), QSql::HighPrecision, QSql::LowPrecisionDouble, QSql::LowPrecisionInt32, QSql::LowPrecisionInt64, qWarning, QString::startsWith(), QString::toLocal8Bit(), and QMetaType::UnknownType.

Referenced by QOCIDriver::primaryIndex(), and QOCIDriver::record().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qDecodeOCIType() [2/2]

◆ qFromOraInf()

static QSqlField qFromOraInf ( const OraFieldInfo ofi)
static

Definition at line 730 of file qsql_oci.cpp.

References QMetaType::id(), OraFieldInfo::name, OraFieldInfo::oraFieldLength, OraFieldInfo::oraIsNull, OraFieldInfo::oraPrecision, OraFieldInfo::oraScale, OraFieldInfo::oraType, and OraFieldInfo::type.

Referenced by QOCICols::QOCICols().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qMakeError()

QSqlError qMakeError ( const QString errString,
QSqlError::ErrorType  type,
OCIError *  err 
)
static

Definition at line 609 of file qsql_oci.cpp.

References QString::number(), and qOraWarn().

Referenced by QOCIResult::exec(), QOCICols::execBatch(), QOCIResult::gotoNext(), and QOCIResult::prepare().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qMakeLongLong()

qlonglong qMakeLongLong ( const char *  ociNumber,
OCIError *  err 
)
static

Definition at line 779 of file qsql_oci.cpp.

Referenced by QOCICols::execBatch(), and qOraOutValue().

+ Here is the caller graph for this function:

◆ qMakeOCINumber() [1/2]

QByteArray qMakeOCINumber ( const qlonglong ll,
OCIError *  err 
)
static

Convert qlonglong to the internal Oracle OCINumber format.

Definition at line 750 of file qsql_oci.cpp.

References ba, and QByteArray::data().

Referenced by QOCIResultPrivate::bindValue(), and QOCICols::execBatch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qMakeOCINumber() [2/2]

QByteArray qMakeOCINumber ( const qulonglong ull,
OCIError *  err 
)
static

Convert qulonglong to the internal Oracle OCINumber format.

Definition at line 767 of file qsql_oci.cpp.

References ba, and QByteArray::data().

+ Here is the call graph for this function:

◆ qMakeULongLong()

qulonglong qMakeULongLong ( const char *  ociNumber,
OCIError *  err 
)
static

Definition at line 787 of file qsql_oci.cpp.

Referenced by QOCICols::execBatch(), and qOraOutValue().

+ Here is the caller graph for this function:

◆ qOraErrorNumber()

static int qOraErrorNumber ( OCIError *  err)
static

Definition at line 596 of file qsql_oci.cpp.

Referenced by QOCIResult::gotoNext().

+ Here is the caller graph for this function:

◆ qOraOutValue()

static void qOraOutValue ( QVariant value,
TempStorage tmpStorage,
OCIEnv env,
OCIError *  err 
)
static

Definition at line 489 of file qsql_oci.cpp.

References QByteArray::constData(), QDateTime::date(), QOCIDateTime::dateTime, TempStorage::dateTimes, QOCIDateTime::fromOCIDateTime(), qMakeLongLong(), qMakeULongLong(), TempStorage::rawData, QList< T >::takeFirst(), and QDateTime::time().

Referenced by QOCICols::execBatch(), and QOCIResultPrivate::outValues().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qOraWarn()

QString qOraWarn ( OCIError *  err,
int *  errorCode = 0 
)
static

Definition at line 567 of file qsql_oci.cpp.

References text.

Referenced by qMakeError(), and qOraWarning().

+ Here is the caller graph for this function:

◆ qOraWarning()

void qOraWarning ( const char *  msg,
OCIError *  err 
)
static

Definition at line 586 of file qsql_oci.cpp.

References Q_UNUSED, qOraWarn(), qPrintable, and qWarning.

Referenced by QOCICols::QOCICols(), QOCIDriver::beginTransaction(), QOCIResultPrivate::bindValue(), QOCIDriver::commitTransaction(), QOCIResult::exec(), QOCICols::execBatch(), QOCIResult::gotoNext(), QOCIResult::prepare(), qReadLob(), QOCICols::readPiecewise(), QOCIDriver::rollbackTransaction(), QOCIResultPrivate::setCharset(), and QOCIResultPrivate::setStatementAttributes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qParseOpts()

static void qParseOpts ( const QString options,
QOCIDriverPrivate d 
)
static

Definition at line 2188 of file qsql_oci.cpp.

References d, QStringView::mid(), ok, opt, qWarning, Qt::SkipEmptyParts, split(), and QStringView::trimmed().

Referenced by QOCIDriver::open().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qReadLob()

template<class T , int sz>
int qReadLob ( T &  buf,
const QOCIResultPrivate d,
OCILobLocator *  lob 
)

Definition at line 1654 of file qsql_oci.cpp.

References d, QOCIEncoding, and qOraWarning().

+ Here is the call graph for this function:

◆ qSplitTableAndOwner()

void qSplitTableAndOwner ( const QString tname,
QString tbl,
QString owner 
)

Definition at line 2535 of file qsql_oci.cpp.

References i, QString::indexOf(), QString::left(), QString::length(), and QString::right().

Referenced by QOCIDriver::primaryIndex(), and QOCIDriver::record().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ qOraCharset

const ub2 qOraCharset = OCI_UCS2ID
static

Definition at line 73 of file qsql_oci.cpp.

Referenced by QOCIResultPrivate::setCharset().