logo.png
mORMot2 API Reference

mormot.db.raw.oracle.pas unit

Purpose: Database Framework Low-Level Oracle Client Interface Access
- this unit is a part of the Open Source Synopse mORMot framework 2, licensed under a MPL/GPL/LGPL three license - see LICENSE.md

1.1. Units used in the mormot.db.raw.oracle unit

Unit NameDescription
mormot.core.baseFramework Core Shared Types and RTL-like Functions
mormot.core.datetimeFramework Core Low-Level Date and Time Support
mormot.core.logFramework Core Logging
mormot.core.osFramework Core Low-Level Wrappers to the Operating-System API
mormot.core.rttiFramework Core Low-Level Cross-Compiler RTTI Definitions
mormot.core.textFramework Core Low-Level Text Processing
mormot.core.unicodeFramework Core Low-Level Unicode UTF-8 UTF-16 Ansi Conversion
mormot.db.coreDatabase Framework Core Types and Classes
mormot.db.sqlDatabase Framework Shared Abstract SQL Types and Classes

1.2. mormot.db.raw.oracle class hierarchy

TSynLibraryTSqlDBOracleLibTObjectTOracleDateESqlDBExceptionESqlDBOracle
mormot.db.raw.oracle class hierarchy

1.3. Objects implemented in the mormot.db.raw.oracle unit

ObjectsDescription
ESqlDBOracleException type associated to the native Oracle Client Interface (OCI)
OCINumberOracle native number low-level representation
TOracleDateMemory structure used to store a date and time in native Oracle format
TSqlDBOracleLibDirect access to the native Oracle Client Interface (OCI)

1.3.1. OCINumber

OCINumber = packed record

Oracle native number low-level representation


1.3.2. TOracleDate

TOracleDate = object(TObject)

Memory structure used to store a date and time in native Oracle format
- follow the SQLT_DAT column type layout


function ToDateTime: TDateTime;

Convert an Oracle date and time into Delphi TDateTime
- this method will ignore any date before 30 Dec 1899 (i.e. any TDateTime result < 0), to avoid e.g. wrong DecodeTime() computation from retrieved value: if you need to retrieve dates before 1899, you should better retrieve the content using ISO-8601 text encoding


function ToIso8601(Dest: PUtf8Char): integer; overload;

Convert an Oracle date and time into its textual expanded ISO-8601
- will fill up to 21 characters, including double quotes


procedure From(const aIso8601: RawUtf8); overload;

Convert textual ISO-8601 into native Oracle date and time format


procedure From(const aValue: TDateTime); overload;

Convert Delphi TDateTime into native Oracle date and time format


procedure From(aIso8601: PUtf8Char; Length: integer); overload;

Convert textual ISO-8601 into native Oracle date and time format


procedure ToIso8601(var aIso8601: RawUtf8); overload;

Convert an Oracle date and time into its textual expanded ISO-8601
- return the ISO-8601 text, without double quotes


1.3.3. TSqlDBOracleLib

TSqlDBOracleLib = class(TSynLibrary)

Direct access to the native Oracle Client Interface (OCI)


major_version: sword;

The client verion numbers


minor_version: sword;

The client verion numbers


patch_num: sword;

The client verion numbers


port_update_num: sword;

The client verion numbers


SupportsInt64Params: boolean;

If OCI handles directly Int64 bound parameters (revision >= 11.2)


update_num: sword;

The client verion numbers


UseLobChunks: boolean;

OCI will call OCILobGetChunkSize when retrieving BLOB/CLOB content
- is enabled by default, to avoid ORA-2481 errors when reading more than 96 MB of data, but you may disable chunking if you prefer by setting false


constructor Create(LibraryFileName: TFileName = '');

Load the oci.dll library
- and retrieve all Oci*() addresses for OCI_ENTRIES[] items


function ClientRevision: RawUtf8;

Retrieve the client version as 'oci.dll rev. 11.2.0.1'


function ClobFromDescriptor(Stmt: TSqlDBStatement; svchp: POCISvcCtx; errhp: POCIError; locp: POCIDescriptor; ColumnDBForm: integer; out Text: RawUtf8; TextResize: boolean = true): ub4;

Retrieve some CLOB/NCLOB content as UTF-8 text


function CodePageToCharSetID(env: pointer; aCodePage: cardinal): cardinal;

Retrieve the OCI charset ID from a Windows Code Page
- will only handle most known Windows Code Page
- if aCodePage=0, will use the NLS_LANG environment variable
- will use 'WE8MSWIN1252' (CP_WINANSI) if the Code Page is unknown


procedure BlobFromDescriptor(Stmt: TSqlDBStatement; svchp: POCISvcCtx; errhp: POCIError; locp: POCIDescriptor; out result: TBytes); overload;

Retrieve some BLOB content


procedure BlobFromDescriptor(Stmt: TSqlDBStatement; svchp: POCISvcCtx; errhp: POCIError; locp: POCIDescriptor; out result: RawByteString); overload;

Retrieve some BLOB content


procedure BlobFromDescriptorToStream(Stmt: TSqlDBStatement; svchp: POCISvcCtx; errhp: POCIError; locp: POCIDescriptor; stream: TStream);

Retrieve some BLOB content, save it to the stream


procedure BlobToDescriptorFromStream(Stmt: TSqlDBStatement; svchp: POCISvcCtx; errhp: POCIError; locp: POCIDescriptor; stream: TStream);

Write some BLOB content, read it from the stream


procedure Check(Conn: TSqlDBConnection; Stmt: TSqlDBStatement; Status: integer; ErrorHandle: POCIError; InfoRaiseException: boolean = false; LogLevelNoRaise: TSynLogLevel = sllNone);

Raise an exception on error


1.3.4. ESqlDBOracle

ESqlDBOracle = class(ESqlDBException)

Exception type associated to the native Oracle Client Interface (OCI)


1.4. Types implemented in the mormot.db.raw.oracle unit

1.4.1. OCIDuration

OCIDuration = ub2;

OCIDuration - OCI object duration
- A client can specify the duration of which an object is pinned (pin duration) and the duration of which the object is in memory (allocation duration). If the objects are still pinned at the end of the pin duration, the object cache manager will automatically unpin the objects for the client. If the objects still exist at the end of the allocation duration, the object cache manager will automatically free the objects for the client.
- Objects that are pinned with the option OCI_DURATION_TRANS will get unpinned automatically at the end of the current transaction.
- Objects that are pinned with the option OCI_DURATION_SESSION will get unpinned automatically at the end of the current session (connection).
- The option OCI_DURATION_NULL is used when the client does not want to set the pin duration. If the object is already loaded into the cache, then the pin duration will remain the same. If the object is not yet loaded, the pin duration of the object will be set to OCI_DURATION_DEFAULT.


1.4.2. OCITypeCode

OCITypeCode = ub2;

The OCITypeCode type is interchangeable with the existing SQLT type which is a ub2


1.4.3. PSqlT_VNU

PSqlT_VNU = ^TSQLT_VNU;

Points to a Oracle VARNUM memory structure


1.4.4. TOracleDateArray

TOracleDateArray = array[0..(maxInt div SizeOf(TOracleDate)) - 1] of TOracleDate;

Wrapper to an array of TOracleDate items


1.4.5. TSqlT_VNU

TSqlT_VNU = array[0..21] of byte;

Oracle VARNUM memory structure


1.5. Constants implemented in the mormot.db.raw.oracle unit

1.5.1. OCI_ATTR_AGENT_ADDRESS

OCI_ATTR_AGENT_ADDRESS = 65;

Agent name


1.5.2. OCI_ATTR_AGENT_NAME

OCI_ATTR_AGENT_NAME = 64;

1.5.3. OCI_ATTR_AGENT_PROTOCOL

OCI_ATTR_AGENT_PROTOCOL = 66;

Agent address


1.5.4. OCI_ATTR_BUF_ADDR

OCI_ATTR_BUF_ADDR = 76;

Default date format string


1.5.5. OCI_ATTR_BUF_SIZE

OCI_ATTR_BUF_SIZE = 77;

Buffer address


1.5.6. OCI_ATTR_CACHE

OCI_ATTR_CACHE = 115;

Increment value


1.5.7. OCI_ATTR_CLUSTERED

OCI_ATTR_CLUSTERED = 105;

DBA of the segment header


1.5.8. OCI_ATTR_COL_COUNT

OCI_ATTR_COL_COUNT = 82;

Number of rows in column array NOTE that OCI_ATTR_NUM_COLS is a column array attribute too.


1.5.9. OCI_ATTR_DATEFORMAT

OCI_ATTR_DATEFORMAT = 75;

Row offset in the array


1.5.10. OCI_ATTR_DEFAULT_LOBPREFETCH_SIZE

OCI_ATTR_DEFAULT_LOBPREFETCH_SIZE = 438;

Rows fetched in last call


1.5.11. OCI_ATTR_DIRPATH_MODE

OCI_ATTR_DIRPATH_MODE = 78;

Buffer size


1.5.12. OCI_ATTR_DIRPATH_NOLOG

OCI_ATTR_DIRPATH_NOLOG = 79;

Mode of direct path operation


1.5.13. OCI_ATTR_DIRPATH_PARALLEL

OCI_ATTR_DIRPATH_PARALLEL = 80;

Nologging option


1.5.14. OCI_ATTR_DML_ROW_OFFSET

OCI_ATTR_DML_ROW_OFFSET = 74;

Num of errs in array DML


1.5.15. OCI_ATTR_DURATION

OCI_ATTR_DURATION = 132;

Whether table is typed


1.5.16. OCI_ATTR_HW_MARK

OCI_ATTR_HW_MARK = 117;

Whether the sequence is ordered


1.5.17. OCI_ATTR_INCR

OCI_ATTR_INCR = 114;

Maximum value


1.5.18. OCI_ATTR_INDEX_ONLY

OCI_ATTR_INDEX_ONLY = 107;

Whether the table is partitioned


1.5.19. OCI_ATTR_INITIAL_CLIENT_ROLES

OCI_ATTR_INITIAL_CLIENT_ROLES = 100;

Proxy user credentials


1.5.20. OCI_ATTR_IS_INVOKER_RIGHTS

OCI_ATTR_IS_INVOKER_RIGHTS = 133;

Duration of temporary table


1.5.21. OCI_ATTR_IS_TEMPORARY

OCI_ATTR_IS_TEMPORARY = 130;

Parse Error offset


1.5.22. OCI_ATTR_IS_TYPED

OCI_ATTR_IS_TYPED = 131;

Whether table is temporary


1.5.23. OCI_ATTR_LINK

OCI_ATTR_LINK = 111;

REF to the type descriptor


1.5.24. OCI_ATTR_LIST_ARGUMENTS

OCI_ATTR_LIST_ARGUMENTS = 108;

Whether the table is index only


1.5.25. OCI_ATTR_LIST_COLUMNS

OCI_ATTR_LIST_COLUMNS = 103;

Number of columns


1.5.26. OCI_ATTR_LIST_SUBPROGRAMS

OCI_ATTR_LIST_SUBPROGRAMS = 109;

Parameter of the argument list


1.5.27. OCI_ATTR_LTYPE

OCI_ATTR_LTYPE = 128;

TDO of a type


1.5.28. OCI_ATTR_MAX

OCI_ATTR_MAX = 113;

Minimum value


1.5.29. OCI_ATTR_MEMPOOL_APPNAME

OCI_ATTR_MEMPOOL_APPNAME = 90;

Instance name


1.5.30. OCI_ATTR_MEMPOOL_HOMENAME

OCI_ATTR_MEMPOOL_HOMENAME = 91;

Application name


1.5.31. OCI_ATTR_MEMPOOL_INSTNAME

OCI_ATTR_MEMPOOL_INSTNAME = 89;

Pool Size


1.5.32. OCI_ATTR_MEMPOOL_MODEL

OCI_ATTR_MEMPOOL_MODEL = 92;

Home Directory name


1.5.33. OCI_ATTR_MEMPOOL_SIZE

OCI_ATTR_MEMPOOL_SIZE = 88;

Temporary LOBs


1.5.34. OCI_ATTR_MIGSESSION

OCI_ATTR_MIGSESSION = 86;

Server group name


1.5.35. OCI_ATTR_MIN

OCI_ATTR_MIN = 112;

The database link name


1.5.36. OCI_ATTR_MODES

OCI_ATTR_MODES = 93;

Pool Model (proc,thrd,both)


1.5.37. OCI_ATTR_MSG_PROP

OCI_ATTR_MSG_PROP = 72;

Message id


1.5.38. OCI_ATTR_NFY_MSGID

OCI_ATTR_NFY_MSGID = 71;

Queue name


1.5.39. OCI_ATTR_NOCACHE

OCI_ATTR_NOCACHE = 87;

Migratable session attribute


1.5.40. OCI_ATTR_NUM_ATTRS

OCI_ATTR_NUM_ATTRS = 120;

Timestamp of the object


1.5.41. OCI_ATTR_NUM_COLS

OCI_ATTR_NUM_COLS = 102;

Unknown attribute


1.5.42. OCI_ATTR_NUM_DML_ERRORS

OCI_ATTR_NUM_DML_ERRORS = 73;

Message properties


1.5.43. OCI_ATTR_NUM_PARAMS

OCI_ATTR_NUM_PARAMS = 121;

Number of sttributes


1.5.44. OCI_ATTR_NUM_ROWS

OCI_ATTR_NUM_ROWS = 81;

Parallel (temp seg) option


1.5.45. OCI_ATTR_OBJID

OCI_ATTR_OBJID = 122;

Number of parameters


1.5.46. OCI_ATTR_OBJ_ID

OCI_ATTR_OBJ_ID = 136;

Schema name


1.5.47. OCI_ATTR_OBJ_NAME

OCI_ATTR_OBJ_NAME = 134;

Is invoker rights


1.5.48. OCI_ATTR_OBJ_SCHEMA

OCI_ATTR_OBJ_SCHEMA = 135;

Top level schema obj name


1.5.49. OCI_ATTR_ORDER

OCI_ATTR_ORDER = 116;

Number of sequence numbers cached


1.5.50. OCI_ATTR_ORIGINAL_MSGID

OCI_ATTR_ORIGINAL_MSGID = 69;

Sender id


1.5.51. OCI_ATTR_OVERLOAD_ID

OCI_ATTR_OVERLOAD_ID = 125;

Parameter descriptor


1.5.52. OCI_ATTR_PARAM

OCI_ATTR_PARAM = 124;

Type of info described by


1.5.53. OCI_ATTR_PARSE_ERROR_OFFSET

OCI_ATTR_PARSE_ERROR_OFFSET = 129;

List type


1.5.54. OCI_ATTR_PARTITIONED

OCI_ATTR_PARTITIONED = 106;

Whether the table is clustered


1.5.55. OCI_ATTR_PROXY_CREDENTIALS

OCI_ATTR_PROXY_CREDENTIALS = 99;

Associated namespace


1.5.56. OCI_ATTR_PTYPE

OCI_ATTR_PTYPE = 123;

Object id for a table or view


1.5.57. OCI_ATTR_QUEUE_NAME

OCI_ATTR_QUEUE_NAME = 70;

Original message id


1.5.58. OCI_ATTR_RDBA

OCI_ATTR_RDBA = 104;

Parameter of the column list


1.5.59. OCI_ATTR_REF_TDO

OCI_ATTR_REF_TDO = 110;

Parameter of the subprogram list


1.5.60. OCI_ATTR_ROWS_FETCHED

OCI_ATTR_ROWS_FETCHED = 197;

Size of the stm cache


