📄 sdora.pas
字号:
OCI_FIRST_PIECE= 1; // the first of many pieces
OCI_NEXT_PIECE = 2; // the next of many pieces
OCI_LAST_PIECE = 3; // the last piece of this column
// input data types
SQLT_CHR = 1; // (ORANET TYPE) character string
SQLT_NUM = 2; // (ORANET TYPE) oracle numeric
SQLT_INT = 3; // (ORANET TYPE) integer
SQLT_FLT = 4; // (ORANET TYPE) Floating point number
SQLT_STR = 5; // zero terminated string
SQLT_VNU = 6; // NUM with preceding length byte
SQLT_PDN = 7; // (ORANET TYPE) Packed Decimal Numeric
SQLT_LNG = 8; // long
SQLT_VCS = 9; // Variable character string
SQLT_NON = 10; // Null/empty PCC Descriptor entry
SQLT_RID = 11; // rowid
SQLT_DAT = 12; // date in oracle format
SQLT_VBI = 15; // binary in VCS format
SQLT_BIN = 23; // binary data(DTYBIN)
SQLT_LBI = 24; // long binary
SQLT_UIN = 68; // unsigned integer
SQLT_SLS = 91; // Display sign leading separate
SQLT_LVC = 94; // Longer longs (char)
SQLT_LVB = 95; // Longer long binary
SQLT_AFC = 96; // Ansi fixed char
SQLT_AVC = 97; // Ansi Var char
SQLT_CUR = 102; // cursor type
SQLT_RDD = 104; // rowid descriptor
SQLT_LAB = 105; // label type
SQLT_OSL = 106; // oslabel type
SQLT_NTY = 108; // named object type
SQLT_REF = 110; // ref type
SQLT_CLOB = 112; // character lob
SQLT_BLOB = 113; // binary lob
SQLT_BFILE = 114; // binary file lob
SQLT_CFILE = 115; // character file lob
SQLT_RSET = 116; // result set type
SQLT_NCO = 122; // named collection type (varray or nested table)
SQLT_VST = 155; // OCIString type
SQLT_ODT = 156; // OCIDate type
// datetimes and intervals
SQLT_DATE = 184; // ANSI Date
SQLT_TIME = 185; // TIME
SQLT_TIME_TZ = 186; // TIME WITH TIME ZONE
SQLT_TIMESTAMP = 187; // TIMESTAMP
SQLT_TIMESTAMP_TZ = 188; // TIMESTAMP WITH TIME ZONE
SQLT_INTERVAL_YM = 189; // INTERVAL YEAR TO MONTH
SQLT_INTERVAL_DS = 190; // INTERVAL DAY TO SECOND
SQLT_TIMESTAMP_LTZ = 232; // TIMESTAMP WITH LOCAL TZ
SQLT_PNTY = 241; // pl/sql representation of named types
// CHAR/NCHAR/VARCHAR2/NVARCHAR2/CLOB/NCLOB char set "form" information
SQLCS_IMPLICIT= 1; // for CHAR, VARCHAR2, CLOB w/o a specified set
SQLCS_NCHAR = 2; // for NCHAR, NCHAR VARYING, NCLOB
SQLCS_EXPLICIT= 3; // for CHAR, etc, with "CHARACTER SET ..." syntax
SQLCS_FLEXIBLE= 4; // for PL/SQL "flexible" parameters
SQLCS_LIT_NULL= 5; // for typecheck of NULL and empty_clob() lits
{*******************************************************************************
* Declare the OCI functions. *
* Prototype information is included. *
* Use this header for ANSI C compilers. *
*******************************************************************************}
{$IFNDEF SD_CLR}
var
{ OCI BIND (Piecewise or with Skips) }
obindps: function(cursor: PCdaDef; opcode: ub1; sqlvar: PText;
sqlvl: sb4; pvctx: dvoid; progvl: sb4; ftype, scale: sword;
ind, alen, arcode: ub2p;
pv_skip, ind_skip, alen_skip, rc_skip: sb4;
maxsiz: ub4; cursiz: ub4p;
fmt: PText; fmtl: sb4; fmtt: sword): sword; cdecl;
obreak: function(ldaptr: PCdaDef): sword; cdecl;
ocan: function(cursor: PCdaDef): sword; cdecl;
oclose: function(cursor: PCdaDef): sword; cdecl;
ocof: function(ldaptr: PCdaDef): sword; cdecl;
ocom: function(ldaptr: PCdaDef): sword; cdecl;
ocon: function(ldaptr: PCdaDef): sword; cdecl;
{ OCI DEFINe (Piecewise or with Skips) }
odefinps: function(cursor: PCdaDef; opcode: ub1; pos: sword; bufctx: PText;
bufl: sb4; ftype, scale: sword; indp: sb2p;
fmt: PText; fmtl: sb4; fmtt: sword; rlen, rcode: ub2p;
pv_skip, ind_skip, alen_skip, rc_skip: sb4): sword; cdecl;
odessp: function(cursor: PCdaDef; objnam: PText; onlen: size_t;
rsv1: ub1p; rsv1ln: size_t; rsv2: ub1p; rsv2ln: size_t;
ovrld, pos, level: ub2p; text: PText;
arnlen, dtype: ub2p; defsup, mode: ub1p;
dtsiz: ub4p; prec, scale: sb2p; radix: ub1p;
spare: ub4p; var arrsiz: ub4): sword; cdecl;
odescr: function(cursor: PCdaDef; pos: sword; var dbsize: sb4;
var dbtype: sb2; cbuf: PText; var cbufl, dsize: sb4;
var prec, scale, nullok: sb2): sword; cdecl;
oerhms: function(ldaptr: PLdaDef; rcode: sb2; buf: PText;
bufsiz: sword): sword; cdecl;
oermsg: function(rcode: sb2; buf: PText): sword; cdecl;
oexec : function(cursor: PCdaDef): sword; cdecl;
oexfet: function(cursor: PCdaDef; nrows: ub4; cancel, exact: sword): sword; cdecl;
oexn: function(cursor: PCdaDef; iters, rowoff: sword): sword; cdecl;
ofen: function(cursor: PCdaDef; nrows: sword): sword; cdecl;
ofetch: function(cursor: PCdaDef): sword; cdecl;
oflng: function(cursor: PCdaDef; pos: sword; buf: PText;
bufl: sb4; dtype: sword; var retl: ub4; offset: sb4): sword; cdecl;
ogetpi: function(cursor: PCdaDef; var piece: ub1; var ctxp: dvoid;
var iter, index: ub4): sword; cdecl;
oopt: function(cursor: PCdaDef; rbopt, waitopt: sword): sword; cdecl;
opinit: function(mode: ub4): sword; cdecl;
olog: function(ldaptr: PLdaDef; hdaptr: PHdaDef;
uid: PText; uidl: sword;
pswd: PText; pswdl: sword;
conn: PText; connl: sword;
mode: ub4): sword; cdecl;
ologof: function(ldaptr: PLdaDef): sword; cdecl;
oopen: function(cursor: PCdaDef; ldaptr: PCdaDef;
dbn: PText; dbnl, arsize: sword;
uid: PText; uidl: sword): sword; cdecl;
oparse: function(cursor: PCdaDef; sqlstm: PText; sqllen: sb4;
defflg: sword; lngflg: ub4): sword; cdecl;
orol: function(ldaptr: PCdaDef): sword; cdecl;
osetpi: function(cursor: PCdaDef; piece: ub1; bufp: dvoid; var len: ub4): sword; cdecl;
{ non-blocking functions }
onbset: function(ldaptr: PCdaDef): sword; cdecl;
onbtst: function(ldaptr: PCdaDef): sword; cdecl;
onbclr: function(ldaptr: PCdaDef): sword; cdecl;
// ognfd: function(var lda: TCdaDef; fdp: dvoid): sword; cdecl; Function is not exist in OCI 7.2 and some OCI 7.3
{************************* OBSOLETE CALLS ********************************}
{ OBSOLETE BIND CALLS }
obndra: function(cursor: PCdaDef; sqlvar: PText; sqlvl: sword;
progv: PText; progvl, ftype, scale: sword;
indp: sb2p; alen, arcode: ub2p; maxsiz: ub4;
cursiz: ub4p; fmt: PText; fmtl, fmtt: sword): sword; cdecl;
obndrn: function(cursor: PCdaDef; sqlvn: sword;
progv: PText; progvl, ftype, scale: sword;
indp: sb2p; fmt: PText; fmtl, fmtt: sword): sword; cdecl;
obndrv: function(cursor: PCdaDef; sqlvar: PText; sqlvl: sword;
progv: PText; progvl, ftype, scale: sword;
indp: sb2p; fmt: PText; fmtl, fmtt: sword): sword; cdecl;
{ OBSOLETE DEFINE CALLS }
odefin: function(cursor: PCdaDef; pos: sword; buf: PText;
bufl, ftype, scale: sword; indp: sb2p;
fmt: PText; fmtl, fmtt: sword; rlen, rcode: ub2p): sword; cdecl;
{$ENDIF}
const
MAXERRMSG = 1000;
DEFERRED_PARSE = 1;
ORACLE7_PARSE = 2;
// Oracle command type
ORA_CT_CTB = 1; // CREATE TABLE
ORA_CT_SRL = 2; // SET ROLE
ORA_CT_INS = 3; // INSERT
ORA_CT_SEL = 4; // SELECT
ORA_CT_UPD = 5; // UPDATE
ORA_CT_DRL = 6; // DROP ROLE
ORA_CT_DVW = 7; // DROP VIEW
ORA_CT_DTB = 8; // DROP TABLE
ORA_CT_DEL = 9; // DELETE
ORA_CT_CVW = 10; // CREATE VIEW
ORA_CT_DUS = 11; // DROP USER
ORA_CT_CRL = 12; // CREATE ROLE
ORA_CT_CSQ = 13; // CREATE SEQUENCE
ORA_CT_ASQ = 14; // ALTER SEQUENCE
// ORA_CT_ = 15; (not used)
ORA_CT_DSQ = 16; // DROP SEQUENCE
ORA_CT_CSC = 17; // CREATE SCHEMA
ORA_CT_CCL = 18; // CREATE CLUSTER
ORA_CT_CUS = 19; // CREATE USER
ORA_CT_CIN = 20; // CREATE INDEX
ORA_CT_DIN = 21; // DROP INDEX
ORA_CT_DCL = 22; // DROP CLUSTER
ORA_CT_VIN = 23; // VALIDATE INDEX
ORA_CT_CPR = 24; // CREATE PROCEDURE
ORA_CT_APR = 25; // ALTER PROCEDURE
ORA_CT_ATB = 26; // ALTER TABLE
ORA_CT_EXP = 27; // EXPLAIN
ORA_CT_GRT = 28; // GRANT
ORA_CT_RVK = 29; // REVOKE
ORA_CT_CSY = 30; // CREATE SYNONYM
ORA_CT_DSY = 31; // DROP SYNONYM
// ORA_CT_ = 32; // ALTER SYSTEM SWITCH LOG
ORA_CT_STR = 33; // SET TRANSACTION
ORA_CT_PEX = 34; // PL/SQL EXECUTE
ORA_CT_LTB = 35; // LOCK TABLE
// ORA_CT_ = 36; (not used)
ORA_CT_REN = 37; // RENAME
ORA_CT_COM = 38; // COMMENT
ORA_CT_AUD = 39; // AUDIT
ORA_CT_NAU = 40; // NOAUDIT
ORA_CT_AIN = 41; // ALTER INDEX
// ORA_CT_ = 42; // CREATE EXTERNAL DATABASE
// ORA_CT_ = 43; // DROP EXTERNAL DATABASE
ORA_CT_CDB = 44; // CREATE DATABASE
ORA_CT_ADB = 45; // ALTER DATABASE
// ORA_CT_ = 46; // CREATE ROLLBACK SEGMENT
// ORA_CT_ = 47; // ALTER ROLLBACK SEGMENT
// ORA_CT_ = 48; // DROP ROLLBACK SEGMENT
ORA_CT_CTS = 49; // CREATE TABLESPACE
ORA_CT_ATS = 50; // ALTER TABLESPACE
ORA_CT_DTS = 51; // DROP TABLESPACE
ORA_CT_ASE = 52; // ALTER SESSION
ORA_CT_AUS = 53; // ALTER USER
ORA_CT_CMT = 54; // COMMIT
ORA_CT_RBK = 55; // ROLLBACK
ORA_CT_SVP = 56; // SAVEPOINT
// ORA_CT_ = 57; // CREATE CONTROL FILE
// ORA_CT_ATRC = 58; // ALTER TRACING
ORA_CT_CTR = 59; // CREATE TRIGGER
ORA_CT_ATR = 60; // ALTER TRIGGER
ORA_CT_DTR = 61; // DROP TRIGGER
// ORA_CT_ = 62; // ANALYZE TABLE
// ORA_CT_ = 63; // ANALYZE INDEX
// ORA_CT_ = 64; // ANALYZE CLUSTER
ORA_CT_CPF = 65; // CREATE PROFILE
ORA_CT_DPF = 66; // DROP PROFILE
ORA_CT_APF = 67; // ALTER PROFILE
ORA_CT_DPR = 68; // DROP PROCEDURE
// ORA_CT_ = 69; (not used)
// ORA_CT_ = 70; // ALTER RESOURCE COST
// ORA_CT_ = 71; // CREATE SNAPSHOT LOG
// ORA_CT_ = 72; // ALTER SNAPSHOT LOG
// ORA_CT_ = 73; // DROP SNAPSHOT LOG
ORA_CT_CSN = 74; // CREATE SNAPSHOT
ORA_CT_ASN = 75; // ALTER SNAPSHOT
ORA_CT_DSN = 76; // DROP SNAPSHOT
// Oracle Internal Datatypes Sizes
ORA_DTS_VARCHAR2 = 2000; // 2000 bytes
ORA_DTS_NUMBER = 21; // 21 bytes
ORA_DTS_LONG = 0; // 2^31-1 bytes
ORA_DTS_ROWID = 6; // 6 bytes
ORA_DTS_DATE = 7; // 7 bytes
ORA_DTS_RAW = 255; // 255 bytes
ORA_DTS_LONG_RAW = 0; // 2^31-1 bytes
ORA_DTS_CHAR = 255; // 255 bytes
ORA_DTS_MLSLABEL = 255; // 255 bytes
const
ORA_ERR_VarNotInSel = 1007; // "variable not in select list" (ORA-01007)
ORA_ERR_INVALID_OCI_OP= 1010; // 'Invalid OCI Operation'
ORA_ERR_PASSWORD_EXPIRED = 28001; // "the password has expired" (ORA-28001)
OCI_MORE_INSERT_PIECES= 3129;
OCI_MORE_FETCH_PIECES = 3130;
// exit flags
OCI_EXIT_FAILURE = 1;
OCI_EXIT_SUCCESS = 0;
MAX_LONG_COL_SIZE = SB4MAXVAL;
// OCI8 begin
{*******************************************************************************
* OCI.h - V8 Oracle Call Interface definitions
*Purpose:
* This file defines all the constants and structures required by a V8
* OCI programmer.
*******************************************************************************}
const
// Modes
OCI_DEFAULT = $00; // the default value for parameters and attributes
OCI_THREADED = $01; // the application is in threaded environment
OCI_OBJECT = $02; // the application is in object environment
OCI_NON_BLOCKING = $04; // non blocking mode of operation
OCI_ENV_NO_MUTEX = $08; // the environment handle will not be protected by a mutex internally
OCI_SHARED = $10; // the application is in shared mode
// Handle Types (handle types range from 1 - 49)
OCI_HTYPE_FIRST = 1; // start value of handle type
OCI_HTYPE_ENV = 1; // environment handle
OCI_HTYPE_ERROR = 2; // error handle
OCI_HTYPE_SVCCTX = 3; // service handle
OCI_HTYPE_STMT = 4; // statement handle
OCI_HTYPE_BIND = 5; // bind handle
OCI_HTYPE_DEFINE = 6; // define handle
OCI_HTYPE_DESCRIBE = 7; // describe handle
OCI_HTYPE_SERVER = 8; // server handle
OCI_HTYPE_SESSION = 9; // authentication handle
OCI_HTYPE_TRANS = 10; // transaction handle
OCI_HTYPE_COMPLEXOBJECT= 11; // complex object retrieval handle
OCI_HTYPE_SECURITY = 12; // security handle
OCI_HTYPE_LAST = 12; // last value of a handle type
// Descriptor Types (descriptor values range from 50 - 255)
OCI_DTYPE_FIRST = 50; // start value of descriptor type
OCI_DTYPE_LOB = 50; // lob locator
OCI_DTYPE_SNAP = 51; // snapshot descriptor
OCI_DTYPE_RSET = 52; // result set descriptor
OCI_DTYPE_PARAM = 53; // a parameter descriptor obtained from ocigparm
OCI_DTYPE_ROWID = 54; // rowid descriptor
OCI_DTYPE_COMPLEXOBJECTCOMP = 55; // complex object retrieval descriptor
OCI_DTYPE_FILE = 56; // File Lob locator
OCI_DTYPE_AQENQ_OPTIONS = 57; // enqueue options
OCI_DTYPE_AQDEQ_OPTIONS = 58; // dequeue options
OCI_DTYPE_AQMSG_PROPERTIES = 59; // message properties
OCI_DTYPE_AQAGENT = 60; // aq agent
OCI_DTYPE_LOCATOR = 61; // LOB locator
OCI_DTYPE_INTERVAL_YM = 62; // Interval year month
OCI_DTYPE_INTERVAL_DS = 63; // Interval day second
OCI_DTYPE_AQNFY_DESCRIPTOR = 64; // AQ notify descriptor
OCI_DTYPE_DATE = 65; // Date
OCI_DTYPE_TIME = 66; // Time
OCI_DTYPE_TIME_TZ = 67; // Time with timezone
OCI_DTYPE_TIMESTAMP = 68; // Timestamp
OCI_DTYPE_TIMESTAMP_TZ= 69; // Timestamp with timezone
OCI_DTYPE_TIMESTAMP_LTZ=70; // Timestamp with local tz
OCI_DTYPE_UCB = 71; // user callback descriptor
OCI_DTYPE_SRVDN = 72; // server DN list descriptor
OCI_DTYPE_SIGNATURE = 73; // signature
OCI_DTYPE_RESERVED_1 = 74; // reserved for internal use
OCI_DTYPE_LAST = 74; // last value of a descriptor type
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -