Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsql_oci.cpp File Reference

(46b387f3bd6f3003ef7af2ecf7ec40d60d1d095a)

#include "qsql_oci_p.h"
#include <qcoreapplication.h>
#include <qdatetime.h>
#include <qdebug.h>
#include <qlist.h>
#include <qloggingcategory.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 "moc_qsql_oci_p.cpp"
+ 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 38 of file qsql_oci.cpp.

Referenced by QOCICols::readPiecewise().

◆ QOCI_PREFETCH_MEM

#define QOCI_PREFETCH_MEM   10240

Definition at line 39 of file qsql_oci.cpp.

◆ QOCI_THREADED

#define QOCI_THREADED

Definition at line 44 of file qsql_oci.cpp.

Typedef Documentation

◆ IndicatorArray

typedef QVarLengthArray<sb2, 32> IndicatorArray

Definition at line 79 of file qsql_oci.cpp.

◆ QOCIRowIdPointer

Definition at line 177 of file qsql_oci.cpp.

◆ SizeArray

typedef QVarLengthArray<ub2, 32> SizeArray

Definition at line 80 of file qsql_oci.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
QOCIEncoding 

Definition at line 60 of file qsql_oci.cpp.

◆ Expression

enum Expression
Enumerator
OrExpression 
AndExpression 

Definition at line 2420 of file qsql_oci.cpp.

Function Documentation

◆ make_where_clause()

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

Definition at line 2425 of file qsql_oci.cpp.

References QLatin1StringView::chop(), QString::reserve(), 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 615 of file qsql_oci.cpp.

References QSql::HighPrecision, QSql::LowPrecisionDouble, QSql::LowPrecisionInt32, QSql::LowPrecisionInt64, qCWarning, qUtf16Printable, and QMetaType::UnknownType.

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

+ Here is the caller graph for this function:

◆ qDecodeOCIType() [2/2]

◆ qFromOraInf()

static QSqlField qFromOraInf ( const OraFieldInfo & ofi)
static

Definition at line 728 of file qsql_oci.cpp.

Referenced by QOCICols::QOCICols().

+ Here is the caller graph for this function:

◆ qMakeError()

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

Definition at line 607 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 776 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 747 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 764 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 784 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 594 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 492 of file qsql_oci.cpp.

References QOCIDateTime::fromOCIDateTime(), qMakeLongLong(), and qMakeULongLong().

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 570 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 589 of file qsql_oci.cpp.

References qCWarning, qOraWarn(), and qUtf16Printable.

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 2185 of file qsql_oci.cpp.

References d, QStringView::mid(), ok, opt, qCWarning, qUtf16Printable, Qt::SkipEmptyParts, and split().

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 1651 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 2532 of file qsql_oci.cpp.

References i, and QString::left().

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 76 of file qsql_oci.cpp.

Referenced by QOCIResultPrivate::setCharset().