1.5.61. OCI_ATTR_SENDER_ID

OCI_ATTR_SENDER_ID = 68;

Agent protocol


1.5.62. OCI_ATTR_SERVER_GROUP

OCI_ATTR_SERVER_GROUP = 85;

Shared Heap Allocation Size


1.5.63. OCI_ATTR_SHARED_HEAPALLOC

OCI_ATTR_SHARED_HEAPALLOC = 84;

Str off of last row processed


1.5.64. OCI_ATTR_STMTCACHESIZE

OCI_ATTR_STMTCACHESIZE = 176;

Top level schema object id


1.5.65. OCI_ATTR_STREAM_OFFSET

OCI_ATTR_STREAM_OFFSET = 83;

Columns of column array processed so far.


1.5.66. OCI_ATTR_SUBSCR_CALLBACK

OCI_ATTR_SUBSCR_CALLBACK = 95;

Name of subscription


1.5.67. OCI_ATTR_SUBSCR_CTX

OCI_ATTR_SUBSCR_CTX = 96;

Associated callback


1.5.68. OCI_ATTR_SUBSCR_NAME

OCI_ATTR_SUBSCR_NAME = 94;

Modes


1.5.69. OCI_ATTR_SUBSCR_NAMESPACE

OCI_ATTR_SUBSCR_NAMESPACE = 98;

Associated payload


1.5.70. OCI_ATTR_SUBSCR_PAYLOAD

OCI_ATTR_SUBSCR_PAYLOAD = 97;

Associated callback context


1.5.71. OCI_ATTR_TABLESPACE

OCI_ATTR_TABLESPACE = 126;

Overload ID for funcs and procs


1.5.72. OCI_ATTR_TDO

OCI_ATTR_TDO = 127;

Table name space


1.5.73. OCI_ATTR_TIMESTAMP

OCI_ATTR_TIMESTAMP = 119;

Type's schema name


1.5.74. OCI_ATTR_TYPE_SCHEMA

OCI_ATTR_TYPE_SCHEMA = 118;

High-water mark


1.5.75. OCI_ATTR_UNK

OCI_ATTR_UNK = 101;

Initial client role list


1.5.76. OCI_DURATION_CALL

OCI_DURATION_CALL: OCIDuration = OCI_DURATION_BEGIN_ + 2;

WILL BE REMOVED/CHANGED IN A FUTURE RELEASE


1.5.77. OCI_DURATION_CALLOUT

OCI_DURATION_CALLOUT: OCIDuration = OCI_DURATION_CALLOUT_;

This is to be used only during callouts. It is similar to that of OCI_DURATION_CALL, but lasts only for the duration of a callout. Its heap is from PGA


1.5.78. OCI_DURATION_PROCESS

OCI_DURATION_PROCESS: OCIDuration = OCI_DURATION_BEGIN_ - 5;

Last of predefined durations This is not being treated as other predefined durations such as SESSION, CALL etc, because this would not have an entry in the duration table and its functionality is primitive such that only allocate, free, resize memory are allowed, but one cannot create subduration out of this


1.5.79. OCI_DURATION_STATEMENT

OCI_DURATION_STATEMENT: OCIDuration = OCI_DURATION_BEGIN_ + 3;

The end of user client/server call


1.5.80. OCI_OBJECTFREE_FORCE

OCI_OBJECTFREE_FORCE : ub2 = $0001;

OCIObjectFreeFlag - Object free flag
- If OCI_OBJECTCOPY_FORCE is specified when freeing an instance, the instance is freed regardless it is pinned or diritied. If OCI_OBJECTCOPY_NONULL is specified when freeing an instance, the null structure is not freed.


1.5.81. OCI_TYPECODE_BDOUBLE

OCI_TYPECODE_BDOUBLE = SQLT_IBDOUBLE;

Binary float


1.5.82. OCI_TYPECODE_BFILE

OCI_TYPECODE_BFILE = SQLT_BFILEE;

SQL/OTS BINARY LARGE OBJECT


1.5.83. OCI_TYPECODE_BFLOAT

OCI_TYPECODE_BFLOAT = SQLT_IBFLOAT;

SQL DOUBLE PRECISION OTS SQL_DOUBLE


1.5.84. OCI_TYPECODE_BLOB

OCI_TYPECODE_BLOB = SQLT_BLOB;

SQL/OTS NAMED COLLECTION TYPE


1.5.85. OCI_TYPECODE_CFILE

OCI_TYPECODE_CFILE = SQLT_CFILEE;

SQL/OTS CHARACTER LARGE OBJECT


1.5.86. OCI_TYPECODE_CHAR

OCI_TYPECODE_CHAR = SQLT_AFC;

SQL VARCHAR2(N) OTS SQL_VARCHAR2(N)


1.5.87. OCI_TYPECODE_CLOB

OCI_TYPECODE_CLOB = SQLT_CLOB;

SQL/OTS BINARY FILE OBJECT


1.5.88. OCI_TYPECODE_DATE

OCI_TYPECODE_DATE = SQLT_DAT;

SQL/OTS OBJECT REFERENCE


1.5.89. OCI_TYPECODE_DECIMAL

OCI_TYPECODE_DECIMAL = SQLT_PDN;

SQL NUMBER(P S) OTS NUMBER(P S)


1.5.90. OCI_TYPECODE_DOUBLE

OCI_TYPECODE_DOUBLE = 22;

SQL REAL OTS SQL_REAL


1.5.91. OCI_TYPECODE_ERRHP

OCI_TYPECODE_ERRHP = 283;

To indicate error has to be taken from error handle - reserved for sqlplus use


1.5.92. OCI_TYPECODE_FLOAT

OCI_TYPECODE_FLOAT = SQLT_FLT;

Binary double


1.5.93. OCI_TYPECODE_INTEGER

OCI_TYPECODE_INTEGER = SQLT_INT;

SQL SMALLINT OTS SMALLINT


1.5.94. OCI_TYPECODE_INTERVAL_DS

OCI_TYPECODE_INTERVAL_DS = SQLT_INTERVAL_DS;

SQL/OTS INTRVL YR-MON


1.5.95. OCI_TYPECODE_INTERVAL_YM

OCI_TYPECODE_INTERVAL_YM = SQLT_INTERVAL_YM;

TIMESTAMP_LTZ


1.5.96. OCI_TYPECODE_MLSLABEL

OCI_TYPECODE_MLSLABEL = SQLT_LAB;

SQL VARCHAR(N) OTS SQL_VARCHAR(N)


1.5.97. OCI_TYPECODE_NAMEDCOLLECTION

OCI_TYPECODE_NAMEDCOLLECTION = SQLT_NCO;

SQL/OTS Opaque Types


1.5.98. OCI_TYPECODE_NCHAR

OCI_TYPECODE_NCHAR = 286;

Type code for PLS_INTEGER / the following are PL/SQL-only internal. They should not be used OCI_TYPECODE_ITABLE = SQLT_TAB; // PLSQL indexed table OCI_TYPECODE_RECORD = SQLT_REC; // PLSQL record OCI_TYPECODE_boolean = SQLT_BOL; // PLSQL boolean NOTE : The following NCHAR related codes are just short forms for saying OCI_TYPECODE_VARCHAR2 with a charset form of SQLCS_NCHAR. These codes are intended for use in the OCIAnyData API only and nowhere else.


1.5.99. OCI_TYPECODE_NONE

OCI_TYPECODE_NONE = 0;

To indicate absence of typecode being specified


1.5.100. OCI_TYPECODE_NUMBER

OCI_TYPECODE_NUMBER = SQLT_NUM;

SQL FLOAT(P) OTS FLOAT(P)


1.5.101. OCI_TYPECODE_OBJECT

OCI_TYPECODE_OBJECT = SQLT_NTY;

SQL TABLE OTS MULTISET


1.5.102. OCI_TYPECODE_OCTET

OCI_TYPECODE_OCTET = 245;

SQL UNSIGNED INTEGER(32) OTS UINT32


1.5.103. OCI_TYPECODE_OPAQUE

OCI_TYPECODE_OPAQUE = 58;

SQL/OTS NAMED OBJECT TYPE


1.5.104. OCI_TYPECODE_OTMFIRST

OCI_TYPECODE_OTMFIRST = 228;

Urowid type


1.5.105. OCI_TYPECODE_OTMLAST

OCI_TYPECODE_OTMLAST = 320;

First Open Type Manager typecode


1.5.106. OCI_TYPECODE_PLS_INTEGER

OCI_TYPECODE_PLS_INTEGER = 266;

Last OTM system type (internal)


1.5.107. OCI_TYPECODE_PTR

OCI_TYPECODE_PTR = 32;

SQL RAW(N) OTS RAW(N)


1.5.108. OCI_TYPECODE_RAW

OCI_TYPECODE_RAW = SQLT_LVB;

SQL INTEGER OTS INTEGER


1.5.109. OCI_TYPECODE_REAL

OCI_TYPECODE_REAL = 21;

SQL SIGNED INTEGER(32) OTS SINT32


1.5.110. OCI_TYPECODE_REF

OCI_TYPECODE_REF = SQLT_REF;

Type manager typecodes
- These are typecodes designed to be used with the type manager; they also include longer, more readable versions of existing SQLT names
- Those types that are directly related to existing SQLT types are #define'd to their SQLT equivalents
- The type manager typecodes are designed to be useable for all OCI calls. They are in the range from 192 to 320 for typecodes, so as not to conflict with existing OCI SQLT typecodes (see ocidfn.h)


1.5.111. OCI_TYPECODE_SIGNED16

OCI_TYPECODE_SIGNED16 = 28;

SQL SIGNED INTEGER(8) OTS SINT8


1.5.112. OCI_TYPECODE_SIGNED32

OCI_TYPECODE_SIGNED32 = 29;

SQL SIGNED INTEGER(16) OTS SINT16


1.5.113. OCI_TYPECODE_SIGNED8

OCI_TYPECODE_SIGNED8 = 27;

SQL DATE OTS DATE


1.5.114. OCI_TYPECODE_SMALLINT

OCI_TYPECODE_SMALLINT = 246;

SQL ??? OTS OCTET


1.5.115. OCI_TYPECODE_SYSFIRST

OCI_TYPECODE_SYSFIRST = 228;

Last OTM typecode


1.5.116. OCI_TYPECODE_SYSLAST

OCI_TYPECODE_SYSLAST = 235;

First OTM system type (internal)


1.5.117. OCI_TYPECODE_TABLE

OCI_TYPECODE_TABLE = 248;

SQL VARRAY OTS PAGED VARRAY


1.5.118. OCI_TYPECODE_TIME

OCI_TYPECODE_TIME = SQLT_TIME;

SQL/OTS CHARACTER FILE OBJECT the following are ANSI datetime datatypes added in 8.1


1.5.119. OCI_TYPECODE_TIMESTAMP

OCI_TYPECODE_TIMESTAMP = SQLT_TIMESTAMP;

SQL/OTS TIME_TZ


1.5.120. OCI_TYPECODE_TIMESTAMP_LTZ

OCI_TYPECODE_TIMESTAMP_LTZ = SQLT_TIMESTAMP_LTZ;

SQL/OTS TIMESTAMP_TZ


1.5.121. OCI_TYPECODE_TIMESTAMP_TZ

OCI_TYPECODE_TIMESTAMP_TZ = SQLT_TIMESTAMP_TZ;

SQL/OTS TIMESTAMP


1.5.122. OCI_TYPECODE_TIME_TZ

OCI_TYPECODE_TIME_TZ = SQLT_TIME_TZ;

SQL/OTS TIME


1.5.123. OCI_TYPECODE_UNSIGNED16

OCI_TYPECODE_UNSIGNED16 = 25;

SQL UNSIGNED INTEGER(8) OTS UINT8


1.5.124. OCI_TYPECODE_UNSIGNED32

OCI_TYPECODE_UNSIGNED32 = 26;

SQL UNSIGNED INTEGER(16) OTS UINT16


1.5.125. OCI_TYPECODE_UNSIGNED8

OCI_TYPECODE_UNSIGNED8 = SQLT_BIN;

SQL DECIMAL(P S) OTS DECIMAL(P S)


1.5.126. OCI_TYPECODE_UROWID

OCI_TYPECODE_UROWID = SQLT_RDD;

SQL/OTS INTRVL DAY-SEC


1.5.127. OCI_TYPECODE_VARCHAR

OCI_TYPECODE_VARCHAR = SQLT_CHR;

SQL CHAR(N) OTS SQL_CHAR(N)


1.5.128. OCI_TYPECODE_VARCHAR2

OCI_TYPECODE_VARCHAR2 = SQLT_VCS;

SQL POINTER OTS POINTER


1.5.129. OCI_TYPECODE_VARRAY

OCI_TYPECODE_VARRAY = 247;

OTS MLSLABEL


1.5.130. OCI_UTF8

OCI_UTF8 = $367;

Defined here for overriding OCI_CHARSET_UTF8/OCI_CHARSET_WIN1252 if needed


1.6. Functions or procedures implemented in the mormot.db.raw.oracle unit

Functions or proceduresDescription
CharSetIDToCodePageReturn the system code page corresponding to an Oracle Charset code
Int64ToSqlT_VNUConversion from a 64-bit integer to a raw VARNUM memory structure
OracleCharSetNameReturn the text name from an Oracle Charset code
OracleLibraryInitializeTry to load the Oracle Client Library
SimilarCharSetCheck if two Oracle Charset codes are similar

1.6.1. CharSetIDToCodePage

function CharSetIDToCodePage(aCharSetID: cardinal): cardinal;

Return the system code page corresponding to an Oracle Charset code


1.6.2. Int64ToSqlT_VNU

procedure Int64ToSqlT_VNU(Value: Int64; OutData: PSqlT_VNU);

Conversion from a 64-bit integer to a raw VARNUM memory structure


1.6.3. OracleCharSetName

function OracleCharSetName(aCharsetID: cardinal): PUtf8Char;

Return the text name from an Oracle Charset code


1.6.4. OracleLibraryInitialize

procedure OracleLibraryInitialize(const LibraryFileName: TFileName = '');

Try to load the Oracle Client Library
- raise a ESqlDBOracle exception if loading failed
- you could then use the raw API functions via the OCI global variable


1.6.5. SimilarCharSet

function SimilarCharSet(aCharset1, aCharset2: cardinal): boolean;

Check if two Oracle Charset codes are similar


1.7. Variables implemented in the mormot.db.raw.oracle unit

1.7.1. OCI

OCI: TSqlDBOracleLib = nil;

Global variable used to access the Oracle Client Library once loaded
- call first OracleLibraryInitialize to load the library if needd


1.7.2. OCI_CHARSET_UTF8

OCI_CHARSET_UTF8: cardinal = OCI_AL32UTF8;

The OCI charset used for UTF-8 encoding
- OCI_UTF8 is a deprecated encoding, and OCI_AL32UTF8 should be preferred
- but you can fallback for OCI_UTF8 for compatibility purposes


1.7.3. OCI_CHARSET_WIN1252

OCI_CHARSET_WIN1252: cardinal = OCI_WE8MSWIN1252;

The OCI charset used for WinAnsi encoding


1.7.4. SynDBOracleBlobChunksCount

SynDBOracleBlobChunksCount: ub4 = 250;

How many blob chunks should be handled at once


1.7.5. SynDBOracleOCIpath

SynDBOracleOCIpath: TFileName;

Optional folder where the Oracle Client Library is to be searched
- by default, the oci.dll library is searched in the system PATH, then in %ORACLE_HOME%\bin
- you can specify here a folder name in which the oci.dll is to be found