1 {*********************************************************}
3 { Zeos Database Objects }
4 { Delphi interface to Oracle Call Interface }
6 { Originally written by Sergey Seroukhov }
8 {*********************************************************}
10 {@********************************************************}
11 { Copyright (c) 1999-2012 Zeos Development Group }
13 { License Agreement: }
15 { This library is distributed in the hope that it will be }
16 { useful, but WITHOUT ANY WARRANTY; without even the }
17 { implied warranty of MERCHANTABILITY or FITNESS FOR }
18 { A PARTICULAR PURPOSE. See the GNU Lesser General }
19 { Public License for more details. }
21 { The source code of the ZEOS Libraries and packages are }
22 { distributed under the Library GNU General Public }
23 { License (see the file COPYING / COPYING.ZEOS) }
24 { with the following modification: }
25 { As a special exception, the copyright holders of this }
26 { library give you permission to link this library with }
27 { independent modules to produce an executable, }
28 { regardless of the license terms of these independent }
29 { modules, and to copy and distribute the resulting }
30 { executable under terms of your choice, provided that }
31 { you also meet, for each linked independent module, }
32 { the terms and conditions of the license of that module. }
33 { An independent module is a module which is not derived }
34 { from or based on this library. If you modify this }
35 { library, you may extend this exception to your version }
36 { of the library, but you are not obligated to do so. }
37 { If you do not wish to do so, delete this exception }
38 { statement from your version. }
41 { The project web site is located on: }
42 { http://zeos.firmos.at (FORUM) }
43 { http://sourceforge.net/p/zeoslib/tickets/ (BUGTRACKER)}
44 { svn://svn.code.sf.net/p/zeoslib/code-0/trunk (SVN) }
46 { http://www.sourceforge.net/projects/zeoslib. }
49 { Zeos Development Group. }
50 {********************************************************@}
52 unit ZPlainOracleConstants;
63 {***************** Plain API types definition ****************}
66 WINDOWS_DLL_LOCATION = 'oci.dll';
67 // WINDOWS_DLL_LOCATION = 'ora803.dll';
68 LINUX_DLL_LOCATION = 'libclntsh'+SharedSuffix;
69 // LINUX_DLL_LOCATION = 'libwtc8.so';
72 { Generic Oracle Types }
96 PPOCIHandle = ^Pointer;
98 POCIServer = POCIHandle;
99 POCIError = POCIHandle;
100 POCISvcCtx = POCIHandle;
101 POCIStmt = POCIHandle;
102 POCIDefine = POCIHandle;
103 POCISession = POCIHandle;
104 POCIBind = POCIHandle;
105 POCIDescribe = POCIHandle;
106 POCITrans = POCIHandle;
107 POCITable = POCIHandle;
108 POCIIter = POCIHandle;
110 PPOCIType = ^POCIType;
114 POCITypeCode = POCIHandle;
115 POCITypeElem = POCIHandle;
116 POCITypeIter = POCIHandle;
117 PPOCITypeIter = ^POCITypeIter;
118 POCITypeMethod = POCIHandle;
121 OCI_TYPEGET_HEADER,// load only the header portion of the TDO when getting type
122 OCI_TYPEGET_ALL //load all attribute and method descriptors as well
126 POCIDescriptor = Pointer;
127 PPOCIDescriptor = ^POCIDescriptor;
128 POCISnapshot = POCIDescriptor; //OCI snapshot descriptor
129 POCILobLocator = POCIDescriptor; //OCI Lob Locator descriptor
130 POCIParam = POCIDescriptor; //OCI Parameter descriptor
131 POCIRowid = POCIDescriptor; //OCI ROWID descriptor
132 POCIComplexObjectComp = POCIDescriptor;
133 POCIAQEnqOptions = POCIDescriptor;
134 POCIAQDeqOptions = POCIDescriptor;
135 POCIAQMsgProperties = POCIDescriptor;
136 POCIAQAgent = POCIDescriptor;
137 POCIDateTime = POCIDescriptor; //OCI DateTime descriptor
138 POCINumber = POCIDescriptor;
139 PPOCINumber = ^POCINumber;
140 POCIString = POCIDescriptor;
141 POCIInterval = POCIDescriptor; //OCI Interval descriptor
142 POCIResult = POCIDescriptor; //OCI Result Set Descriptor
143 PPOCITypeElem = PPOCIDescriptor;
144 PPOCITypeMethod = PPOCIDescriptor;
146 OCIDuration = ub2; //enum!
147 POCIDuration = ^OCIDuration;
148 OCITypeEncap = ub2; //enum!
149 OCITypeMethodFlag = ub2; //enum!
150 OCITypeParamMode = ub2; //enum!
151 OCIObjectPropId = ub1;
152 OCIRefreshOpt = ub2; //enum;
155 OCI_DURATION_INVALID = $FFFF; { Invalid duration }
156 OCI_DURATION_BEGIN = 10; { beginning sequence of duration }
157 OCI_DURATION_NULL = (OCI_DURATION_BEGIN-1); { null duration }
158 OCI_DURATION_DEFAULT = (OCI_DURATION_BEGIN-2); { default }
159 OCI_DURATION_USER_CALLBACK = (OCI_DURATION_BEGIN-3);
160 OCI_DURATION_NEXT = (OCI_DURATION_BEGIN-4); { next special duration }
161 OCI_DURATION_SESSION = (OCI_DURATION_BEGIN); { the end of user session }
162 OCI_DURATION_TRANS = (OCI_DURATION_BEGIN+1); { the end of user transaction }
163 OCI_DURATION_STATEMENT = (OCI_DURATION_BEGIN+3);
164 { This is to be used only during callouts. It is similar to that
165 of OCI_DURATION_CALL, but lasts only for the duration of a callout.
166 Its heap is from PGA }
167 OCI_DURATION_CALLOUT = (OCI_DURATION_BEGIN+4);
168 OCI_DURATION_LAST = OCI_DURATION_CALLOUT; { last of predefined durations }
170 OCI_TEMP_BLOB = 1; { LOB type - BLOB }
171 OCI_TEMP_CLOB = 2; { LOB type - CLOB }
175 XIDDATASIZE = 128; { size in bytes }
176 MAXGTRIDSIZE = 64; { maximum size in bytes of gtrid }
177 MAXBQUALSIZE = 64; { maximum size in bytes of bqual }
180 { Transaction branch identification: XID and NULLXID: }
184 formatID: sb4; { format identifier }
185 gtrid_length: sb4; { value from 1 through 64 }
186 bqual_length: sb4; { value from 1 through 64 }
187 data: array [0 .. XIDDATASIZE - 1] of ub1;
194 {***************** Plain API constants definition ****************}
200 OCI_HTYPE_SVCCTX = 3;
203 OCI_HTYPE_DEFINE = 6;
204 OCI_HTYPE_DESCRIBE = 7;
205 OCI_HTYPE_SERVER = 8;
206 OCI_HTYPE_SESSION = 9;
207 OCI_HTYPE_TRANS = 10;
208 OCI_HTYPE_COMPLEXOBJECT = 11;
209 OCI_HTYPE_SECURITY = 12;
210 OCI_HTYPE_SUBSCRIPTION = 13;
211 OCI_HTYPE_DIRPATH_CTX = 14;
212 OCI_HTYPE_DIRPATH_COLUMN_ARRAY = 15;
213 OCI_HTYPE_DIRPATH_STREAM = 16;
217 { OCI Descriptor Types }
218 OCI_DTYPE_FIRST = 50;
219 OCI_DTYPE_LOB = 50; //lob locator
222 OCI_DTYPE_PARAM = 53; //a parameter descriptor obtained from ocigparm
223 OCI_DTYPE_ROWID = 54;
224 OCI_DTYPE_COMPLEXOBJECTCOMP = 55;
225 OCI_DTYPE_FILE = 56; //File Lob locator
226 OCI_DTYPE_AQENQ_OPTIONS = 57; //enqueue options
227 OCI_DTYPE_AQDEQ_OPTIONS = 58; //dequeue options
228 OCI_DTYPE_AQMSG_PROPERTIES = 59; //message properties
229 OCI_DTYPE_AQAGENT = 60; //aq agent
230 OCI_DTYPE_LOCATOR = 61;
231 OCI_DTYPE_INTERVAL_YM = 62; //Interval year month
232 OCI_DTYPE_INTERVAL_DS = 63; //Interval day second
233 OCI_DTYPE_AQNFY_DESCRIPTOR = 64;
235 OCI_DTYPE_DATE = 65; { Date }
236 OCI_DTYPE_TIME = 66; { Time }
237 OCI_DTYPE_TIME_TZ = 67; { Time with timezone }
238 OCI_DTYPE_TIMESTAMP = 68; { Timestamp }
239 OCI_DTYPE_TIMESTAMP_TZ = 69; { Timestamp with timezone }
240 OCI_DTYPE_TIMESTAMP_LTZ = 70; { Timestamp with local tz }
242 { OCI Attributes Types }
243 OCI_ATTR_FNCODE = 1; // the OCI function code
244 OCI_ATTR_OBJECT = 2; // is the environment initialized in object mode
245 OCI_ATTR_NONBLOCKING_MODE = 3; // non blocking mode
246 OCI_ATTR_SQLCODE = 4; // the SQL verb
247 OCI_ATTR_ENV = 5; // the environment handle
248 OCI_ATTR_SERVER = 6; // the server handle
249 OCI_ATTR_SESSION = 7; // the user session handle
250 OCI_ATTR_TRANS = 8; // the transaction handle
251 OCI_ATTR_ROW_COUNT = 9; // the rows processed so far
252 OCI_ATTR_SQLFNCODE = 10; // the SQL verb of the statement
253 OCI_ATTR_PREFETCH_ROWS = 11; // sets the number of rows to prefetch
254 OCI_ATTR_NESTED_PREFETCH_ROWS = 12; // the prefetch rows of nested table
255 OCI_ATTR_PREFETCH_MEMORY = 13; // memory limit for rows fetched
256 OCI_ATTR_NESTED_PREFETCH_MEMORY = 14;// memory limit for nested rows
257 OCI_ATTR_CHAR_COUNT = 15; // this specifies the bind and define size in characters
258 OCI_ATTR_PDSCL = 16; // packed decimal scale
259 OCI_ATTR_FSPRECISION = OCI_ATTR_PDSCL; // fs prec for datetime data types
260 OCI_ATTR_PDPRC = 17; // packed decimal format
261 OCI_ATTR_LFPRECISION = OCI_ATTR_PDPRC; // fs prec for datetime data types
262 OCI_ATTR_PARAM_COUNT = 18; // number of column in the select list
263 OCI_ATTR_ROWID = 19; // the rowid
264 OCI_ATTR_CHARSET = 20; // the character set value
265 OCI_ATTR_NCHAR = 21; // NCHAR type
266 OCI_ATTR_USERNAME = 22; // username attribute
267 OCI_ATTR_PASSWORD = 23; // password attribute
268 OCI_ATTR_STMT_TYPE = 24; // statement type
269 OCI_ATTR_INTERNAL_NAME = 25; // user friendly global name
270 OCI_ATTR_EXTERNAL_NAME = 26; // the internal name for global txn
271 OCI_ATTR_XID = 27; // XOPEN defined global transaction id
272 OCI_ATTR_TRANS_LOCK = 28; //
273 OCI_ATTR_TRANS_NAME = 29; // string to identify a global transaction
274 OCI_ATTR_HEAPALLOC = 30; // memory allocated on the heap
275 OCI_ATTR_CHARSET_ID = 31; // Character Set ID
276 OCI_ATTR_CHARSET_FORM = 32; // Character Set Form
277 OCI_ATTR_MAXDATA_SIZE = 33; // Maximumsize of data on the server
278 OCI_ATTR_CACHE_OPT_SIZE = 34; // object cache optimal size
279 OCI_ATTR_CACHE_MAX_SIZE = 35; // object cache maximum size percentage
280 OCI_ATTR_PINOPTION = 36; // object cache default pin option
281 OCI_ATTR_ALLOC_DURATION = 37; // object cache default allocation duration
282 OCI_ATTR_PIN_DURATION = 38; // object cache default pin duration
283 OCI_ATTR_FDO = 39; // Format Descriptor object attribute
284 OCI_ATTR_POSTPROCESSING_CALLBACK = 40; // Callback to process outbind data
285 OCI_ATTR_POSTPROCESSING_CONTEXT = 41; // Callback context to process outbind data
286 OCI_ATTR_ROWS_RETURNED = 42; // Number of rows returned in current iter - for Bind handles
287 OCI_ATTR_FOCBK = 43; // Failover Callback attribute
288 OCI_ATTR_IN_V8_MODE = 44; // is the server/service context in V8 mode
289 OCI_ATTR_LOBEMPTY = 45; // empty lob ?
290 OCI_ATTR_SESSLANG = 46; // session language handle
292 OCI_ATTR_VISIBILITY = 47; // visibility
293 OCI_ATTR_RELATIVE_MSGID = 48; // relative message id
294 OCI_ATTR_SEQUENCE_DEVIATION = 49; // sequence deviation
296 OCI_ATTR_CONSUMER_NAME = 50; // consumer name
297 OCI_ATTR_DEQ_MODE = 51; // dequeue mode
298 OCI_ATTR_NAVIGATION = 52; // navigation
299 OCI_ATTR_WAIT = 53; // wait
300 OCI_ATTR_DEQ_MSGID = 54; // dequeue message id
302 OCI_ATTR_PRIORITY = 55; // priority
303 OCI_ATTR_DELAY = 56; // delay
304 OCI_ATTR_EXPIRATION = 57; // expiration
305 OCI_ATTR_CORRELATION = 58; // correlation id
306 OCI_ATTR_ATTEMPTS = 59; // # of attempts
307 OCI_ATTR_RECIPIENT_LIST = 60; // recipient list
308 OCI_ATTR_EXCEPTION_QUEUE = 61; // exception queue name
309 OCI_ATTR_ENQ_TIME = 62; // enqueue time (only OCIAttrGet)
310 OCI_ATTR_MSG_STATE = 63; // message state (only OCIAttrGet)
311 // NOTE: 64-66 used below
312 OCI_ATTR_AGENT_NAME = 64; // agent name
313 OCI_ATTR_AGENT_ADDRESS = 65; // agent address
314 OCI_ATTR_AGENT_PROTOCOL = 66; // agent protocol
316 OCI_ATTR_SENDER_ID = 68; // sender id
317 OCI_ATTR_ORIGINAL_MSGID = 69; // original message id
319 OCI_ATTR_QUEUE_NAME = 70; // queue name
320 OCI_ATTR_NFY_MSGID = 71; // message id
321 OCI_ATTR_MSG_PROP = 72; // message properties
323 OCI_ATTR_NUM_DML_ERRORS = 73; // num of errs in array DML
324 OCI_ATTR_DML_ROW_OFFSET = 74; // row offset in the array
326 OCI_ATTR_DATEFORMAT = 75; // default date format string
327 OCI_ATTR_BUF_ADDR = 76; // buffer address
328 OCI_ATTR_BUF_SIZE = 77; // buffer size
329 OCI_ATTR_DIRPATH_MODE = 78; // mode of direct path operation
330 OCI_ATTR_DIRPATH_NOLOG = 79; // nologging option
331 OCI_ATTR_DIRPATH_PARALLEL = 80; // parallel (temp seg) option
332 OCI_ATTR_NUM_ROWS = 81; // number of rows in column array
333 // NOTE that OCI_ATTR_NUM_COLS is a column
334 // array attribute too.
336 OCI_ATTR_COL_COUNT = 82; // columns of column array processed so far.
337 OCI_ATTR_STREAM_OFFSET = 83; // str off of last row processed
338 OCI_ATTR_SHARED_HEAPALLOC = 84; // Shared Heap Allocation Size
340 OCI_ATTR_SERVER_GROUP = 85; // server group name
342 OCI_ATTR_MIGSESSION = 86; // migratable session attribute
344 OCI_ATTR_NOCACHE = 87; // Temporary LOBs
346 OCI_ATTR_MEMPOOL_SIZE = 88; // Pool Size
347 OCI_ATTR_MEMPOOL_INSTNAME = 89; // Instance name
348 OCI_ATTR_MEMPOOL_APPNAME = 90; // Application name
349 OCI_ATTR_MEMPOOL_HOMENAME = 91; // Home Directory name
350 OCI_ATTR_MEMPOOL_MODEL = 92; // Pool Model (proc,thrd,both)
351 OCI_ATTR_MODES = 93; // Modes
353 OCI_ATTR_SUBSCR_NAME = 94; // name of subscription
354 OCI_ATTR_SUBSCR_CALLBACK = 95; // associated callback
355 OCI_ATTR_SUBSCR_CTX = 96; // associated callback context
356 OCI_ATTR_SUBSCR_PAYLOAD = 97; // associated payload
357 OCI_ATTR_SUBSCR_NAMESPACE = 98; // associated namespace
359 OCI_ATTR_PROXY_CREDENTIALS = 99; // Proxy user credentials
360 OCI_ATTR_INITIAL_CLIENT_ROLES = 100; // Initial client role list
362 OCI_ATTR_UNK = 101; // unknown attribute
363 OCI_ATTR_NUM_COLS = 102; // number of columns
364 OCI_ATTR_LIST_COLUMNS = 103; // parameter of the column list
365 OCI_ATTR_RDBA = 104; // DBA of the segment header
366 OCI_ATTR_CLUSTERED = 105; // whether the table is clustered
367 OCI_ATTR_PARTITIONED = 106; // whether the table is partitioned
368 OCI_ATTR_INDEX_ONLY = 107; // whether the table is index only
369 OCI_ATTR_LIST_ARGUMENTS = 108; // parameter of the argument list
370 OCI_ATTR_LIST_SUBPROGRAMS = 109; // parameter of the subprogram list
371 OCI_ATTR_REF_TDO = 110; // REF to the type descriptor
372 OCI_ATTR_LINK = 111; // the database link name
373 OCI_ATTR_MIN = 112; // minimum value
374 OCI_ATTR_MAX = 113; // maximum value
375 OCI_ATTR_INCR = 114; // increment value
376 OCI_ATTR_CACHE = 115; // number of sequence numbers cached
377 OCI_ATTR_ORDER = 116; // whether the sequence is ordered
378 OCI_ATTR_HW_MARK = 117; // high-water mark
379 OCI_ATTR_TYPE_SCHEMA = 118; // type's schema name
380 OCI_ATTR_TIMESTAMP = 119; // timestamp of the object
381 OCI_ATTR_NUM_ATTRS = 120; // number of sttributes
382 OCI_ATTR_NUM_PARAMS = 121; // number of parameters
383 OCI_ATTR_OBJID = 122; // object id for a table or view
384 OCI_ATTR_PTYPE = 123; // type of info described by
385 OCI_ATTR_PARAM = 124; // parameter descriptor
386 OCI_ATTR_OVERLOAD_ID = 125; // overload ID for funcs and procs
387 OCI_ATTR_TABLESPACE = 126; // table name space
388 OCI_ATTR_TDO = 127; // TDO of a type
389 OCI_ATTR_LTYPE = 128; // list type
390 OCI_ATTR_PARSE_ERROR_OFFSET = 129; // Parse Error offset
391 OCI_ATTR_IS_TEMPORARY = 130; // whether table is temporary
392 OCI_ATTR_IS_TYPED = 131; // whether table is typed
393 OCI_ATTR_DURATION = 132; // duration of temporary table
394 OCI_ATTR_IS_INVOKER_RIGHTS = 133; // is invoker rights
395 OCI_ATTR_OBJ_NAME = 134; // top level schema obj name
396 OCI_ATTR_OBJ_SCHEMA = 135; // schema name
397 OCI_ATTR_OBJ_ID = 136; // top level schema object id
399 // for inheritance - part 2
400 OCI_ATTR_IS_FINAL_TYPE = 279; //is final type ?
401 OCI_ATTR_IS_INSTANTIABLE_TYPE = 280; //is instantiable type ?
402 OCI_ATTR_IS_FINAL_METHOD = 281; //is final method ?
403 OCI_ATTR_IS_INSTANTIABLE_METHOD = 282; // is instantiable method ?
404 OCI_ATTR_IS_OVERRIDING_METHOD = 283; // is overriding method ?
406 OCI_ATTR_DESC_SYNBASE = 284; //Describe the base object
408 OCI_ATTR_CHAR_USED = 285; //char length semantics
409 OCI_ATTR_CHAR_SIZE = 286; //char length
411 { OCI Error Return Values }
413 OCI_SUCCESS_WITH_INFO = 1;
416 OCI_INVALID_HANDLE = -2;
418 OCI_STILL_EXECUTING = -3123;
419 OCI_CONTINUE = -24200;
421 { Generic Default Value for Modes, .... }
437 { OCI Authentication Mode }
438 OCI_MIGRATE = $0001; // migratable auth context
439 OCI_SYSDBA = $0002; // for SYSDBA authorization
440 OCI_SYSOPER = $0004; // for SYSOPER authorization
441 OCI_PRELIM_AUTH = $0008; // for preliminary authorization
443 { OCIPasswordChange }
444 OCI_AUTH = $08; // Change the password but do not login
447 SQLT_CHR = 1 ; //(ORANET TYPE) character string
448 SQLT_NUM = 2 ; //(ORANET TYPE) oracle numeric
449 SQLT_INT = 3 ; //(ORANET TYPE) integer
450 SQLT_FLT = 4 ; //(ORANET TYPE) Floating point number
451 SQLT_STR = 5 ; //zero terminated string
452 SQLT_VNU = 6 ; //NUM with preceding length byte
453 SQLT_PDN = 7 ; //(ORANET TYPE) Packed Decimal Numeric
454 SQLT_LNG = 8 ; //long
455 SQLT_VCS = 9 ; //Variable character string
456 SQLT_NON = 10 ; //Null/empty PCC Descriptor entry
457 SQLT_RID = 11 ; //rowid
458 SQLT_DAT = 12 ; //date in oracle format
459 SQLT_VBI = 15 ; //binary in VCS format
460 SQLT_BFLOAT = 21 ; //Native Binary float
461 SQLT_BDOUBLE = 22 ; //NAtive binary double
462 SQLT_BIN = 23 ; //binary data(DTYBIN)
463 SQLT_LBI = 24 ; //long binary
465 SQLT_UIN = 68 ; //unsigned integer
466 SQLT_SLS = 91 ; //Display sign leading separate
467 SQLT_LVC = 94 ; //Longer longs (char)
468 SQLT_LVB = 95 ; //Longer long binary
469 SQLT_AFC = 96 ; //Ansi fixed char
470 SQLT_AVC = 97 ; //Ansi Var char
471 SQLT_IBFLOAT = 100; //binary float canonical
472 SQLT_IBDOUBLE = 101; //binary double canonical
473 SQLT_CUR = 102; //cursor type
474 SQLT_RDD = 104; //rowid descriptor
475 SQLT_LAB = 105; //label type
476 SQLT_OSL = 106; //oslabel type
477 SQLT_NTY = 108; //named object type
478 SQLT_REF = 110; //ref typ
479 SQLT_CLOB = 112; //character lob
480 SQLT_BLOB = 113; //binary lob
481 SQLT_BFILEE = 114; //binary file lob
482 SQLT_CFILEE = 115; //character file lob
483 SQLT_RSET = 116; //result set type
484 SQLT_NCO = 122; //named collection type (varray or nested table)
485 SQLT_VST = 155; //OCIString type
486 SQLT_ODT = 156; //OCIDate type
488 { datetimes and intervals }
489 SQLT_DATE = 184; //ANSI Date
490 SQLT_TIME = 185; //TIME
491 SQLT_TIME_TZ = 186; //TIME WITH TIME ZONE
492 SQLT_TIMESTAMP = 187; //TIMESTAMP
493 SQLT_TIMESTAMP_TZ = 188; //TIMESTAMP WITH TIME ZONE
494 SQLT_INTERVAL_YM = 189; //INTERVAL YEAR TO MONTH
495 SQLT_INTERVAL_DS = 190; //INTERVAL DAY TO SECOND
496 SQLT_TIMESTAMP_LTZ = 232; //TIMESTAMP WITH LOCAL TZ
502 { > typecode defines from oro.h }
503 OCI_TYPECODE_REF = SQLT_REF; //SQL/OTS OBJECT REFERENCE
504 OCI_TYPECODE_VARRAY = 247; //SQL VARRAY OTS PAGED VARRAY
505 OCI_TYPECODE_TABLE = 248; //SQL TABLE OTS MULTISET
506 OCI_TYPECODE_OBJECT = SQLT_NTY; //SQL/OTS NAMED OBJECT TYPE
507 OCI_TYPECODE_OPAQUE = 58; //SQL/OTS Opaque Types
508 OCI_TYPECODE_NAMEDCOLLECTION = SQLT_NCO;
510 { OCI Statement Types }
511 OCI_STMT_SELECT = 1; // select statement
512 OCI_STMT_UPDATE = 2; // update statement
513 OCI_STMT_DELETE = 3; // delete statement
514 OCI_STMT_INSERT = 4; // Insert Statement
515 OCI_STMT_CREATE = 5; // create statement
516 OCI_STMT_DROP = 6; // drop statement
517 OCI_STMT_ALTER = 7; // alter statement
518 OCI_STMT_BEGIN = 8; // begin ... (pl/sql statement)
519 OCI_STMT_DECLARE = 9; // declare .. (pl/sql statement)
521 { OCI Statement language }
522 OCI_NTV_SYNTAX = 1; // Use what so ever is the native lang of server
523 OCI_V7_SYNTAX = 2; // V7 language
524 OCI_V8_SYNTAX = 3; // V8 language
526 { OCI Statement Execute mode }
527 OCI_BATCH_MODE = $01; // batch the oci statement for execution
528 OCI_EXACT_FETCH = $02; // fetch the exact rows specified
529 OCI_SCROLLABLE_CURSOR = $08; // cursor scrollable
530 OCI_DESCRIBE_ONLY = $10; // only describe the statement
531 OCI_COMMIT_ON_SUCCESS = $20; // commit, if successful execution
532 OCI_NON_BLOCKING = $40; // non-blocking
533 OCI_BATCH_ERRORS = $80; // batch errors in array dmls
534 OCI_PARSE_ONLY = $100; // only parse the statement
536 OCI_DATA_AT_EXEC = $02; // data at execute time
537 OCI_DYNAMIC_FETCH = $02; // fetch dynamically
538 OCI_PIECEWISE = $04; // piecewise DMLs or fetch
540 { OCI Transaction modes }
541 OCI_TRANS_NEW = $00000001; // starts a new transaction branch
542 OCI_TRANS_JOIN = $00000002; // join an existing transaction
543 OCI_TRANS_RESUME = $00000004; // resume this transaction
544 OCI_TRANS_STARTMASK = $000000ff;
546 OCI_TRANS_READONLY = $00000100; // starts a readonly transaction
547 OCI_TRANS_READWRITE = $00000200; // starts a read-write transaction
548 OCI_TRANS_SERIALIZABLE = $00000400; // starts a serializable transaction
549 OCI_TRANS_ISOLMASK = $0000ff00;
551 OCI_TRANS_LOOSE = $00010000; // a loosely coupled branch
552 OCI_TRANS_TIGHT = $00020000; // a tightly coupled branch
553 OCI_TRANS_TYPEMASK = $000f0000;
555 OCI_TRANS_NOMIGRATE = $00100000; // non migratable transaction
556 OCI_TRANS_TWOPHASE = $01000000; // use two phase commit
558 { OCI pece wise fetch }
559 OCI_ONE_PIECE = 0; // one piece
560 OCI_FIRST_PIECE = 1; // the first piece
561 OCI_NEXT_PIECE = 2; // the next of many pieces
562 OCI_LAST_PIECE = 3; // the last piece
565 OCI_FETCH_NEXT = $02; // next row
566 OCI_FETCH_FIRST = $04; // first row of the result set
567 OCI_FETCH_LAST = $08; // the last row of the result set
568 OCI_FETCH_PRIOR = $10; // the previous row relative to current
569 OCI_FETCH_ABSOLUTE = $20; // absolute offset from first
570 OCI_FETCH_RELATIVE = $40; // offset relative to current
572 {****************** Describe Handle Parameter Attributes *****************}
574 { Attributes common to Columns and Stored Procs }
575 OCI_ATTR_DATA_SIZE = 1; // maximum size of the data
576 OCI_ATTR_DATA_TYPE = 2; // the SQL type of the column/argument
577 OCI_ATTR_DISP_SIZE = 3; // the display size
578 OCI_ATTR_NAME = 4; // the name of the column/argument
579 OCI_ATTR_PRECISION = 5; // precision if number type
580 OCI_ATTR_SCALE = 6; // scale if number type
581 OCI_ATTR_IS_NULL = 7; // is it null ?
582 OCI_ATTR_TYPE_NAME = 8; // name of the named data type or a package name for package private types
583 OCI_ATTR_SCHEMA_NAME = 9; // the schema name
584 OCI_ATTR_SUB_NAME = 10; // type name if package private type
585 OCI_ATTR_POSITION = 11; // relative position of col/arg in the list of cols/args
587 { complex object retrieval parameter attributes }
588 OCI_ATTR_COMPLEXOBJECTCOMP_TYPE = 50;
589 OCI_ATTR_COMPLEXOBJECTCOMP_TYPE_LEVEL = 51;
590 OCI_ATTR_COMPLEXOBJECT_LEVEL = 52;
591 OCI_ATTR_COMPLEXOBJECT_COLL_OUTOFLINE = 53;
594 OCI_ATTR_DISP_NAME = 100; // the display name
596 { Only Stored Procs }
597 OCI_ATTR_OVERLOAD = 210; // is this position overloaded
598 OCI_ATTR_LEVEL = 211; // level for structured types
599 OCI_ATTR_HAS_DEFAULT = 212; // has a default value
600 OCI_ATTR_IOMODE = 213; // in, out inout
601 OCI_ATTR_RADIX = 214; // returns a radix
602 OCI_ATTR_NUM_ARGS = 215; // total number of arguments
604 { only named type attributes }
605 OCI_ATTR_TYPECODE = 216; // object or collection
606 OCI_ATTR_COLLECTION_TYPECODE = 217; // varray or nested table
607 OCI_ATTR_VERSION = 218; // user assigned version
608 OCI_ATTR_IS_INCOMPLETE_TYPE = 219; // is this an incomplete type
609 OCI_ATTR_IS_SYSTEM_TYPE = 220; // a system type
610 OCI_ATTR_IS_PREDEFINED_TYPE = 221; // a predefined type
611 OCI_ATTR_IS_TRANSIENT_TYPE = 222; // a transient type
612 OCI_ATTR_IS_SYSTEM_GENERATED_TYPE = 223; // system generated type
613 OCI_ATTR_HAS_NESTED_TABLE = 224; // contains nested table attr
614 OCI_ATTR_HAS_LOB = 225; // has a lob attribute
615 OCI_ATTR_HAS_FILE = 226; // has a file attribute
616 OCI_ATTR_COLLECTION_ELEMENT = 227; // has a collection attribute
617 OCI_ATTR_NUM_TYPE_ATTRS = 228; // number of attribute types
618 OCI_ATTR_LIST_TYPE_ATTRS = 229; // list of type attributes
619 OCI_ATTR_NUM_TYPE_METHODS = 230; // number of type methods
620 OCI_ATTR_LIST_TYPE_METHODS = 231; // list of type methods
621 OCI_ATTR_MAP_METHOD = 232; // map method of type
622 OCI_ATTR_ORDER_METHOD = 233; // order method of type
624 { only collection element }
625 OCI_ATTR_NUM_ELEMS = 234; // number of elements
627 { only type methods }
628 OCI_ATTR_ENCAPSULATION = 235; // encapsulation level
629 OCI_ATTR_IS_SELFISH = 236; // method selfish
630 OCI_ATTR_IS_VIRTUAL = 237; // virtual
631 OCI_ATTR_IS_INLINE = 238; // inline
632 OCI_ATTR_IS_CONSTANT = 239; // constant
633 OCI_ATTR_HAS_RESULT = 240; // has result
634 OCI_ATTR_IS_CONSTRUCTOR = 241; // constructor
635 OCI_ATTR_IS_DESTRUCTOR = 242; // destructor
636 OCI_ATTR_IS_OPERATOR = 243; // operator
637 OCI_ATTR_IS_MAP = 244; // a map method
638 OCI_ATTR_IS_ORDER = 245; // order method
639 OCI_ATTR_IS_RNDS = 246; // read no data state method
640 OCI_ATTR_IS_RNPS = 247; // read no process state
641 OCI_ATTR_IS_WNDS = 248; // write no data state method
642 OCI_ATTR_IS_WNPS = 249; // write no process state
644 OCI_ATTR_DESC_PUBLIC = 250; // public object
646 { Object Cache Enhancements : attributes for User Constructed Instances }
647 OCI_ATTR_CACHE_CLIENT_CONTEXT = 251;
648 OCI_ATTR_UCI_CONSTRUCT = 252;
649 OCI_ATTR_UCI_DESTRUCT = 253;
650 OCI_ATTR_UCI_COPY = 254;
651 OCI_ATTR_UCI_PICKLE = 255;
652 OCI_ATTR_UCI_UNPICKLE = 256;
653 OCI_ATTR_UCI_REFRESH = 257;
655 { for type inheritance }
656 OCI_ATTR_IS_SUBTYPE = 258;
657 OCI_ATTR_SUPERTYPE_SCHEMA_NAME = 259;
658 OCI_ATTR_SUPERTYPE_NAME = 260;
661 OCI_ATTR_LIST_OBJECTS = 261; // list of objects in schema
664 OCI_ATTR_NCHARSET_ID = 262; // char set id
665 OCI_ATTR_LIST_SCHEMAS = 263; // list of schemas
666 OCI_ATTR_MAX_PROC_LEN = 264; // max procedure length
667 OCI_ATTR_MAX_COLUMN_LEN = 265; // max column name length
668 OCI_ATTR_CURSOR_COMMIT_BEHAVIOR = 266; // cursor commit behavior
669 OCI_ATTR_MAX_CATALOG_NAMELEN = 267; // catalog namelength
670 OCI_ATTR_CATALOG_LOCATION = 268; // catalog location
671 OCI_ATTR_SAVEPOINT_SUPPORT = 269; // savepoint support
672 OCI_ATTR_NOWAIT_SUPPORT = 270; // nowait support
673 OCI_ATTR_AUTOCOMMIT_DDL = 271; // autocommit DDL
674 OCI_ATTR_LOCKING_MODE = 272; // locking mode
676 OCI_ATTR_CACHE_ARRAYFLUSH = $40;
677 OCI_ATTR_OBJECT_NEWNOTNULL = $10;
678 OCI_ATTR_OBJECT_DETECTCHANGE = $20;
680 {client side character and national character set ids }
681 OCI_ATTR_ENV_CHARSET_ID = OCI_ATTR_CHARSET_ID; // charset id in env
682 OCI_ATTR_ENV_NCHARSET_ID = OCI_ATTR_NCHARSET_ID; // ncharset id in env
684 { Piece Information }
685 OCI_PARAM_IN = $01; // in parameter
686 OCI_PARAM_OUT = $02; // out parameter
688 { LOB Buffering Flush Flags }
689 OCI_LOB_BUFFER_FREE = 1;
690 OCI_LOB_BUFFER_NOFREE = 2;
693 OCI_FILE_READONLY = 1; // readonly mode open for FILE types
695 OCI_LOB_READONLY = 1; // readonly mode open for ILOB types
696 OCI_LOB_READWRITE = 2; // read write mode open for ILOBs
698 { CHAR/NCHAR/VARCHAR2/NVARCHAR2/CLOB/NCLOB char set "form" information }
699 SQLCS_IMPLICIT = 1; // for CHAR, VARCHAR2, CLOB w/o a specified set
700 SQLCS_NCHAR = 2; // for NCHAR, NCHAR VARYING, NCLOB
701 SQLCS_EXPLICIT = 3; // for CHAR, etc, with "CHARACTER SET ..." syntax
702 SQLCS_FLEXIBLE = 4; // for PL/SQL "flexible" parameters
703 SQLCS_LIT_NULL = 5; // for typecheck of NULL and empty_clob() lits
705 {************************ OCIDesribeAny *************************}
713 OCI_PTYPE_UNK = 0; // unknown
714 OCI_PTYPE_TABLE = 1; // table
715 OCI_PTYPE_VIEW = 2; // view
716 OCI_PTYPE_PROC = 3; // procedure
717 OCI_PTYPE_FUNC = 4; // function
718 OCI_PTYPE_PKG = 5; // package
719 OCI_PTYPE_TYPE = 6; // user-defined type
720 OCI_PTYPE_SYN = 7; // synonym
721 OCI_PTYPE_SEQ = 8; // sequence
722 OCI_PTYPE_COL = 9; // column
723 OCI_PTYPE_ARG = 10; // argument
724 OCI_PTYPE_LIST = 11; // list
725 OCI_PTYPE_TYPE_ATTR = 12; // user-defined type's attribute
726 OCI_PTYPE_TYPE_COLL = 13; // collection type's element
727 OCI_PTYPE_TYPE_METHOD = 14; // user-defined type's method
728 OCI_PTYPE_TYPE_ARG = 15; // user-defined type method's argument
729 OCI_PTYPE_TYPE_RESULT = 16; // user-defined type method's result
731 { Proc/Func param type }
732 OCI_TYPEPARAM_IN = 0;
733 OCI_TYPEPARAM_OUT = 1;
734 OCI_TYPEPARAM_INOUT = 2;
737 OCI_NLS_CHARSET_MAXBYTESZ = 91;
740 OCI_PIN_DEFAULT = 1; //* default pin option */
741 OCI_PIN_ANY = 3; //* pin any copy of the object */
742 OCI_PIN_RECENT = 4; //* pin recent copy of the object */
743 OCI_PIN_LATEST = 5; //* pin latest copy of the object */
746 OCI_LOCK_NONE = 1; //* null (same as no lock) */
747 OCI_LOCK_X = 2; //* exclusive lock */
748 OCI_LOCK_X_NOWAIT = 3; //* exclusive lock, do not wait */
750 { OBJECT FREE OPTION }
751 OCI_OBJECTFREE_FORCE =1;
752 OCI_OBJECTFREE_NONULL=2;
757 TOCIInitialize = function(mode: ub4; ctxp: Pointer; malocfp: Pointer;
758 ralocfp: Pointer; mfreefp: Pointer): sword; cdecl;
760 TOCIEnvInit = function(var envhpp: POCIEnv; mode: ub4; xtramemsz: size_T;
761 usrmempp: PPointer): sword; cdecl;
763 TOCIEnvCreate = function(var envhpp: POCIEnv; mode: ub4; ctxp: Pointer;
764 malocfp: Pointer; ralocfp: Pointer; mfreefp: Pointer; xtramemsz: size_T;
765 usrmempp: PPointer): sword; cdecl;
767 TOCIEnvNlsCreate = function(var envhpp: POCIEnv; mode: ub4; ctxp: Pointer;
768 malocfp: Pointer; ralocfp: Pointer; mfreefp: Pointer; xtramemsz: size_T;
769 usrmempp: PPointer; charset, ncharset: ub2): sword; cdecl;
771 TOCIHandleAlloc = function(parenth: POCIHandle; var hndlpp: POCIHandle;
772 atype: ub4; xtramem_sz: size_T; usrmempp: PPointer): sword; cdecl;
774 TOCIServerAttach = function(srvhp: POCIServer; errhp: POCIError; dblink: text;
775 dblink_len: sb4; mode: ub4): sword; cdecl;
777 TOCIAttrSet = function(trgthndlp: POCIHandle; trghndltyp: ub4;
778 attributep: Pointer; size: ub4; attrtype: ub4; errhp: POCIError):sword; cdecl;
780 TOCISessionBegin = function(svchp: POCISvcCtx; errhp: POCIError;
781 usrhp: POCISession; credt: ub4; mode: ub4):sword; cdecl;
783 TOCISessionEnd = function(svchp: POCISvcCtx; errhp: POCIError;
784 usrhp: POCISession; mode: ub4): sword; cdecl;
786 TOCIServerDetach = function(srvhp: POCIServer; errhp: POCIError;
787 mode: ub4): sword; cdecl;
789 TOCIHandleFree = function(hndlp: Pointer; atype: ub4): sword; cdecl;
791 TOCIErrorGet = function(hndlp: Pointer; recordno: ub4; sqlstate: text;
792 var errcodep: sb4; bufp: text; bufsiz: ub4; atype: ub4): sword; cdecl;
794 TOCIStmtPrepare = function(stmtp: POCIStmt; errhp: POCIError; stmt: text;
795 stmt_len: ub4; language:ub4; mode: ub4):sword; cdecl;
797 TOCIStmtExecute = function(svchp: POCISvcCtx; stmtp: POCIStmt;
798 errhp: POCIError; iters: ub4; rowoff: ub4; snap_in: POCISnapshot;
799 snap_out: POCISnapshot; mode: ub4): sword; cdecl;
801 TOCIParamGet = function(hndlp: Pointer; htype: ub4; errhp: POCIError;
802 var parmdpp: Pointer; pos: ub4): sword; cdecl;
804 TOCIAttrGet = function(trgthndlp: POCIHandle; trghndltyp: ub4;
805 attributep: Pointer; sizep: Pointer; attrtype: ub4;
806 errhp: POCIError):sword; cdecl;
808 TOCIStmtFetch = function(stmtp: POCIStmt; errhp: POCIError; nrows: ub4;
809 orientation: ub2; mode: ub4): sword; cdecl;
811 TOCIDefineByPos = function(stmtp: POCIStmt; var defnpp: POCIDefine;
812 errhp: POCIError; position: ub4; valuep: Pointer; value_sz: sb4; dty: ub2;
813 indp: Pointer; rlenp: Pointer; rcodep: Pointer; mode: ub4): sword; cdecl;
815 TOCIDefineArrayOfStruct = function(defnpp: POCIDefine; errhp: POCIError;
816 pvskip: ub4; indskip: ub4; rlskip: ub4; rcskip: ub4): sword; cdecl;
818 TOCIBindByPos = function(stmtp: POCIStmt; var bindpp: POCIBind;
819 errhp: POCIError; position: ub4; valuep: Pointer; value_sz: sb4; dty: ub2;
820 indp: Pointer; alenp: Pointer; rcodep: Pointer; maxarr_len: ub4;
821 curelep: Pointer; mode: ub4): sword; cdecl;
823 TOCIBindByName = function(stmtp: POCIStmt; var bindpp: POCIBind;
824 errhp: POCIError; placeholder: text; placeh_len: sb4; valuep: Pointer;
825 value_sz: sb4; dty: ub2; indp: Pointer; alenp: Pointer; rcodep: Pointer;
826 maxarr_len: ub4; curelep: Pointer; mode: ub4): sword; cdecl;
828 TOCIBindDynamic = function(bindp: POCIBind; errhp: POCIError; ictxp: Pointer;
829 icbfp: Pointer; octxp: Pointer; ocbfp: Pointer): sword; cdecl;
831 (*---------------------------------OCIBindObject--------------------------------
833 This function sets up additional attributes which are required for a named
834 data type (object) bind.
836 ------------------------------------------------------------------------------*)
837 TOCIBindObject = function(bindp: POCIBind; errhp: POCIError;
838 const _type: POCIType; pgvpp: PPointer;
839 pvszsp: pub4; indpp: PPointer;
840 indszp: pub4): sword; cdecl;
842 This function sets up additional attributes which binding a named data type
843 or a REF. An error will be returned if this function is called when the OCI
844 environment has been initialized in non-object mode.
845 This call takes as a paramter a type descriptor object (TDO) of datatype
846 OCIType for the named data type being defined. The TDO can be retrieved
847 with a call to OCITypeByName().
848 If the OCI_DATA_AT_EXEC mode was specified in ocibindn() or ocibindp(), the
849 pointers to the IN buffers are obtained either using the callback icbfp
850 registered in the OCIBindDynamic() call or by the OCIStmtSetPieceInfo() call.
851 The buffers are dynamically allocated for the OUT data and the pointers to
852 these buffers are returned either by calling ocbfp() registered by the
853 OCIBindDynamic() or by setting the pointer to the buffer in the buffer passed
854 in by OCIStmtSetPieceInfo() called when OCIStmtExecute() returned
855 OCI_NEED_DATA. The memory of these client library- allocated buffers must be
856 freed when not in use anymore by using the OCIObjectFreee() call.
858 bindp ( IN/OUT) - the bind handle returned by the call to OCIBindByName()
860 errhp ( IN/OUT) - an error handle which can be passed to OCIErrorGet() for
861 diagnostic information in the event of an error.
862 type ( IN) - points to the TDO which describes the type of the program
863 variable being bound. Retrieved by calling OCITypeByName().
864 pgvpp ( IN/OUT) - points to a pointer to the program variable buffer. For an
865 array, pgvpp points to an array of pointers. When the bind variable is also an
866 OUT variable, the OUT Named Data Type value or REF is allocated
867 (unpickled) in the Object Cache, and a pointer to the value or REF is returned,
868 At the end of execute, when all OUT values have been received, pgvpp points
869 to an array of pointer(s) to these newly allocated named data types in the
871 pgvpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the Named
872 Data Type buffers are requested at runtime. For static array binds, skip
873 factors may be specified using the OCIBindArrayOfStruct() call. The skip
874 factors are used to compute the address of the next pointer to the value, the
875 indicator structure and their sizes.
876 pvszsp ( IN/OUT) - points to the size of the program variable. The size of the
877 named data type is not required on input. For an array, pvszsp is an array of
878 ub4s. On return, for OUT bind variables, this points to size(s) of the Named
879 Data Types and REFs received. pvszsp is ignored if the OCI_DATA_AT_EXEC
880 mode is set. Then the size of the buffer is taken at runtime.
881 indpp ( IN/OUT) - points to a pointer to the program variable buffer
882 containing the parallel indicator structure. For an array, points to an array
883 of pointers. When the bind variable is also an OUT bind variable, memory is
884 allocated in the object cache, to store the unpickled OUT indicator values. At
885 the end of the execute when all OUT values have been received, indpp points
886 to the pointer(s) to these newly allocated indicator structure(s).
887 indpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator
888 is requested at runtime.
889 indszp ( IN/OUT) - points to the size of the IN indicator structure program
890 variable. For an array, it is an array of sb2s. On return for OUT bind
891 variables, this points to size(s) of the received OUT indicator structures.
892 indszp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator
893 size is requested at runtime.
897 TOCIDefineObject = function(defnpp:POCIDefine; errhp:POCIError;
898 _type:POCIHandle; pgvpp:pointer; pvszsp:Pub4;
899 indpp:pointer; indszp:Pub4):sword;cdecl;
901 TOCITransStart = function(svchp: POCISvcCtx; errhp: POCIError; timeout: word;
902 flags: ub4): sword; cdecl;
904 TOCITransRollback = function(svchp:POCISvcCtx; errhp:POCIError;
905 flags: ub4): sword; cdecl;
907 TOCITransCommit = function(svchp: POCISvcCtx; errhp: POCIError;
908 flags: ub4) :sword; cdecl;
910 TOCITransDetach = function(svchp: POCISvcCtx; errhp: POCIError;
911 flags: ub4) :sword; cdecl;
913 TOCITransPrepare = function(svchp: POCISvcCtx; errhp: POCIError;
914 flags: ub4) :sword; cdecl;
916 TOCITransForget = function(svchp: POCISvcCtx; errhp: POCIError;
917 flags: ub4) :sword; cdecl;
919 TOCIDescribeAny = function(svchp: POCISvcCtx; errhp: POCIError;
920 objptr: Pointer; objnm_len: ub4; objptr_typ: ub1; info_level: ub1;
921 objtyp: ub1; dschp: POCIDescribe): sword; cdecl;
923 TOCIBreak = function(svchp: POCISvcCtx; errhp:POCIError): sword; cdecl;
925 TOCIReset = function(svchp: POCISvcCtx; errhp:POCIError): sword; cdecl;
927 TOCIDescriptorAlloc = function(parenth: POCIEnv; var descpp: POCIDescriptor;
928 htype: ub4; xtramem_sz: integer; usrmempp: Pointer): sword; cdecl;
930 TOCIDescriptorFree = function(descp: Pointer; htype: ub4): sword; cdecl;
932 TOCIDateTimeAssign = function(hndl: POCIEnv; err: POCIError;
933 const from: POCIDateTime;_to: POCIDateTime): sword; cdecl;
935 TOCIDateTimeCheck = function(hndl: POCIEnv; err: POCIError;
936 const date: POCIDateTime; var valid: ub4): sword; cdecl;
938 TOCIDateTimeCompare = function(hndl: POCIEnv; err: POCIError;
939 const date1: POCIDateTime; const date2: POCIDateTime;
940 var result: sword): sword; cdecl;
942 TOCIDateTimeConvert = function(hndl: POCIEnv; err: POCIError;
943 indate: POCIDateTime; outdate: POCIDateTime): sword; cdecl;
945 TOCIDateTimeFromText= function(hndl: POCIEnv; err: POCIError;
946 const date_str: text; d_str_length: size_t; const fmt: text;
947 fmt_length: ub1; const lang_name: text; lang_length: size_t;
948 date: POCIDateTime): sword; cdecl;
950 TOCIDateTimeGetDate = function(hndl: POCIEnv; err: POCIError;
951 const date: POCIDateTime; var year: sb2; var month: ub1;
952 var day: ub1): sword; cdecl;
954 TOCIDateTimeGetTime = function(hndl: POCIEnv; err: POCIError;
955 datetime: POCIDateTime; var hour: ub1; var minute: ub1; var sec: ub1;
956 var fsec: ub4): sword; cdecl;
958 TOCIDateTimeGetTimeZoneOffset = function(hndl: POCIEnv; err: POCIError;
959 const datetime: POCIDateTime; var hour: sb1; var minute: sb1): sword; cdecl;
961 TOCIDateTimeSysTimeStamp = function(hndl: POCIEnv; err: POCIError;
962 sys_date: POCIDateTime): sword; cdecl;
964 TOCIDateTimeConstruct = function(hndl: POCIEnv; err: POCIError;
965 datetime: POCIDateTime; year: sb2; month: ub1; day: ub1; hour: ub1;
966 min: ub1; sec: ub1; fsec: ub4; timezone: text;
967 timezone_length: size_t): sword; cdecl;
969 TOCIDateTimeToText = function(hndl: POCIEnv; err: POCIError;
970 const date: POCIDateTime; const fmt: text; fmt_length: ub1;
971 fsprec: ub1; const lang_name: text; lang_length: size_t;
972 var buf_size: ub4; buf: text): sword; cdecl;
974 TOCIDateTimeGetTimeZoneName = function(hndl: POCIEnv; err: POCIError;
975 datetime: POCIDateTime; var buf: ub1; var buflen: ub4): sword; cdecl;
977 TOCILobAppend = function(svchp: POCISvcCtx; errhp: POCIError; dst_locp,
978 src_locp: POCILobLocator): sword; cdecl;
980 TOCILobAssign = function(svchp: POCISvcCtx; errhp: POCIError;
981 src_locp: POCILobLocator; var dst_locpp: POCILobLocator): sword; cdecl;
983 TOCILobClose = function(svchp: POCISvcCtx; errhp: POCIError;
984 locp: POCILobLocator): sword; cdecl;
986 TOCILobCopy = function(svchp: POCISvcCtx; errhp: POCIError;
987 dst_locp: POCILobLocator; src_locp: POCILobLocator; amount: ub4;
988 dst_offset: ub4; src_offset: ub4): sword; cdecl;
990 TOCILobCreateTemporary = function(svchp: POCISvcCtx; errhp: POCIError;
991 locp: POCILobLocator; csid: ub2; csfrm: ub1; lobtype: ub1;
992 cache: LongBool; duration: OCIDuration): sword; cdecl;
994 TOCILobEnableBuffering = function(svchp: POCISvcCtx; errhp: POCIError;
995 locp: POCILobLocator): sword; cdecl;
997 TOCILobDisableBuffering = function(svchp: POCISvcCtx; errhp: POCIError;
998 locp: POCILobLocator): sword; cdecl;
1000 TOCILobErase = function(svchp: POCISvcCtx; errhp: POCIError; locp: POCILobLocator;
1001 var amount: ub4; offset: ub4): sword; cdecl;
1003 TOCILobFileExists = function(svchp: POCISvcCtx; errhp: POCIError;
1004 filep: POCILobLocator; var flag: Boolean): sword; cdecl;
1006 TOCILobFileGetName = function(envhp: POCIEnv; errhp: POCIError;
1007 filep: POCILobLocator; dir_alias: text; var d_length: ub2; filename: text;
1008 var f_length: ub2): sword; cdecl;
1010 TOCILobFileSetName = function(envhp: POCIEnv; errhp: POCIError;
1011 var filep: POCILobLocator; dir_alias: text; d_length: ub2; filename: text;
1012 f_length: ub2): sword; cdecl;
1014 TOCILobFlushBuffer = function(svchp: POCISvcCtx; errhp: POCIError;
1015 locp: POCILobLocator; flag: ub4): sword; cdecl;
1017 TOCILobFreeTemporary = function(svchp: POCISvcCtx; errhp: POCIError;
1018 locp: POCILobLocator): sword; cdecl;
1020 TOCILobCharSetForm = function ( envhp: POCIEnv; errhp: POCIError;
1021 const locp: POCILobLocator; csfrm: pub1): sword; cdecl;
1023 TOCILobCharSetId = function( envhp: POCIEnv; errhp: POCIError;
1024 const locp: POCILobLocator; csid: pub2): sword; cdecl;
1026 TOCILobGetLength = function(svchp: POCISvcCtx; errhp: POCIError;
1027 locp: POCILobLocator; var lenp: ub4): sword; cdecl;
1029 TOCILobIsOpen = function(svchp: POCISvcCtx; errhp: POCIError;
1030 locp: POCILobLocator; var flag: LongBool): sword; cdecl;
1032 TOCILobIsTemporary = function(svchp: POCISvcCtx; errhp: POCIError;
1033 locp: POCILobLocator; var is_temporary: LongBool): sword; cdecl;
1035 TOCILobLoadFromFile = function(svchp: POCISvcCtx; errhp: POCIError;
1036 dst_locp: POCILobLocator; src_locp: POCILobLocator; amount: ub4;
1037 dst_offset: ub4; src_offset: ub4): sword; cdecl;
1039 TOCILobLocatorIsInit = function(envhp: POCIEnv; errhp: POCIError;
1040 locp: POCILobLocator; var is_initialized: LongBool): sword; cdecl;
1042 TOCILobOpen = function(svchp: POCISvcCtx; errhp: POCIError;
1043 locp: POCILobLocator; mode: ub1): sword; cdecl;
1045 TOCILobRead = function(svchp: POCISvcCtx; errhp: POCIError;
1046 locp: POCILobLocator; var amtp: ub4; offset: ub4; bufp: Pointer; bufl: ub4;
1047 ctxp: Pointer; cbfp: Pointer; csid: ub2; csfrm: ub1): sword; cdecl;
1049 TOCILobTrim = function(svchp: POCISvcCtx; errhp: POCIError;
1050 locp: POCILobLocator; newlen: ub4): sword; cdecl;
1052 TOCILobWrite = function(svchp: POCISvcCtx; errhp: POCIError;
1053 locp: POCILobLocator; var amtp: ub4; offset: ub4; bufp: Pointer; bufl: ub4;
1054 piece: ub1; ctxp: Pointer; cbfp: Pointer; csid: ub2; csfrm: ub1): sword; cdecl;
1056 TOCIStmtGetPieceInfo = function(stmtp: POCIStmt; errhp: POCIError;
1057 var hndlpp: Pointer; var typep: ub4; var in_outp: ub1; var iterp: ub4;
1058 var idxp: ub4; var piecep: ub1): sword; cdecl;
1060 TOCIStmtSetPieceInfo = function(handle: Pointer; typep: ub4; errhp: POCIError;
1061 buf: Pointer; var alenp: ub4; piece: ub1; indp: Pointer;
1062 var rcodep: ub2): sword; cdecl;
1064 TOCIPasswordChange = function(svchp: POCISvcCtx; errhp: POCIError;
1065 user_name: text; usernm_len: ub4; opasswd: text; opasswd_len: ub4;
1066 npasswd: text; npasswd_len: sb4; mode: ub4): sword; cdecl;
1068 TOCIServerVersion = function(hndlp: POCIHandle; errhp: POCIError; bufp: text;
1069 bufsz: ub4; hndltype: ub1): sword; cdecl;
1071 TOCIServerRelease = function(hndlp: POCIHandle; errhp: POCIError; bufp: text;
1072 bufsz: ub4; hndltype: ub1; version:pointer): sword; cdecl;
1074 TOCIResultSetToStmt = function(rsetdp: POCIHandle; errhp: POCIError): sword; cdecl;
1076 TOCINlsNumericInfoGet = function(envhp: POCIEnv; errhp: POCIError; val: psb4; item: ub2): sword; cdecl;
1078 TOCIClientVersion = procedure(major_version, minor_version, update_num,
1079 patch_num, port_update_num: psword); cdecl;
1081 (*****************************************************************************
1082 * NUMBER/FLOAT/DECIMAL TYPE *
1083 *****************************************************************************)
1085 OCI_NUMBER_SIZE = 22;
1088 POCINumberPart = ^TOCINumberPart;
1089 TOCINumberPart = array[1..OCI_NUMBER_SIZE] of ub1;
1092 * OCINumber - OCI Number mapping in c
1094 * The OTS types: NUMBER, NUMERIC, INT, SHORTINT, REAL, DOUBLE PRECISION,
1095 * FLOAT and DECIMAL are represented by OCINumber.
1096 * The contents of OCINumber is opaque to clients.
1098 * For binding variables of type OCINumber in OCI calls (OCIBindByName(),
1099 * OCIBindByPos(), and OCIDefineByPos()) use the type code SQLT_VNU.
1105 The following example shows how to manipulate an attribute of type
1112 typedef struct person person;
1129 /o See oci.h for an example of how to initialize OCIError.
1130 o For this example, assume the OCIEnv and OCIError has been
1134 /o Pin joe, tom and debbie person objects in the object cache. See ori.h
1135 o for an example on pinning objects. For this example, assume that
1136 o joe, tom and debbie are pointing to pinned objects.
1140 debsal = &debbie->sal;
1142 /o initialize joe's salary to be $12,000 o/
1144 status = OCINumberFromInt(err, &inum, sizeof(inum), OCI_NUMBER_SIGNED,
1146 if (status != OCI_SUCCESS)
1147 /o goto to handle error from OCINumberFromInt o/;
1149 /o initialize tom's salary to be same as joe o/
1150 OCINumberAssign(err, joesal, tomsal);
1152 /o initialize debbie's salary to be 20% more than joe's o/
1154 status = OCINumberFromReal(err, &dnum, sizeof(double), &ornum);
1155 if (status != OCI_SUCCESS)
1156 /o goto to handle error from OCINumberFromReal o/;
1157 status = OCINumberMul(err, joesal, &ornum, debsal);
1158 if (status != OCI_SUCCESS) /o goto to handle error from OCINumberMul o/;
1160 /o give tom a 50% raise o/
1162 status = OCINumberFromReal(err, &dnum, sizeof(double), &ornum);
1163 if (status != OCI_SUCCESS)
1164 /o goto to handle error from OCINumberFromReal o/;
1165 status = OCINumberMul(err, tomsal, &ornum, tomsal);
1166 if (status != OCI_SUCCESS) /o goto to handle error from OCINumberMul o/;
1168 /o double joe's salary o/
1169 status = OCINumberAdd(err, joesal, joesal, joesal);
1170 if (status != OCI_SUCCESS) /o goto to handle error from OCINumberAdd o/;
1172 /o get joe's salary in integer o/
1173 status = OCINumberToInt(err, joesal, sizeof(inum), OCI_NUMBER_SIGNED,
1175 if (status != OCI_SUCCESS)/o goto to handle error from OCINumberToInt o/;
1176 /o inum is set to 24000 o/
1178 /o get debbie's salary in double o/
1179 status = OCINumberToReal(err, debsal, sizeof(dnum), &dnum);
1180 if (status != OCI_SUCCESS)/o goto to handle error from OCINumberToReal o/;
1181 /o dnum is set to 14400 o/
1183 /o print tom's salary as DEM0001`8000.00 o/
1184 buflen = sizeof(buffer);
1185 status = OCINumberToText(err, tomsal, "C0999G9999D99", 13,
1186 "NLS_NUMERIC_CHARACTERS='.`' NLS_ISO_CURRENCY='Germany'", 54,
1188 if (status != OCI_SUCCESS)/o goto to handle error from OCINumberToText o/;
1189 printf("tom's salary = %s\n", buffer);
1191 /o compare joe and tom's salary o/
1192 status = OCINumberCmp(err, joesal, tomsal, &result);
1193 if (status != OCI_SUCCESS) /o goto to handle error from OCINumberCmp o/;
1194 /o result is positive o/
1196 /o read debbie's new salary from string o/
1197 status = OCINumberFromText(err, "48`000.00", 9, "99G999D99", 9,
1198 "NLS_NUMERIC_CHARACTERS='.`'", 27, debsal);
1199 if (status != OCI_SUCCESS)
1200 /o goto to handle error from OCINumberFromText o/;
1201 /o debbie's salary is now 48000.00 o/
1205 (*----------------------------- OCINumberInc --------------------------------*)
1207 TOCINumberInc = function(err: POCIError; number: POCINumber): sword; cdecl;
1209 NAME: OCINumberInc - OCINumber INCrement numbers
1211 err (IN/OUT) - error handle. If there is an error, it is
1212 recorded in 'err' and this function returns OCI_ERROR.
1213 The error recorded in 'err' can be retrieved by calling
1215 number (IN/OUT) a positive Oracle number to be incremented
1217 Increment Oracle number in place. It is assumed that the input is
1218 an integer between 0 and 100^21-2. If the is input too large, it will
1219 be treated as 0 - the result will be an Oracle number 1. If the input
1220 is not a positive integer, the result will be unpredictable.
1222 OCI_SUCCESS if the function completes successfully.
1223 OCI_INVALID_HANDLE if 'err' is NULL.
1225 any of the number arguments is null
1228 (*----------------------------- OCINumberDec --------------------------------*)
1230 TOCINumberDec = function(err: POCIError; number: POCINumber): sword; cdecl;
1232 NAME: OCINumberDec - OCINumber DECrement numbers
1234 err (IN/OUT) - error handle. If there is an error, it is
1235 recorded in 'err' and this function returns OCI_ERROR.
1236 The error recorded in 'err' can be retrieved by calling
1238 number (IN/OUT) - a positive Oracle number to be decremented
1240 Decrement Oracle number in place. It is assumed that the input is an
1241 integer between 1 and 100^21-2. If the input is too large, it will be
1242 treated as 1 - the result will be an Oracle number 0. If the input is
1243 not a positive integer, the result will be unpredictable.
1245 OCI_SUCCESS if the function completes successfully.
1246 OCI_INVALID_HANDLE if 'err' is NULL.
1248 any of the number arguments is null
1251 (*-------------------------- OCINumberSetZero -------------------------------*)
1253 TOCINumberSetZero = procedure(err: POCIError; number: POCINumber); cdecl;
1255 NAME: OCINumberSetZero - OCINumber Set number to Zero value
1257 err (IN/OUT) - pointer to OCI error handle
1258 num (OUT) - set to zero value
1260 Initialize the given number to value 0.
1263 (*--------------------------- OCINumberSetPi --------------------------------*)
1265 TOCINumberSetPi = procedure(err: POCIError; number: POCINumber); cdecl;
1267 NAME: OCINumberSetPi - OCINumber Set number to Pi
1268 err (IN/OUT) - pointer to OCI error handle
1269 num (OUT) - set to zero value
1271 Initialize the given number to value Pi.
1274 (*----------------------------- OCINumberAdd --------------------------------*)
1276 TOCINumberAdd = function(err: POCIError; const number1: POCINumber;
1277 const number2: POCINumber; _result: POCINumber): sword; cdecl;
1279 NAME: OCINumberAdd - OCINumber ADD numbers
1281 err (IN/OUT) - error handle. If there is an error, it is
1282 recorded in 'err' and this function returns OCI_ERROR.
1283 The error recorded in 'err' can be retrieved by calling
1285 number1, number2 (IN) - numbers to be added
1286 result (OUT) - result of adding 'number1' with 'number2'
1288 Add 'number1' with 'number2' and return result in 'result'.
1290 OCI_SUCCESS if the function completes successfully.
1291 OCI_INVALID_HANDLE if 'err' is NULL.
1293 any of the number arguments is null
1296 (*----------------------------- OCINumberSub --------------------------------*)
1298 TOCINumberSub = function(err: POCIError; const number1: POCINumber;
1299 const number2: POCINumber; _result: POCINumber): sword; cdecl;
1301 NAME: OCINumberSub - OCINumber SUBtract numbers
1303 err (IN/OUT) - error handle. If there is an error, it is
1304 recorded in 'err' and this function returns OCI_ERROR.
1305 The error recorded in 'err' can be retrieved by calling
1307 number1, number2 (IN) - 'number2' subtracted from 'number1'
1308 result (OUT) - subtraction result
1310 Subtract 'number2' from 'number1' and return result in 'result'.
1312 OCI_SUCCESS if the function completes successfully.
1313 OCI_INVALID_HANDLE if 'err' is NULL.
1315 any of the number arguments is null
1318 (*----------------------------- OCINumberMul --------------------------------*)
1320 TOCINumberMul = function(err: POCIError; const number1: POCINumber;
1321 const number2: POCINumber; _result: POCINumber): sword; cdecl;
1323 NAME: OCINumberMul - OCINumber MULtiply numbers
1325 err (IN/OUT) - error handle. If there is an error, it is
1326 recorded in 'err' and this function returns OCI_ERROR.
1327 The error recorded in 'err' can be retrieved by calling
1329 number1, number2 (IN) - numbers to be multiplied
1330 result (OUT) - multiplication result
1332 Multiply 'number1' with 'number2' and return result in 'result'.
1334 OCI_SUCCESS if the function completes successfully.
1335 OCI_INVALID_HANDLE if 'err' is NULL.
1337 any of the number arguments is null
1340 (*----------------------------- OCINumberDiv --------------------------------*)
1342 TOCINumberDiv = function(err: POCIError; const number1: POCINumber;
1343 const number2: POCINumber; _result: POCINumber): sword; cdecl;
1345 NAME: OCINumberDiv - OCINumber DIVide numbers
1347 err (IN/OUT) - error handle. If there is an error, it is
1348 recorded in 'err' and this function returns OCI_ERROR.
1349 The error recorded in 'err' can be retrieved by calling
1351 number1 (IN) - pointer to the numerator
1352 number2 (IN) - pointer to the denominator
1353 result (OUT) - division result
1355 Divide 'number1' by 'number2' and return result in 'result'.
1357 OCI_SUCCESS if the function completes successfully.
1358 OCI_INVALID_HANDLE if 'err' is NULL.
1360 any of the number arguments is null
1363 divide by zero errorr
1366 (*----------------------------- OCINumberMod --------------------------------*)
1368 TOCINumberMod = function(err: POCIError; const number1: POCINumber;
1369 const number2: POCINumber; _result: POCINumber): sword; cdecl;
1371 NAME: OCINumberMod - OCINumber MODulous
1373 err (IN/OUT) - error handle. If there is an error, it is
1374 recorded in 'err' and this function returns OCI_ERROR.
1375 The error recorded in 'err' can be retrieved by calling
1377 number1 (IN) - pointer to the numerator
1378 number2 (IN) - pointer to the denominator
1379 result (OUT) - remainder of the result
1381 Finds the remainder of the division of two Oracle numbers.
1383 OCI_SUCCESS if the function completes successfully.
1384 OCI_INVALID_HANDLE if 'err' is NULL.
1386 any of the number arguments is null
1387 divide by zero errorr
1390 (*------------------------ OCINumberIntPower --------------------------------*)
1392 TOCINumberIntPower = function(err: POCIError; const number1: POCINumber;
1393 const number2: POCINumber; _result: POCINumber): sword; cdecl;
1395 NAME: OCINumberIntPower - OCINumber takes an arbitary base to an arbitary
1398 err (IN/OUT) - error handle. If there is an error, it is
1399 recorded in 'err' and this function returns OCI_ERROR.
1400 The error recorded in 'err' can be retrieved by calling
1402 base (IN) - base of the exponentiation
1403 exp (IN) - exponent to which the base is to be raised
1404 result (OUT) - output of exponentiation
1406 Takes an arbitary base to an arbitary integer power.
1408 OCI_SUCCESS if the function completes successfully.
1409 OCI_INVALID_HANDLE if 'err' is NULL.
1411 any of the number arguments is null
1414 (*-------------------------- OCINumberShift ---------------------------------*)
1416 TOCINumberShift = function(err: POCIError; const number: POCINumber;
1417 const nDig: sword; _result: POCINumber): sword; cdecl;
1419 NAME: OCINumberShift - OCINumber multiplies by a power of 10.
1422 err (IN/OUT) - error handle. If there is an error, it is
1423 recorded in 'err' and this function returns OCI_ERROR.
1424 The error recorded in 'err' can be retrieved by calling
1426 number (IN) - Oracle Number to be shifted.
1427 nDig (IN) - number of decimal places to shift.
1428 result (OUT) - shift result.
1430 Multiplies number by 10^NDig and sets product to the result.
1432 OCI_SUCCESS if the function completes successfully.
1433 OCI_INVALID_HANDLE if 'err' is NULL.
1435 any of the number arguments is null
1438 (*----------------------------- OCINumberNeg --------------------------------*)
1440 TOCINumberNeg = function(err: POCIError; const number: POCINumber;
1441 _result: POCINumber): sword; cdecl;
1443 NAME: OCINumberNeg - OCINumber NEGate number
1445 err (IN/OUT) - error handle. If there is an error, it is
1446 recorded in 'err' and this function returns OCI_ERROR.
1447 The error recorded in 'err' can be retrieved by calling
1449 number (IN) - number to be negated
1450 result (OUT) - will contain negated value of 'number'
1452 Negates an Oracle number.
1454 OCI_SUCCESS if the function completes successfully.
1455 OCI_INVALID_HANDLE if 'err' is NULL.
1457 any of the number arguments is null
1460 (*------------------------- OCINumberToText ---------------------------------*)
1461 Poratext = PAnsiChar;
1462 PPoratext = PPAnsiChar;
1464 TOCINumberToText = function(err: POCIError; const number: POCINumber;
1465 const fmt: Poratext; fmt_length: ub4;
1466 const nls_params: Poratext; nls_p_length: ub4;
1467 buf_size: pub4; buf: poratext): sword; cdecl;
1469 NAME: OCINumberToText - OCINumber convert number TO String
1471 err (IN/OUT) - error handle. If there is an error, it is
1472 recorded in 'err' and this function returns OCI_ERROR.
1473 The error recorded in 'err' can be retrieved by calling
1475 number (IN) - Oracle number to be converted
1476 fmt (IN) - conversion format
1477 fmt_length (IN) - length of the 'fmt' parameter
1478 nls_params (IN) - nls format specification, if null string
1479 i.e. (oratext * )0, then the default parameters for the
1481 nls_p_length (IN) - length of the 'nls_params' parameter
1482 buf_size (IN/OUT) - size of the buffer must be passed as input by
1483 the caller, this function will return the length of the
1484 resulting string in bytes via this parameter. The length
1485 does not include the terminating null ('\0').
1486 buf (OUT) - buffer into which the converted string is placed. The
1487 resulting string is null terminated.
1489 Converts the given number to a character string
1490 according to the specified format. Refer to "TO_NUMBER" conversion
1491 function described in "Oracle SQL Language Reference Manual" for a
1492 description of format and NLS parameters.
1493 The converted number string is stored in the buffer 'buf', up to
1494 a max of '*buf_size' bytes. Length of the resulting string is
1495 returned via 'buf_size'.
1497 OCI_SUCCESS if the function completes successfully.
1498 OCI_INVALID_HANDLE if 'err' is NULL.
1500 'number' or 'buf' is null
1504 number to text translation for the given format causes overflow
1507 (*-------------------------- OCINumberFromText ------------------------------*)
1509 TOCINumberFromText = function(err: POCIError; const str: poratext;
1510 str_length: ub4; const fmt: poratext; fmt_length: ub4;
1511 const nls_params: poratext; nls_p_length: ub4;
1512 number: POCINumber): sword; cdecl;
1514 NAME: OCINumberFromText - OCINumber convert String TO Number
1516 err (IN/OUT) - error handle. If there is an error, it is
1517 recorded in 'err' and this function returns OCI_ERROR.
1518 The error recorded in 'err' can be retrieved by calling
1520 str (IN) - input string to be converted to Oracle number
1521 str_length (IN) - size of the input string
1522 fmt (IN) - conversion format
1523 fmt_length (IN) - length of the 'fmt' parameter
1524 nls_params (IN) - nls format specification, if null string
1525 i.e. (oratext * )0, then the default parameters for the
1527 nls_p_length (IN) - length of the 'nls_params' parameter
1528 number (OUT) - given string converted to number
1530 Converts the given string to a number
1531 according to the specified format. Refer to "TO_NUMBER" conversion
1532 function described in "Oracle SQL Language Reference Manual" for a
1533 description of format and NLS parameters.
1535 OCI_SUCCESS if the function completes successfully.
1536 OCI_INVALID_HANDLE if 'err' is NULL.
1538 'number' or 'str' is null
1542 invalid input string
1545 (*-------------------------- OCINumberToInt ---------------------------------*)
1548 OCI_NUMBER_UNSIGNED = 0; // Unsigned type -- ubX
1549 OCI_NUMBER_SIGNED = 2; // Signed type -- sbX
1552 TOCINumberToInt = function(err: POCIError; const number: POCINumber;
1553 rsl_length: uword; rsl_flag: uword; rsl: Pointer): sword; cdecl;
1555 NAME: OCINumberToInt - OCINumber convert number TO Integer
1557 err (IN/OUT) - error handle. If there is an error, it is
1558 recorded in 'err' and this function returns OCI_ERROR.
1559 The error recorded in 'err' can be retrieved by calling
1561 number (IN) - number to be converted
1562 rsl_length (IN) - size of the desired result
1563 rsl_s_flag (IN) - flag denoting the desired sign of the output; valid
1564 values are OCI_NUMBER_UNSIGNED, OCI_NUMBER_SIGNED
1565 rsl (OUT) - pointer to space for the result
1567 Native type conversion function.
1568 Converts the given Oracle number into an xbx (e.g. ub2, ub4, sb2 etc.)
1570 OCI_SUCCESS if the function completes successfully.
1571 OCI_INVALID_HANDLE if 'err' is NULL.
1573 'number' or 'rsl' is null
1574 integer value of 'number' is too big -- overflow
1575 integer value of 'number' is too small -- underflow
1576 invalid sign flag value ('rsl_s_flag')
1579 (*--------------------------- OCINumberFromInt ------------------------------*)
1581 TOCINumberFromInt = function(err: POCIError; const inum: Pointer;
1582 inum_length: uword; inum_s_flag: uword; number: POCINumber): sword; cdecl;
1584 NAME: OCINumberFromInt - OCINumber convert Integer TO Number
1586 err (IN/OUT) - error handle. If there is an error, it is
1587 recorded in 'err' and this function returns OCI_ERROR.
1588 The error recorded in 'err' can be retrieved by calling
1590 inum (IN) - pointer to the integer to be converted
1591 inum_length (IN) - size of the integer
1592 inum_s_flag (IN) - flag that designates the sign of the integer; valid
1593 values are OCI_NUMBER_UNSIGNED, OCI_NUMBER_SIGNED
1594 number (OUT) - given integer converted to Oracle number
1596 Native type conversion function. Converts any Oracle standard
1597 machine-native integer type (xbx) to an Oracle number.
1599 OCI_SUCCESS if the function completes successfully.
1600 OCI_INVALID_HANDLE if 'err' is NULL.
1602 'number' or 'inum' is null
1603 integer too BIG -- the number is too large to fit into an Oracle
1605 invalid sign flag value ('inum_s_flag')
1608 (*------------------------- OCINumberToReal ---------------------------------*)
1610 TOCINumberToReal = function(err: POCIError; const number: POCINumber;
1611 rsl_length: uword; rsl: Pointer): sword; cdecl;
1613 NAME: OCINumberToReal - OCINumber convert number TO Real
1615 err (IN/OUT) - error handle. If there is an error, it is
1616 recorded in 'err' and this function returns OCI_ERROR.
1617 The error recorded in 'err' can be retrieved by calling
1619 number (IN) - number to be converted
1620 rsl_length (IN) - is the size of the desired result,
1621 sizeof( float | double | long double)
1622 rsl (OUT) - pointer to space for storing the result
1624 Native type conversion function. Converts an Oracle number into a
1625 machine-native real type. This function only converts numbers up to
1626 LDBL_DIG, DBL_DIG, or FLT_DIG digits of precision and removes
1627 trailing zeroes. The above constants are defined in float.h
1629 OCI_SUCCESS if the function completes successfully.
1630 OCI_INVALID_HANDLE if 'err' is NULL.
1632 'number' or 'rsl' is null
1636 (*------------------------- OCINumberToRealArray ----------------------------*)
1638 TOCINumberToRealArray = function(err: POCIError; const number: PPOCINumber;
1639 elems: uword; rsl_length: uword; rsl: Pointer): sword; cdecl;
1641 NAME: OCINumberToRealArray - OCINumber convert array of numbers TO Real
1643 err (IN/OUT) - error handle. If there is an error, it is
1644 recorded in 'err' and this function returns OCI_ERROR.
1645 The error recorded in 'err' can be retrieved by calling
1647 number (IN) - Pointer to array of number to be converted
1648 elems (IN) - Upper bound of number array
1649 rsl_length (IN) - is the size of the desired result,
1650 sizeof( float | double | long double)
1651 rsl (OUT) - pointer to array of space for storing the result
1653 Native type conversion function. Converts an Oracle number into a
1654 machine-native real type. This function only converts numbers up to
1655 LDBL_DIG, DBL_DIG, or FLT_DIG digits of precision and removes
1656 trailing zeroes. The above constants are defined in float.h
1658 OCI_SUCCESS if the function completes successfully.
1659 OCI_INVALID_HANDLE if 'err' is NULL.
1661 'number' or 'rsl' is null
1665 (*-------------------------- OCINumberFromReal ------------------------------*)
1667 TOCINumberFromReal = function(err: POCIError; const rnum: Pointer;
1668 rnum_length: uword; number: POCINumber): sword; cdecl;
1670 NAME: OCINumberFromReal - OCINumber convert Real TO Number
1672 err (IN/OUT) - error handle. If there is an error, it is
1673 recorded in 'err' and this function returns OCI_ERROR.
1674 The error recorded in 'err' can be retrieved by calling
1676 rnum (IN) - pointer to the floating point number to be converted
1677 rnum_length (IN) - size of the desired result, i.e.
1678 sizeof({float | double | long double})
1679 number (OUT) - given float converted to Oracle number
1681 Native type conversion function. Converts a machine-native floating
1682 point type to an Oracle number.
1684 OCI_SUCCESS if the function completes successfully.
1685 OCI_INVALID_HANDLE if 'err' is NULL.
1687 'number' or 'rnum' is null
1691 (*----------------------------- OCINumberCmp --------------------------------*)
1693 TOCINumberCmp = function(err: POCIError; const number1: POCINumber;
1694 const number2: POCINumber; _result: psword): sword; cdecl;
1696 NAME: OCINumberCmp - OCINumber CoMPare numbers
1698 err (IN/OUT) - error handle. If there is an error, it is
1699 recorded in 'err' and this function returns OCI_ERROR.
1700 The error recorded in 'err' can be retrieved by calling
1702 number1, number2 (IN) - numbers to be compared
1703 result (OUT) - 0 if equal, negative if number1 < number2,
1704 positive if number1 > number2
1706 The function OCINumberCmp compares two numbers.
1708 OCI_SUCCESS if the function completes successfully.
1709 OCI_INVALID_HANDLE if 'err' is NULL.
1711 'number1' or 'number2' or 'result' is null
1714 (*---------------------------- OCINumberSign --------------------------------*)
1716 TOCINumberSign = function(err: POCIError; const number: POCINumber;
1717 _result: psword): sword; cdecl;
1719 NAME: OCINumberSign - OCINumber obtains SiGN of an Oracle number
1721 err (IN/OUT) - error handle. If there is an error, it is
1722 recorded in 'err' and this function returns OCI_ERROR.
1723 The error recorded in 'err' can be retrieved by calling
1725 number (IN) - number whose sign is returned
1726 result (OUT) - 0 if number == 0, -1 if number < 0,
1729 Obtains sign of an Oracle number
1731 OCI_SUCCESS if the function completes successfully.
1732 OCI_INVALID_HANDLE if 'err' is NULL.
1734 'number' or 'result' is null
1737 (*---------------------------- OCINumberIsZero ------------------------------*)
1739 TOCINumberIsZero = function(err: POCIError; const number: POCINumber;
1740 _Result: pboolean): sword; cdecl;
1742 NAME: OCINumberIsZero - OCINumber comparison with ZERo
1744 err (IN/OUT) - error handle. If there is an error, it is
1745 recorded in 'err' and this function returns OCI_ERROR.
1746 The error recorded in 'err' can be retrieved by calling
1748 number (IN) - numbers to be compared
1749 result (OUT) - set to TRUE if equal to zero else FALSE
1751 Test if the given number is equal to zero.
1753 OCI_SUCCESS if the function completes successfully.
1754 OCI_INVALID_HANDLE if 'err' is NULL.
1756 'number' or 'result' is null
1759 (*---------------------------- OCINumberIsInt -------------------------------*)
1761 TOCINumberIsInt = function(err: POCIError; const number: POCINumber;
1762 _result: Pboolean): sword; cdecl;
1764 NAME: OCINumberIsInt - OCINumber Is Integer value.
1766 err (IN/OUT) - error handle. If there is an error, it is
1767 recorded in 'err' and this function returns OCI_ERROR.
1768 The error recorded in 'err' can be retrieved by calling
1770 number (IN) - number to be tested
1771 result (OUT) - set to TRUE if integer value else FALSE
1773 Test if the given number is an integer value.
1775 OCI_SUCCESS if the function completes successfully.
1776 OCI_INVALID_HANDLE if 'err' is NULL.
1778 'number' or 'result' is null
1781 (*-------------------------- OCINumberAssign --------------------------------*)
1783 TOCINumberAssign = function(err: POCIError; const from: POCINumber;
1784 _to: POCINumber): sword; cdecl;
1786 NAME: OCINumberAssign - OCINumber ASsiGn number
1788 err (IN/OUT) - error handle. If there is an error, it is
1789 recorded in 'err' and this function returns OCI_ERROR.
1790 The error recorded in 'err' can be retrieved by calling
1792 from (IN) - number to be assigned
1793 to (OUT) - number copied into
1795 Assign number 'from' to 'to'.
1797 OCI_SUCCESS if the function completes successfully.
1798 OCI_INVALID_HANDLE if 'err' is NULL.
1800 'from' or 'to' is null
1803 (*----------------------------- OCINumberAbs --------------------------------*)
1805 TOCINumberAbs = function(err: POCIError; const number: POCINumber;
1806 _result: POCINumber): sword; cdecl;
1808 NAME: OCINumberAbs - OCINumber compute ABSolute value
1810 err (IN/OUT) - error handle. If there is an error, it is
1811 recorded in 'err' and this function returns OCI_ERROR.
1812 The error recorded in 'err' can be retrieved by calling
1814 number (IN) - input number
1815 result (OUT) - output which will contain the absolue value of the
1818 Computes the absolute value of an Oracle number.
1820 OCI_SUCCESS if the function completes successfully.
1821 OCI_INVALID_HANDLE if 'err' is NULL.
1823 any of the number arguments is null
1826 (*---------------------------- OCINumberCeil --------------------------------*)
1828 TOCINumberCeil = function(err: POCIError; const number: POCINumber;
1829 _result: POCINumber): sword; cdecl;
1831 NAME: OCINumberCeil - OCINumber compute the CEiL value of an Oracle number
1833 err (IN/OUT) - error handle. If there is an error, it is
1834 recorded in 'err' and this function returns OCI_ERROR.
1835 The error recorded in 'err' can be retrieved by calling
1837 number (IN) - input number
1838 result (OUT) - output which will contain the ceil value of the
1841 Computes the ceil value of an Oracle number.
1843 OCI_SUCCESS if the function completes successfully.
1844 OCI_INVALID_HANDLE if 'err' is NULL.
1846 any of the number arguments is null
1849 (*--------------------------- OCINumberFloor --------------------------------*)
1851 TOCINumberFloor = function(err: POCIError; const number: POCINumber;
1852 _result: POCINumber): sword; cdecl;
1854 NAME: OCINumberFloor - OCINumber compute the FLooR value of an Oracle number
1856 err (IN/OUT) - error handle. If there is an error, it is
1857 recorded in 'err' and this function returns OCI_ERROR.
1858 The error recorded in 'err' can be retrieved by calling
1860 number (IN) - input number
1861 result (OUT) - output which will contain the floor value of the
1864 Computes the floor value of an Oracle number.
1866 OCI_SUCCESS if the function completes successfully.
1867 OCI_INVALID_HANDLE if 'err' is NULL.
1869 any of the number arguments is null
1872 (*----------------------------- OCINumberSqrt -------------------------------*)
1874 TOCINumberSqrt = function(err: POCIError; const number: POCINumber;
1875 _result: POCINumber): sword; cdecl;
1877 NAME: OCINumberSqrt - OCINumber compute the SQuare Root of an Oracle number
1879 err (IN/OUT) - error handle. If there is an error, it is
1880 recorded in 'err' and this function returns OCI_ERROR.
1881 The error recorded in 'err' can be retrieved by calling
1883 number (IN) - input number
1884 result (OUT) - output which will contain the square root of the
1887 Computes the square root of an Oracle number.
1889 OCI_SUCCESS if the function completes successfully.
1890 OCI_INVALID_HANDLE if 'err' is NULL.
1892 any of the number arguments is null
1893 'number' is negative
1896 (*--------------------------- OCINumberTrunc --------------------------------*)
1898 TOCINumberTrunc = function(err: POCIError; const number: POCINumber;
1899 _result: POCINumber): sword; cdecl;
1901 NAME: OCINumberTrunc - OCINumber TRUncate an Oracle number at a
1902 specified decimal place
1904 err (IN/OUT) - error handle. If there is an error, it is
1905 recorded in 'err' and this function returns OCI_ERROR.
1906 The error recorded in 'err' can be retrieved by calling
1908 number (IN) - input number
1909 decplace (IN) - number of decimal digits to the right of the
1910 decimal point to truncate at. Negative values are allowed.
1911 result (OUT) - output of truncation
1913 Truncate an Oracle number at a specified decimal place
1915 OCI_SUCCESS if the function completes successfully.
1916 OCI_INVALID_HANDLE if 'err' is NULL.
1918 any of the number arguments is null
1921 (*----------------------------- OCINumberPower ------------------------------*)
1923 TOCINumberPower = function(err: POCIError; const base: POCINumber;
1924 const number: POCINumber; _result: POCINumber): sword; cdecl;
1926 NAME: OCINumberPower - OCINumber takes an arbitary Base to an
1929 err (IN/OUT) - error handle. If there is an error, it is
1930 recorded in 'err' and this function returns OCI_ERROR.
1931 The error recorded in 'err' can be retrieved by calling
1933 base (IN) - base of the exponentiation
1934 number (IN) - exponent to which the base is to be raised
1935 result (OUT) - output of exponentiation
1937 Takes an arbitary base to an arbitary power.
1939 OCI_SUCCESS if the function completes successfully.
1940 OCI_INVALID_HANDLE if 'err' is NULL.
1942 any of the number arguments is null
1945 (*--------------------------- OCINumberRound --------------------------------*)
1947 TOCINumberRound = function(err: POCIError; const number: POCINumber;
1948 decplace: sword; _result: POCINumber): sword; cdecl;
1950 NAME: OCINumberRound - OCINumber ROUnds an Oracle number to a specified
1953 err (IN/OUT) - error handle. If there is an error, it is
1954 recorded in 'err' and this function returns OCI_ERROR.
1955 The error recorded in 'err' can be retrieved by calling
1957 number (IN) - round this number and return result in 'result'
1958 decplace (IN) - number of decimal digits to the right of the
1959 decimal point to round to. Negative values are allowed.
1960 result (OUT) - output of rounding
1962 Rounds an Oracle number to a specified decimal place
1964 OCI_SUCCESS if the function completes successfully.
1965 OCI_INVALID_HANDLE if 'err' is NULL.
1967 any of the number arguments is null
1970 (*--------------------------- OCINumberPrec ---------------------------------*)
1972 TOCINumberPrec = function(err: POCIError; const number: POCINumber;
1973 nDigs: sword; _result: POCINumber): sword; cdecl;
1975 NAME: OCINumberPrec - Rounds an Oracle number to a specified number of
1978 err (IN/OUT) - error handle. If there is an error, it is
1979 recorded in 'err' and this function returns OCI_ERROR.
1980 The error recorded in 'err' can be retrieved by calling
1982 number (IN) - number for which to set precision.
1983 nDig (IN) - number of decimal digits desired in the result.
1984 result (OUT) - result.
1986 Performs a floating point round with respect to the number
1989 OCI_SUCCESS if the function completes successfully.
1990 OCI_INVALID_HANDLE if 'err' is NULL.
1992 any of the number arguments is null
1995 (*----------------------------- OCINumberSin --------------------------------*)
1997 TOCINumberSin = function(err: POCIError; const number: POCINumber;
1998 _result: POCINumber): sword; cdecl;
2000 NAME: OCINumberSin - OCINumber takes the SINe of an Oracle number
2002 err (IN/OUT) - error handle. If there is an error, it is
2003 recorded in 'err' and this function returns OCI_ERROR.
2004 The error recorded in 'err' can be retrieved by calling
2006 number (IN) - argument of the sine in radians
2007 result (OUT) - result of the sine
2009 Takes the sine in radians of an Oracle number.
2011 OCI_SUCCESS if the function completes successfully.
2012 OCI_INVALID_HANDLE if 'err' is NULL.
2014 any of the number arguments is null
2017 (*-------------------------- OCINumberArcSin --------------------------------*)
2019 TOCINumberArcSin = function(err: POCIError; const number: POCINumber;
2020 _result: POCINumber): sword; cdecl;
2022 NAME: OCINumberArcSin - OCINumber takes the Arc SINe of an Oracle number
2024 err (IN/OUT) - error handle. If there is an error, it is
2025 recorded in 'err' and this function returns OCI_ERROR.
2026 The error recorded in 'err' can be retrieved by calling
2028 number (IN) - argument of the arc sine
2029 result (OUT) - result of the arc sine in radians
2031 Takes the arc sine in radians of an Oracle number.
2033 OCI_SUCCESS if the function completes successfully.
2034 OCI_INVALID_HANDLE if 'err' is NULL.
2036 any of the number arguments is null
2037 'number' is < -1 or 'number' is > 1.
2040 (*-------------------------- OCINumberHypSin --------------------------------*)
2042 TOCINumberHypSin = function(err: POCIError; const number: POCINumber;
2043 _result: POCINumber): sword; cdecl;
2045 NAME: OCINumberHypSin - OCINumber takes the SiNe Hyperbolic of an
2048 err (IN/OUT) - error handle. If there is an error, it is
2049 recorded in 'err' and this function returns OCI_ERROR.
2050 The error recorded in 'err' can be retrieved by calling
2052 number (IN) - argument of the sine hyperbolic
2053 result (OUT) - result of the sine hyperbolic
2055 Takes the hyperbolic sine of an Oracle number.
2057 OCI_SUCCESS if the function completes successfully.
2058 OCI_INVALID_HANDLE if 'err' is NULL.
2060 any of the number arguments is null
2062 An Oracle number overflow causes an unpredictable result value.
2065 (*----------------------------- OCINumberCos --------------------------------*)
2067 TOCINumberCos = function(err: POCIError; const number: POCINumber;
2068 _result: POCINumber): sword; cdecl;
2070 NAME: OCINumberCos - OCINumber takes the COSine of an Oracle number
2072 err (IN/OUT) - error handle. If there is an error, it is
2073 recorded in 'err' and this function returns OCI_ERROR.
2074 The error recorded in 'err' can be retrieved by calling
2076 number (IN) - argument of the cosine in radians
2077 result (OUT) - result of the cosine
2079 Takes the cosine in radians of an Oracle number.
2081 OCI_SUCCESS if the function completes successfully.
2082 OCI_INVALID_HANDLE if 'err' is NULL.
2084 any of the number arguments is null
2087 (*-------------------------- OCINumberArcCos --------------------------------*)
2089 TOCINumberArcCos = function(err: POCIError; const number: POCINumber;
2090 _result: POCINumber): sword; cdecl;
2092 NAME: OCINumberArcCos - OCINumber takes the Arc COSine of an Oracle number
2094 err (IN/OUT) - error handle. If there is an error, it is
2095 recorded in 'err' and this function returns OCI_ERROR.
2096 The error recorded in 'err' can be retrieved by calling
2098 number (IN) - argument of the arc cosine
2099 result (OUT) - result of the arc cosine in radians
2101 Takes the arc cosine in radians of an Oracle number.
2103 OCI_SUCCESS if the function completes successfully.
2104 OCI_INVALID_HANDLE if 'err' is NULL.
2106 any of the number arguments is null
2107 'number' is < -1 or 'number' is > 1.
2110 (*-------------------------- OCINumberHypCos --------------------------------*)
2112 TOCINumberHypCos = function(err: POCIError; const number: POCINumber;
2113 _result: POCINumber): sword; cdecl;
2115 NAME: OCINumberHypCos - OCINumber takes the CoSine Hyperbolic of an
2118 err (IN/OUT) - error handle. If there is an error, it is
2119 recorded in 'err' and this function returns OCI_ERROR.
2120 The error recorded in 'err' can be retrieved by calling
2122 number (IN) - argument of the cosine hyperbolic
2123 result (OUT) - result of the cosine hyperbolic
2125 Takes the hyperbolic cosine of an Oracle number.
2127 OCI_SUCCESS if the function completes successfully.
2128 OCI_INVALID_HANDLE if 'err' is NULL.
2130 any of the number arguments is null
2132 An Oracle number overflow causes an unpredictable result value.
2135 (*----------------------------- OCINumberTan --------------------------------*)
2137 TOCINumberTan = function(err: POCIError; const number: POCINumber;
2138 _result: POCINumber): sword; cdecl;
2140 NAME: OCINumberTan - OCINumber takes the TANgent of an Oracle number
2142 err (IN/OUT) - error handle. If there is an error, it is
2143 recorded in 'err' and this function returns OCI_ERROR.
2144 The error recorded in 'err' can be retrieved by calling
2146 number (IN) - argument of the tangent in radians
2147 result (OUT) - result of the tangent
2149 Takes the tangent in radians of an Oracle number.
2151 OCI_SUCCESS if the function completes successfully.
2152 OCI_INVALID_HANDLE if 'err' is NULL.
2154 any of the number arguments is null
2157 (*-------------------------- OCINumberArcTan --------------------------------*)
2159 TOCINumberArcTan = function(err: POCIError; const number: POCINumber;
2160 _result: POCINumber): sword; cdecl;
2162 NAME: OCINumberArcTan - OCINumber takes the Arc TANgent of an Oracle number
2164 err (IN/OUT) - error handle. If there is an error, it is
2165 recorded in 'err' and this function returns OCI_ERROR.
2166 The error recorded in 'err' can be retrieved by calling
2168 number (IN) - argument of the arc tangent
2169 result (OUT) - result of the arc tangent in radians
2171 Takes the arc tangent in radians of an Oracle number.
2173 OCI_SUCCESS if the function completes successfully.
2174 OCI_INVALID_HANDLE if 'err' is NULL.
2176 any of the number arguments is null
2179 (*------------------------ OCINumberArcTan2 ---------------------------------*)
2181 TOCINumberArcTan2 = function(err: POCIError; const number1: POCINumber;
2182 const number2: POCINumber; _result: POCINumber): sword; cdecl;
2184 NAME: OCINumberArcTan2 - OCINumber takes the ATan2 of 2 Oracle numbers
2186 err (IN/OUT) - error handle. If there is an error, it is
2187 recorded in 'err' and this function returns OCI_ERROR.
2188 The error recorded in 'err' can be retrieved by calling
2190 number1 (IN) - first argument of atan2(y,x) function which
2191 corresponds to 'y' parameter in the function
2192 number2 (IN) - second argument of atan2(y,x) function which
2193 corresponds to 'x' parameter in the function
2194 result (OUT) - result of the atan2() in radians
2196 Takes the atan2(number1, number2).
2198 OCI_SUCCESS if the function completes successfully.
2199 OCI_INVALID_HANDLE if 'err' is NULL.
2201 any of the number arguments is null
2205 (*----------------------------- OCINumberHypTan -----------------------------*)
2207 TOCINumberHypTan = function(err: POCIError; const number: POCINumber;
2208 _result: POCINumber): sword; cdecl;
2210 NAME: OCINumberHypTan - OCINumber takes the TaNgent Hyperbolic of an Oracle
2213 err (IN/OUT) - error handle. If there is an error, it is
2214 recorded in 'err' and this function returns OCI_ERROR.
2215 The error recorded in 'err' can be retrieved by calling
2217 number (IN) - argument of the tangent hyperbolic
2218 result (OUT) - result of the tangent hyperbolic
2220 Takes the hyperbolic tangent of an Oracle number.
2222 OCI_SUCCESS if the function completes successfully.
2223 OCI_INVALID_HANDLE if 'err' is NULL.
2225 any of the number arguments is null
2227 An Oracle number overflow causes an unpredictable result value.
2230 (*--------------------------- OCINumberExp ----------------------------------*)
2232 TOCINumberExp = function(err: POCIError; const number: POCINumber;
2233 _result: POCINumber): sword; cdecl;
2235 NAME: OCINumberExp - OCINumber EXPonential
2237 err (IN/OUT) - error handle. If there is an error, it is
2238 recorded in 'err' and this function returns OCI_ERROR.
2239 The error recorded in 'err' can be retrieved by calling
2241 number (IN) - e raised to this Oracle number power
2242 result (OUT) - output of exponentiation
2244 Raises e to the specified Oracle number power
2246 OCI_SUCCESS if the function completes successfully.
2247 OCI_INVALID_HANDLE if 'err' is NULL.
2249 any of the number arguments is null
2252 (*----------------------------- OCINumberLn ---------------------------------*)
2254 TOCINumberLn = function(err: POCIError; const number: POCINumber;
2255 _result: POCINumber): sword; cdecl;
2257 NAME: OCINumberLn - OCINumber Logarithm Natural
2259 err (IN/OUT) - error handle. If there is an error, it is
2260 recorded in 'err' and this function returns OCI_ERROR.
2261 The error recorded in 'err' can be retrieved by calling
2263 number (IN) - logarithm of this number is computed
2264 result (OUT) - logarithm result
2266 Takes the logarithm of the given Oracle number with respect
2269 OCI_SUCCESS if the function completes successfully.
2270 OCI_INVALID_HANDLE if 'err' is NULL.
2272 any of the number arguments is null
2276 (*----------------------------- OCINumberLog --------------------------------*)
2278 TOCINumberLog = function(err: POCIError; const base: POCINumber;
2279 const number: POCINumber; _result: POCINumber): sword; cdecl;
2281 NAME: OCINumberLog - OCINumber LOGarithm any base
2283 err (IN/OUT) - error handle. If there is an error, it is
2284 recorded in 'err' and this function returns OCI_ERROR.
2285 The error recorded in 'err' can be retrieved by calling
2287 base (IN) - base of the logarithm
2288 number (IN) - opearnd
2289 result (OUT) - logarithm result
2291 Takes the logarithm with the specified base of an Oracle number.
2293 OCI_SUCCESS if the function completes successfully.
2294 OCI_INVALID_HANDLE if 'err' is NULL.
2296 any of the number arguments is null
2301 (*****************************************************************************
2302 * ORACLE DATE TYPE *
2303 *****************************************************************************)
2305 POCITime = ^TOCITime;
2307 OCITimeHH: ub1; // hours; range is 0 <= hours <=23
2308 OCITimeMI: ub1; // minutes; range is 0 <= minutes <= 59
2309 OCITimeSS: ub1; // seconds; range is 0 <= seconds <= 59
2313 * OCITime - OCI TiMe portion of date
2315 * This structure should be treated as an opaque structure as the format
2316 * of this structure may change. Use OCIDateGetTime/OCIDateSetTime
2317 * to manipulate time portion of OCIDate.
2320 POCIDate = ^TOCIDate;
2322 OCIDateYYYY: sb2; // gregorian year; range is -4712 <= year <= 9999
2323 OCIDateMM: ub1; // month; range is 1 <= month < 12
2324 OCIDateDD: ub1; // day; range is 1 <= day <= 31
2325 OCIDateTime: TOCITime; // time
2329 * OCIDate - OCI oracle Date representation in C
2331 * OCIDate represents the C mapping of Oracle date.
2333 * This structure should be treated as an opaque structure as the format
2334 * of this structure may change. Use OCIDateGetDate/OCIDateSetDate
2335 * to access/initialize OCIDate.
2337 * For binding variables of type OCIDate in OCI calls (OCIBindByName(),
2338 * OCIBindByPos(), and OCIDefineByPos()) use the type code SQLT_ODT.
2344 The following example shows how to manipulate an attribute of type
2347 #define FMT "Month dd, YYYY, HH:MI A.M."
2348 #define LANG "American"
2354 typedef struct person person;
2358 sword status; /o error status o/
2360 /o See oci.h for an example of how to initialize OCIError.
2361 o For this example, assume the OCIEnv and OCIError has been
2365 /o Pin joe person object in the object cache. See ori.h
2366 o for an example on pinning objects. For this example, assume that
2367 o joe is pointing to the pinned object.
2370 /o set the start date of joe o/
2371 OCIDateSetTime(&joe->start_date, 8, 0, 0);
2372 OCIDateSetDate(&joe->start_date, 1990, 10, 5);
2374 /o check if the date is valid o/
2376 if (OCIDateCheck(err, &joe->start_date, &invalid) != OCI_SUCCESS)
2377 /o error handling code o/
2379 /o error handling code o/
2381 /o convert date for display purposes o/
2383 ub4 strlen = sizeof(str);
2384 if (OCIDateToText(err, &joe->start_date, FMT, sizeof(FMT)-1, LANG,
2385 sizeof(LANG)-1, &strlen, str) != OCI_SUCCESS)
2386 /o error handling code o/
2390 (*--------------------------- OCIDateGetTime --------------------------------*/
2391 /* void OCIDateGetTime(/o_ const OCIDate *date, ub1 *hour, ub1 *min,
2393 #define OCIDateGetTime(date, hour, min, sec) \
2395 *hour = (date)->OCIDateTime.OCITimeHH; \
2396 *min = (date)->OCIDateTime.OCITimeMI; \
2397 *sec = (date)->OCIDateTime.OCITimeSS; \
2400 NAME: OCIDateGetTime - OCIDate Get Time portion of date
2402 date (IN) - Oracle date whose time data is retrieved
2403 hour (OUT) - hour value returned
2404 min (OUT) - minute value returned
2405 sec (OUT) - second value returned
2407 Return time inforamtion stored in the given date. The time
2408 information returned is: hour, minute and seconds.
2413 /*--------------------------- OCIDateGetDate --------------------------------*/
2414 /* void OCIDateGetDate(/o_ const OCIDate *date, sb2 *year, ub1 *month,
2416 #define OCIDateGetDate(date, year, month, day) \
2418 *year = (date)->OCIDateYYYY; \
2419 *month = (date)->OCIDateMM; \
2420 *day = (date)->OCIDateDD; \
2423 NAME: OCIDateGetDate - OCIDate Get Date (year, month, day) portion of date
2425 date (IN) - Oracle date whose year, month, day data is retrieved
2426 year (OUT) - year value returned
2427 month (OUT) - month value returned
2428 day (OUT) - day value returned
2430 Return year, month, day inforamtion stored in the given date.
2435 /*--------------------------- OCIDateSetTime --------------------------------*/
2436 /* void OCIDateSetTime(/o_ OCIDate *date, ub1 hour, ub1 min,
2438 #define OCIDateSetTime(date, hour, min, sec) \
2440 (date)->OCIDateTime.OCITimeHH = hour; \
2441 (date)->OCIDateTime.OCITimeMI = min; \
2442 (date)->OCIDateTime.OCITimeSS = sec; \
2445 NAME: OCIDateSetTime - OCIDate Set Time portion of date
2447 date (OUT) - Oracle date whose time data is set
2448 hour (IN) - hour value to be set
2449 min (IN) - minute value to be set
2450 sec (IN) - second value to be set
2452 Set the date with the given time inforamtion.
2457 /*--------------------------- OCIDateSetDate --------------------------------*/
2458 /* void OCIDateSetDate(/o_ OCIDate *date, sb2 year, ub1 month, ub1 day _o/); */
2459 #define OCIDateSetDate(date, year, month, day) \
2461 (date)->OCIDateYYYY = year; \
2462 (date)->OCIDateMM = month; \
2463 (date)->OCIDateDD = day; \
2466 NAME: OCIDateSetDate - OCIDate Set Date (year, month, day) portion of date
2468 date (IN) - Oracle date whose year, month, day data is set
2469 year (OUT) - year value to be set
2470 month (OUT) - month value to be set
2471 day (OUT) - day value to be set
2473 Set the date with the given year, month, day inforamtion.
2478 (*--------------------------- OCIDateAssign ---------------------------------*)
2480 TOCIDateAssign = function(err: POCIError; const from: POCIDate;
2481 _to: POCIDate): sword; cdecl;
2483 NAME: OCIDateAssign - OCIDate Assignment
2485 err (IN/OUT) - error handle. If there is an error, it is
2486 recorded in 'err' and this function returns OCI_ERROR.
2487 The error recorded in 'err' can be retrieved by calling
2489 from (IN) - date to be assigned
2490 to (OUT) - lhs of assignment
2492 Performs date assignment.
2497 (*--------------------------- OCIDateToText ---------------------------------*)
2499 TOCIDateToText = function(err: POCIError; const date: POCIDate;
2500 const fmt: poratext; fmt_length: ub1;
2501 const lang_name: poratext; lang_length: ub4;
2502 buf_size: pub4; buf: poratext): sword; cdecl;
2504 NAME: OCIDateToText - OCIDate convert date TO String
2506 err (IN/OUT) - error handle. If there is an error, it is
2507 recorded in 'err' and this function returns OCI_ERROR.
2508 The error recorded in 'err' can be retrieved by calling
2510 date (IN) - Oracle date to be converted
2511 fmt (IN) - conversion format, if null string pointer (oratext * )0, then
2512 the date is converted to a character string in the
2513 date format "DD-MON-YY".
2514 fmt_length (IN) - length of the 'fmt' parameter
2515 lang_name (IN) - specifies the language in which the names and
2516 abbreviations of months and days are returned;
2517 default language of session is used if 'lang_name'
2518 is null i.e. (oratext * )0
2519 lang_length (IN) - length of the 'nls_params' parameter
2520 buf_size (IN/OUT) - size of the buffer; size of the resulting string
2521 is returned via this parameter
2522 buf (OUT) - buffer into which the converted string is placed
2524 Converts the given date to a string according to the specified format.
2525 Refer to "TO_DATE" conversion function described in
2526 "Oracle SQL Language Reference Manual" for a description of format
2527 and NLS arguments. The converted null-terminated date string is
2528 stored in the buffer 'buf'.
2530 An error is reported upon overflow, e.g. trying to convert a number
2531 of value 10 using format '9' causes an overflow.
2533 OCI_SUCCESS if the function completes successfully.
2534 OCI_INVALID_HANDLE if 'err' is NULL.
2542 (*---------------------------- OCIDateFromText ------------------------------*)
2544 TOCIDateFromText = function(err: POCIError; const date_str: poratext;
2545 d_str_length: ub4; const fmt: poratext; fmt_length: ub1;
2546 const lang_name: poratext; lang_length: ub4;
2547 date: POCIDate): sword; cdecl;
2549 NAME: OCIDateFromText - OCIDate convert String TO Date
2551 err (IN/OUT) - error handle. If there is an error, it is
2552 recorded in 'err' and this function returns OCI_ERROR.
2553 The error recorded in 'err' can be retrieved by calling
2555 date_str (IN) - input string to be converted to Oracle date
2556 d_str_length (IN) - size of the input string, if the length is -1
2557 then 'date_str' is treated as a null terminated string
2558 fmt (IN) - conversion format; if 'fmt' is a null pointer, then
2559 the string is expected to be in 'DD-MON-YY' format.
2560 fmt_length (IN) - length of the 'fmt' parameter
2561 lang_name (IN) - language in which the names and abbreviations of
2562 days and months are specified, if null i.e. (oratext * )0,
2563 the default language of session is used,
2564 lang_length (IN) - length of the 'lang_name' parameter
2565 date (OUT) - given string converted to date
2567 Converts the given string to Oracle date
2568 according to the specified format. Refer to "TO_DATE" conversion
2569 function described in "Oracle SQL Language Reference Manual" for a
2570 description of format.
2572 OCI_SUCCESS if the function completes successfully.
2573 OCI_INVALID_HANDLE if 'err' is NULL.
2577 invalid input string
2581 (*----------------------------- OCIDateCompare ------------------------------*)
2583 TOCIDateCompare = function(err: POCIError; const date1: POCIDate;
2584 const date2: POCIDate; _result: psword): sword; cdecl;
2586 NAME: OCIDateCompare - OCIDate CoMPare dates
2588 err (IN/OUT) - error handle. If there is an error, it is
2589 recorded in 'err' and this function returns OCI_ERROR.
2590 The error recorded in 'err' can be retrieved by calling
2592 date1, date2 (IN) - dates to be compared
2593 result (OUT) - comparison result, 0 if equal, -1 if date1 < date2,
2596 The function OCIDateCompare compares two dates. It returns -1 if date1
2597 is smaller than date2, 0 if they are equal, and 1 if date1 is greater
2600 OCI_SUCCESS if the function completes successfully.
2601 OCI_INVALID_HANDLE if 'err' is NULL.
2607 (*------------------------- OCIDateAddMonths --------------------------------*)
2609 TOCIDateAddMonths = function(err: POCIError; const date: POCIDate;
2610 num_months: sb4; _result: POCIDate): sword; cdecl;
2612 NAME: OCIDateAddMonths - OCIDate ADd or subtract Months
2614 err (IN/OUT) - error handle. If there is an error, it is
2615 recorded in 'err' and this function returns OCI_ERROR.
2616 The error recorded in 'err' can be retrieved by calling
2618 date (IN) - 'num_months' added or subtracted from 'date'
2619 num_months (IN) - number of months to be added or subtracted
2620 (a negative value will be subtracted)
2621 result (IN/OUT) - result of adding or subtracting to 'date'
2623 The function OCIDateAddDays adds or subtracts num_months from the
2625 If the input 'date' is the last day of a month, then
2626 appropriate adjustments are made to ensure that the output date is
2627 also the last day of the month. For example, Feb. 28 + 1 month =
2628 March 31, and November 30 - 3 months = August 31. Otherwise the
2629 'result' date has the same day component as 'date'.
2631 OCI_SUCCESS if the function completes successfully.
2632 OCI_INVALID_HANDLE if 'err' is NULL.
2638 (*--------------------------- OCIDateAddDays --------------------------------*)
2640 TOCIDateAddDays = function(err: POCIError; const date: POCIDate; num_days: sb4;
2641 _result: POCIDate):sword; cdecl;
2643 NAME: OCIDateAddDays - OCIDate ADd or subtract Days
2645 err (IN/OUT) - error handle. If there is an error, it is
2646 recorded in 'err' and this function returns OCI_ERROR.
2647 The error recorded in 'err' can be retrieved by calling
2649 date (IN) - 'num_days' added or subtracted from 'date'
2650 num_days (IN) - number of days to be added or subtracted
2651 (a negative value will be subtracted)
2652 result (IN/OUT) - result of adding or subtracting to 'date'
2654 The function OCIDateAddDays adds or subtracts num_days from the
2657 OCI_SUCCESS if the function completes successfully.
2658 OCI_INVALID_HANDLE if 'err' is NULL.
2664 (*--------------------------- OCIDateLastDay --------------------------------*)
2666 TOCIDateLastDay = function(err: POCIError; const date: POCIDate;
2667 last_day: POCIDate): sword; cdecl;
2669 NAME: OCIDateLastDay - OCIDate get date of the LaST day of the month
2671 err (IN/OUT) - error handle. If there is an error, it is
2672 recorded in 'err' and this function returns OCI_ERROR.
2673 The error recorded in 'err' can be retrieved by calling
2675 date (IN) - input date
2676 last_day (OUT) - last day of the month in date 'date'
2678 The function OCIDateLastDay returns the date of the last day of the
2679 month in date 'date'.
2681 OCI_SUCCESS if the function completes successfully.
2682 OCI_INVALID_HANDLE if 'err' is NULL.
2688 (*----------------------- OCIDateDaysBetween --------------------------------*)
2690 TOCIDateDaysBetween = function(err: POCIError; const date1: POCIDate;
2691 const dtae2: POCIDate; num_days: psb4): sword; cdecl;
2693 NAME: OCIDateDaysBetween - OCIDate get number of days BeTWeen two dates
2695 err (IN/OUT) - error handle. If there is an error, it is
2696 recorded in 'err' and this function returns OCI_ERROR.
2697 The error recorded in 'err' can be retrieved by calling
2699 date1, date2 (IN) - input dates
2700 num_days (OUT) - number of days between date1 and date2
2702 The function OCIDateDaysBetween returns the number of days between
2703 date1 and date2. The time is ignored in this computation.
2705 OCI_SUCCESS if the function completes successfully.
2706 OCI_INVALID_HANDLE if 'err' is NULL.
2712 (*------------------------ OCIDateZoneToZone --------------------------------*)
2714 TOCIDateZoneToZone = function(err: POCIError; const date1: POCIDate;
2715 const zon1: poratext;
2716 zon1_length: ub4; const zon2: poratext;
2717 zon2_length: ub4; dtae2: POCIDate): sword; cdecl;
2719 NAME: OCIDateZoneToZone - OCIDate convert date from one Zone TO another Zone
2721 err (IN/OUT) - error handle. If there is an error, it is
2722 recorded in 'err' and this function returns OCI_ERROR.
2723 The error recorded in 'err' can be retrieved by calling
2725 date1 (IN) - date to be converted
2726 zon1 (IN) - zone of input date
2727 zon1_length (IN) - length in bytes of string 'zon1'
2728 zon2 (IN) - zone to be converted to
2729 zon2_length (IN) - length in bytes of string 'zon2'
2730 date2 (OUT) - converted date (in 'zon2')
2732 Converts date from one time zone to another. Given date 'date1'
2733 in time zone 'zon1' returns date 'date2' in time zone 'zon2'.
2735 OCI_SUCCESS if the function completes successfully.
2736 OCI_INVALID_HANDLE if 'err' is NULL.
2739 invald input time zone
2740 invald output time zone
2744 (*--------------------------- OCIDateNextDay --------------------------------*)
2746 TOCIDateNextDay = function(err: POCIError; const dtae: POCIDate;
2747 const day_p: poratext; day_length: ub4;
2748 next_day: POCIDate): sword; cdecl;
2750 NAME: OCIDateNextDay - OCIDate get date of Next DaY
2752 err (IN/OUT) - error handle. If there is an error, it is
2753 recorded in 'err' and this function returns OCI_ERROR.
2754 The error recorded in 'err' can be retrieved by calling
2756 date (IN) - returned date should be later than this date
2757 day (IN) - first day of week named by this is returned
2758 day_length (IN) - length in bytes of string 'day'
2759 next_day (OUT) - first day of the week named by 'day' later than 'date'
2761 Returns the date of the first day of the
2762 week named by 'day' that is later than date 'date'.
2764 OCI_SUCCESS if the function completes successfully.
2765 OCI_INVALID_HANDLE if 'err' is NULL.
2772 /*----------------------------- OCIDateCheck --------------------------------*/
2774 /* Listing of error bits used by OCIDateCheck() */
2775 #define OCI_DATE_INVALID_DAY 0x1 /* Bad DAy */
2776 #define OCI_DATE_DAY_BELOW_VALID 0x2 /* Bad DAy Low/high bit (1=low)*/
2777 #define OCI_DATE_INVALID_MONTH 0x4 /* Bad MOnth */
2778 #define OCI_DATE_MONTH_BELOW_VALID 0x8 /* Bad MOnth Low/high bit (1=low)*/
2779 #define OCI_DATE_INVALID_YEAR 0x10 /* Bad YeaR */
2780 #define OCI_DATE_YEAR_BELOW_VALID 0x20 /* Bad YeaR Low/high bit (1=low)*/
2781 #define OCI_DATE_INVALID_HOUR 0x40 /* Bad HouR */
2782 #define OCI_DATE_HOUR_BELOW_VALID 0x80 /* Bad HouR Low/high bit (1=low)*/
2783 #define OCI_DATE_INVALID_MINUTE 0x100 /* Bad MiNute */
2784 #define OCI_DATE_MINUTE_BELOW_VALID 0x200
2785 /* Bad MiNute Low/high bit (1=low)*/
2786 #define OCI_DATE_INVALID_SECOND 0x400 /* Bad SeCond */
2787 #define OCI_DATE_SECOND_BELOW_VALID 0x800
2788 /* bad second Low/high bit (1=low)*/
2789 #define OCI_DATE_DAY_MISSING_FROM_1582 0x1000
2790 /* Day is one of those "missing" from 1582 */
2791 #define OCI_DATE_YEAR_ZERO 0x2000 /* Year may not equal zero */
2792 #define OCI_DATE_INVALID_FORMAT 0x8000 /* Bad date format input */
2794 sword OCIDateCheck( OCIError *err, const OCIDate *date, uword *valid );
2796 NAME: OCIDateCheck - OCIDate CHecK if the given date is valid
2798 err (IN/OUT) - error handle. If there is an error, it is
2799 recorded in 'err' and this function returns OCI_ERROR.
2800 The error recorded in 'err' can be retrieved by calling
2802 date (IN) - date to be checked
2803 valid (OUT) - returns zero for a valid date, otherwise
2804 the ORed combination of all error bits specified below:
2806 Macro name Bit number Error
2807 ---------- ---------- -----
2808 OCI_DATE_INVALID_DAY 0x1 Bad day
2809 OCI_DATE_DAY_BELOW_VALID 0x2 Bad DAy Low/high bit (1=low)
2810 OCI_DATE_INVALID_MONTH 0x4 Bad MOnth
2811 OCI_DATE_MONTH_BELOW_VALID 0x8 Bad MOnth Low/high bit (1=low)
2812 OCI_DATE_INVALID_YEAR 0x10 Bad YeaR
2813 OCI_DATE_YEAR_BELOW_VALID 0x20 Bad YeaR Low/high bit (1=low)
2814 OCI_DATE_INVALID_HOUR 0x40 Bad HouR
2815 OCI_DATE_HOUR_BELOW_VALID 0x80 Bad HouR Low/high bit (1=low)
2816 OCI_DATE_INVALID_MINUTE 0x100 Bad MiNute
2817 OCI_DATE_MINUTE_BELOW_VALID 0x200 Bad MiNute Low/high bit (1=low)
2818 OCI_DATE_INVALID_SECOND 0x400 Bad SeCond
2819 OCI_DATE_SECOND_BELOW_VALID 0x800 bad second Low/high bit (1=low)
2820 OCI_DATE_DAY_MISSING_FROM_1582 0x1000 Day is one of those "missing"
2822 OCI_DATE_YEAR_ZERO 0x2000 Year may not equal zero
2823 OCI_DATE_INVALID_FORMAT 0x8000 Bad date format input
2825 So, for example, if the date passed in was 2/0/1990 25:61:10 in
2826 (month/day/year hours:minutes:seconds format), the erroor returned
2827 would be OCI_DATE_INVALID_DAY | OCI_DATE_DAY_BELOW_VALID |
2828 OCI_DATE_INVALID_HOUR | OCI_DATE_INVALID_MINUTE
2831 Check if the given date is valid.
2833 OCI_SUCCESS if the function completes successfully.
2834 OCI_INVALID_HANDLE if 'err' is NULL.
2836 'date' and 'valid' pointers are NULL pointers
2839 /*--------------------------- OCIDateSysDate --------------------------------*/
2841 sword OCIDateSysDate( OCIError *err, OCIDate *sys_date );
2843 NAME: OCIDateSysDate - OCIDate get current SYStem date and time
2845 err (IN/OUT) - error handle. If there is an error, it is
2846 recorded in 'err' and this function returns OCI_ERROR.
2847 The error recorded in 'err' can be retrieved by calling
2849 sys_date (OUT) - current system date and time
2851 Returns the current system date and time.
2853 OCI_SUCCESS if the function completes successfully.
2854 OCI_INVALID_HANDLE if 'err' is NULL.
2859 /*****************************************************************************/
2860 /* FIXED-LENGTH STRING - CHAR (N) */
2861 /*****************************************************************************/
2864 * An ADT attribute declared as "x CHAR(n)" is mapped to "OCIString *x;".
2865 * The representation of OCIString * is shown below.
2868 /*****************************************************************************/
2869 /* VARIABLE-LENGTH STRING */
2870 /*****************************************************************************/
2873 * The variable-length string is represented in C as a pointer to OCIString
2874 * structure. The OCIString structure is opaque to the user. Functions are
2875 * provided to allow the user to manipulate a variable-length string.
2877 * A variable-length string can be declared as:
2881 * For binding variables of type OCIString* in OCI calls (OCIBindByName(),
2882 * OCIBindByPos() and OCIDefineByPos()) use the external type code SQLT_VST.
2884 typedef struct OCIString OCIString;
2886 /*-------------------------- OCIStringAssign --------------------------------*/
2888 sword OCIStringAssign( OCIEnv *env, OCIError *err, const OCIString *rhs,
2891 NAME: OCIStringAssign - OCIString Assign String to String
2893 env (IN/OUT) - OCI environment handle initialized in object mode.
2894 err (IN/OUT) - error handle. If there is an error, it is
2895 recorded in 'err' and this function returns OCI_ERROR.
2896 The error recorded in 'err' can be retrieved by calling
2898 rhs (IN) - RHS of the assignment, the type of rhs is also OCIString
2899 lhs (IN/OUT) - LHS of the assignment
2901 Assign 'rhs' string to 'lhs' string. The 'lhs' string may be
2902 resized depending upon the size of the 'rhs'. The assigned string is
2903 null-terminated. The 'length' field will not include the extra byte
2904 needed for null termination.
2906 OCI_SUCCESS if the function completes successfully.
2907 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
2912 /*---------------------- OCIStringAssignText --------------------------------*/
2914 sword OCIStringAssignText( OCIEnv *env, OCIError *err, const oratext *rhs,
2915 ub4 rhs_len, OCIString **lhs );
2917 NAME: OCIStringAssignText - OCIString Assign Text string to String
2919 env (IN/OUT) - OCI environment handle initialized in object mode.
2920 err (IN/OUT) - error handle. If there is an error, it is
2921 recorded in 'err' and this function returns OCI_ERROR.
2922 The error recorded in 'err' can be retrieved by calling
2924 rhs (IN) - RHS of the assignment, the type of rhs is a text string
2925 rhs_len (IN) - length of the 'rhs' string
2926 lhs (IN/OUT) - LHS of the assignment
2928 Assign 'rhs' string to 'lhs' string. The 'lhs' string may be
2929 resized depending upon the size of the 'rhs'. The assigned string is
2930 null-terminated. The 'length' field will not include the extra byte
2931 needed for null termination.
2933 OCI_SUCCESS if the function completes successfully.
2934 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
2939 /*-------------------------- OCIStringResize --------------------------------*/
2941 sword OCIStringResize( OCIEnv *env, OCIError *err, ub4 new_size,
2944 NAME: OCIStringResize - OCIString ReSiZe string memory
2946 env (IN/OUT) - OCI environment handle initialized in object mode.
2947 err (IN/OUT) - error handle. If there is an error, it is
2948 recorded in 'err' and this function returns OCI_ERROR.
2949 The error recorded in 'err' can be retrieved by calling
2951 new_size (IN) - new memory size of the string in bytes
2952 str (IN/OUT) - allocated memory for the string is freed from the
2955 This function resizes the memory of the given variable-length string in
2956 the object cache. The contents of the string are NOT preserved.
2957 This function may allocate the string in a new memory region in
2958 which case the original memory occupied by the given string will
2959 be freed. If the input string is null (str == NULL), then this
2960 function will allocate memory for the string.
2962 If the new_size is 0, then this function frees the memory occupied
2963 by 'str' and a null pointer value is returned.
2965 NOTE: The caller must compute 'new_size' taking into account space
2966 for the null character ('\0').
2968 OCI_SUCCESS if the function completes successfully.
2969 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
2974 /*---------------------------- OCIStringSize --------------------------------*/
2976 ub4 OCIStringSize( OCIEnv *env, const OCIString *vs );
2978 NAME: OCIStringSize - OCIString Get String siZe
2980 env(IN) - pointer to OCI environment handle
2981 vs (IN) - string whose size is returned
2983 Return the size of the given string.
2985 size of the string in bytes is returned
2988 /*----------------------------- OCIStringPtr --------------------------------*/
2990 oratext *OCIStringPtr( OCIEnv *env, const OCIString *vs );
2992 NAME: OCIStringPtr - OCIString Get String Pointer
2994 env(IN) - pointer to OCI environment handle
2995 vs (IN) - pointer to the text of this string is returned
2997 Return the pointer to the text of the given string.
2999 pointer to the text of the string is returned
3002 /*----------------------- OCIStringAllocSize --------------------------------*/
3004 sword OCIStringAllocSize( OCIEnv *env, OCIError *err, const OCIString *vs,
3007 NAME: OCIStringAllocSize - OCIString get Allocated SiZe of string memory
3010 env (IN/OUT) - OCI environment handle initialized in object mode.
3011 err (IN/OUT) - error handle. If there is an error, it is
3012 recorded in 'err' and this function returns OCI_ERROR.
3013 The error recorded in 'err' can be retrieved by calling
3015 vs (IN) - string whose allocated size in bytes is returned
3016 allocsize (OUT) - allocated size of string memory in bytes is returned
3018 Return the allocated size of the string memory in bytes. The
3019 allocated size is >= actual string size.
3021 vs is a non-null pointer
3023 OCI_SUCCESS if the function completes successfully.
3024 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3028 /*****************************************************************************/
3029 /* VARIABLE-LENGTH RAW */
3030 /*****************************************************************************/
3033 * The variable-length raw is represented in C as a pointer to OCIRaw
3034 * structure. The OCIRaw structure is opaque to the user. Functions are
3035 * provided to allow the user to manipulate a variable-length raw.
3037 * A variable-length raw can be declared as:
3041 * For binding variables of type OCIRaw* in OCI calls (OCIBindByName(),
3042 * OCIBindByPos() and OCIDefineByPos()) use the external type code SQLT_LVB.
3044 typedef struct OCIRaw OCIRaw;
3046 /*-------------------------- OCIRawAssignRaw --------------------------------*/
3048 sword OCIRawAssignRaw( OCIEnv *env, OCIError *err, const OCIRaw *rhs,
3051 NAME: OCIRawAssignRaw - OCIRaw Assign Raw (of type OCIRaw* ) to
3052 Raw (of type OCIRaw* )
3054 env (IN/OUT) - OCI environment handle initialized in object mode.
3055 err (IN/OUT) - error handle. If there is an error, it is
3056 recorded in 'err' and this function returns OCI_ERROR.
3057 The error recorded in 'err' can be retrieved by calling
3059 rhs (IN) - RHS of the assignment, the type of rhs is also OCIRaw
3060 lhs (IN/OUT) - LHS of the assignment
3062 Assign 'rhs' raw to 'lhs' raw. The 'lhs' raw may be
3063 resized depending upon the size of the 'rhs'.
3065 OCI_SUCCESS if the function completes successfully.
3066 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3071 /*------------------------ OCIRawAssignBytes --------------------------------*/
3073 sword OCIRawAssignBytes( OCIEnv *env, OCIError *err, const ub1 *rhs,
3074 ub4 rhs_len, OCIRaw **lhs );
3076 NAME: OCIRawAssignBytes - OCIRaw Assign raw Bytes (of type ub1* ) to Raw
3079 env (IN/OUT) - OCI environment handle initialized in object mode.
3080 err (IN/OUT) - error handle. If there is an error, it is
3081 recorded in 'err' and this function returns OCI_ERROR.
3082 The error recorded in 'err' can be retrieved by calling
3084 rhs (IN) - RHS of the assignment, the type of rhs is ub1 *
3085 rhs_len (IN) - length of the 'rhs' raw
3086 lhs (IN/OUT) - LHS of the assignment
3088 Assign 'rhs' raw to 'lhs' raw. The 'lhs' raw may be
3089 resized depending upon the size of the 'rhs'.
3091 OCI_SUCCESS if the function completes successfully.
3092 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3097 /*---------------------------- OCIRawResize ---------------------------------*/
3099 sword OCIRawResize( OCIEnv *env, OCIError *err, ub4 new_size,
3102 NAME: OCIRawResize - OCIRaw ReSiZe memory of variable-length raw
3104 env (IN/OUT) - OCI environment handle initialized in object mode.
3105 err (IN/OUT) - error handle. If there is an error, it is
3106 recorded in 'err' and this function returns OCI_ERROR.
3107 The error recorded in 'err' can be retrieved by calling
3109 new_size (IN) - new size of the raw data in bytes
3110 raw (IN) - variable-length raw pointer; the raw is
3111 resized to 'new_size'
3113 This function resizes the memory of the given variable-length raw in
3115 The previous contents of the raw are NOT preserved.
3116 This function may allocate the raw in a new memory region in
3117 which case the original memory occupied by the given raw will
3118 be freed. If the input raw is null (raw == NULL), then this
3119 function will allocate memory for the raw data.
3121 If the new_size is 0, then this function frees the memory occupied
3122 by 'raw' and a null pointer value is returned.
3124 OCI_SUCCESS if the function completes successfully.
3125 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3130 /*------------------------------- OCIRawSize --------------------------------*/
3132 ub4 OCIRawSize( OCIEnv * env, const OCIRaw *raw );
3134 NAME: OCIRawSize - OCIRaw Get Raw siZe
3136 env (IN) - pointer to OCI environment handle
3137 raw (INT) - raw whose size is returned
3139 Return the size of the given raw.
3141 size of the raw in bytes is returned
3144 /*--------------------------------- OCIRawPtr -------------------------------*/
3145 ub1 *OCIRawPtr( OCIEnv * env, const OCIRaw *raw );
3147 NAME: OCIRawPtr - OCIRaw Get Raw data Pointer
3149 env (IN) - pointer to OCI environment handle
3150 raw (IN) - pointer to the data of this raw is returned
3152 Return the pointer to the data of the given raw.
3154 pointer to the data of the raw is returned
3157 /*------------------------------ OCIRawAllocSize ----------------------------*/
3159 sword OCIRawAllocSize( OCIEnv *env, OCIError *err, const OCIRaw *raw,
3162 NAME: OCIRawAllocSize - OCIRaw get Allocated SiZe of raw memory in bytes
3164 env (IN/OUT) - OCI environment handle initialized in object mode.
3165 err (IN/OUT) - error handle. If there is an error, it is
3166 recorded in 'err' and this function returns OCI_ERROR.
3167 The error recorded in 'err' can be retrieved by calling
3169 raw (IN) - raw whose allocated size in bytes is returned
3170 allocsize (OUT) - allocated size of raw memory in bytes is returned
3172 Return the allocated size of the raw memory in bytes. The
3173 allocated size is >= actual raw size.
3175 raw is a non-null pointer
3177 OCI_SUCCESS if the function completes successfully.
3178 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3179 OCI_ERROR upon error
3182 (*****************************************************************************
3183 * OBJECT REFERENCE OPERATIONS *
3184 *****************************************************************************)
3187 * See the definition of OCIRef in oro.h.
3189 * For binding variables of type OCIRef* in OCI calls (OCIBindByName(),
3190 * OCIBindByPos() and OCIDefineByPos()) use the code SQLT_REF.
3194 (*------------------------- OBJECT REFERENCE (REF) --------------------------*)
3196 PPOCIRef = ^POCIRef;
3199 * OCIRef - OCI object REFerence
3201 * In the Oracle object runtime environment, an object is identified by an
3202 * object reference (ref) which contains the object identifier plus other
3203 * runtime information. The contents of a ref is opaque to clients. Use
3204 * OCIObjectNew() to construct a ref.
3207 (*---------------------------- OCIRefClear ----------------------------------*)
3208 TOCIRefClear = procedure(env: POCIEnv; ref: POCIRef);
3210 NAME: OCIRefClear - OCIRef CLeaR or nullify a ref
3212 env (IN) - pointer to OCI environment handle
3213 ref (IN/OUT) - ref to clear
3215 Clear or nullify the given ref. A ref is considered to be a null ref
3216 if it does not contain a valid OID (and thus doesn't point to an
3217 object). Logically, a null ref is a dangling ref.
3219 Note that a null ref is still a valid SQL value and is not SQL-ly null.
3220 It can be used as a valid non-null constant ref value for NOT NULL
3221 column or attribute of a row in a table.
3223 If a null pointer value is passed as a ref,
3224 then this function is a no-op.
3227 (*--------------------------- OCIRefAssign ----------------------------------*)
3229 TOCIRefAssign = function(env: POCIEnv; err: POCIError; const source: POCIRef;
3230 target: PPOCIRef): sword; cdecl;
3232 NAME: OCIRefAssign - OCIRef CoPY a ref to another
3234 env (IN/OUT) - OCI environment handle initialized in object mode.
3235 err (IN/OUT) - error handle. If there is an error, it is
3236 recorded in 'err' and this function returns OCI_ERROR.
3237 The error recorded in 'err' can be retrieved by calling
3239 source (IN) - ref to copy from
3240 target (IN/OUT) - ref to copy to
3242 Copy 'source' ref to 'target' ref; both then reference the same
3243 object. If the target ref pointer is null (i.e. *target == NULL)
3244 then the copy function will allocate memory for the target ref
3245 in OOCI heap prior to the copy.
3247 OCI_SUCCESS if the function completes successfully.
3248 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3253 /*-------------------------- OCIRefIsEqual ----------------------------------*/
3254 boolean OCIRefIsEqual( OCIEnv *env, const OCIRef *x, const OCIRef *y );
3256 NAME: OCIRefIsEqual - OCIRef compare two refs for EQUality
3258 env (IN) - pointer to OCI environment handle
3259 x (IN) - ref to compare
3260 y (IN) - ref to compare
3262 Compare the given refs for equality.
3263 Two refs are equal if and only if:
3264 - they are both referencing the same persistent object, or
3265 - they are both referencing the same transient object.
3267 NOTE THAT TWO NULL REFS ARE CONSIDERED NOT EQUAL BY THIS FUNCTION.
3269 TRUE if the two refs are equal
3270 FALSE if the two refs are not equal, or X is NULL, or Y is NULL
3273 /*--------------------------- OCIRefIsNull ----------------------------------*/
3274 boolean OCIRefIsNull( OCIEnv *env, const OCIRef *ref );
3276 NAME: OCIRefIsNull - OCIRef test if a ref is NULl
3278 env (IN) - pointer to OCI environment handle
3279 ref (IN) - ref to test for null
3281 Return TRUE if the given ref is null; otherwise, return FALSE.
3282 A ref is null if and only if:
3283 - it is supposed to be referencing a persistent object, but
3285 - it is supposed to be referencing a transient object, but it is
3286 currently not pointing to an object.
3287 A ref is a dangling ref if the object that it points to does not
3290 TRUE if the given ref is NULL
3291 FALSE if the given ref is not NULL
3294 /*-------------------------- OCIRefHexSize ----------------------------------*/
3295 ub4 OCIRefHexSize( OCIEnv *env, const OCIRef *ref );
3297 NAME: OCIRefHexSize - OCIRef Hexadecimal buffer SiZe in bytes
3299 env (IN) - pointer to OCI environment handle
3300 ref (IN) - ref whose size in hexadecimal representation in bytes is
3303 Return the size of the buffer in bytes required for the hexadecimal
3304 representation of the ref. A buffer of at-least this size must be
3305 passed to ref-to-hex (OCIRefToHex) conversion function.
3307 size of hexadecimal representation of ref
3310 /*-------------------------- OCIRefFromHex ---------------------------------*/
3311 sword OCIRefFromHex( OCIEnv *env, OCIError *err, const OCISvcCtx *svc,
3312 const oratext *hex, ub4 length, OCIRef **ref );
3315 OCIRefFromHex - OCIRef convert a Hexadecimal string TO a Ref
3317 env (IN/OUT) - OCI environment handle initialized in object mode
3318 err (IN/OUT) - error handle. If there is an error, it is
3319 recorded in 'err' and this function returns OCI_ERROR.
3320 The error recorded in 'err' can be retrieved by
3321 calling OCIErrorGet().
3322 svc (IN) - OCI service context handle; if the resulting ref is
3323 initialized with this service context
3324 hex (IN) - hexadecimal string (that was produced by 'OCIRefToHex()"
3325 previously) to be convert into a ref
3326 length (IN) - length of the hexadecimal string
3327 ref (IN/OUT) - ref is initialized with the given value ('hex').
3328 If *ref is null, then space for the ref is allocated in the
3329 object cache, otherwise the memory occupied by the given ref
3332 Convert the given hexadecimal string into a ref. This function
3333 ensures that the resulting ref is well formed. It does NOT ensure
3334 that the object pointed to by the resulting ref exists or not.
3336 OCI_SUCCESS if the function completes successfully.
3337 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3341 /*--------------------------- OCIRefToHex -----------------------------------*/
3342 sword OCIRefToHex( OCIEnv *env, OCIError *err, const OCIRef *ref,
3343 oratext *hex, ub4 *hex_length );
3346 OCIRefToHex - OCIRef convert ref to a Hexadecimal string
3348 env (IN/OUT) - OCI environment handle initialized in object mode
3349 err (IN/OUT) - error handle. If there is an error, it is
3350 recorded in 'err' and this function returns OCI_ERROR.
3351 The error recorded in 'err' can be retrieved by
3352 calling OCIErrorGet().
3353 ref (IN) - ref to be converted into a hexadecimal string; if the
3354 ref is a null ref (i.e. OCIRefIsNull(ref) == TRUE) then
3355 a zero hex_length value is returned
3356 hex (OUT) - buffer that is large enough to contain the resulting
3357 hexadecimal string; the contents of the string is opaque
3359 hex_length (IN/OUT) - on input specifies the size of the 'hex' buffer,
3360 on output specifies the actual size of the hexadecimal
3361 string being returned in 'hex'
3363 Convert the given ref into a hexadecimal string, and return the length
3364 of the string. The resulting string is opaque to the caller.
3366 OCI_SUCCESS if the function completes successfully.
3367 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3369 the given buffer is not big enough to hold the resulting string
3373 /*****************************************************************************/
3374 /* COLLECTION FUNCTIONS */
3375 /*****************************************************************************/
3378 The generic collection is represented by the type 'OCIColl'. The following
3379 operations OCIColl*() are provided on a generic collection:
3380 - get current size of collection
3381 - get upper bound of collection
3382 - get pointer to an element given its index
3383 - set element at given index (assign element)
3385 - trim the given number of elements from the end of the collection
3386 - collection assignment
3388 The following iterator based scanning functions are also provided on a
3389 generic collection. These functions make use of an iterator which is
3390 defined to be of type OCIIter.
3392 - create an iterator for scanning collection
3394 - reset iterator to the beginning of collection
3395 - get pointer to current element pointed by iterator
3396 - get pointer to next element
3397 - get pointer to previous element
3399 The collections variable-length array (varray) and nested table
3400 are sub-types of generic collection. This means that the OCIColl*()
3401 functions can also be used to manipulate varray and nested table.
3403 The varray is represented by OCIArray type and nested table by OCITable.
3404 Besides OCIColl*() functions no additional functions are provided for
3405 manipulating varrays. The OCIColl*() functions are a complete set of
3406 functions to manipulate varrays.
3408 Besides OCIColl*() functions, the following functions OCITable*() can be
3409 used to manipulate nested table. The OCITable*() functions operate on
3410 nested tables only and should not be used on a varray.
3412 - delete an element at index i. Note that the position
3413 ordinals of the remaining elements of the table is not changed by the
3414 delete operation. So delete creates "holes" in the table.
3415 - check if an element exists at the given index i
3416 - return the smallest value of i for which exists(i) is true
3417 - return the largest value of i for which exists(i) is true
3418 - return pointer to the smallest position j, greater than i, such that
3419 OCITableExists(j) is true
3420 - return pointer to the largest position j, less than i, such that
3421 OCITableExists(j) is true
3423 For binding variables of type OCIColl* or OCITable* in OCI calls
3424 (OCIBindByName(), OCIBindByPos() and OCIDefineByPos()) use the external
3428 /* OCIColl - generic collection type */
3429 typedef struct OCIColl OCIColl;
3431 /* OCIArray - varray collection type */
3432 typedef OCIColl OCIArray;
3434 /* OCITable - nested table collection type */
3435 typedef OCIColl OCITable;
3437 /* OCIIter - collection iterator */
3438 typedef struct OCIIter OCIIter;
3440 /*----------------------------- OCICollSize ---------------------------------*/
3442 sword OCICollSize( OCIEnv *env, OCIError *err, const OCIColl *coll,
3445 NAME: OCICollSize - OCIColl return current SIZe of the given collection
3447 env(IN) - pointer to OCI environment handle
3448 err (IN/OUT) - error handle. If there is an error, it is
3449 recorded in 'err' and this function returns OCI_ERROR.
3450 The error recorded in 'err' can be retrieved by calling
3452 coll (IN) - collection whose number of elements is returned
3453 size (OUT) - current number of elements in the collection
3455 Returns the current number of elements in the given collection.
3457 For collections of type nested table wherein 'delete element'
3458 operation is allowed, the count returned by OCICollSize() will
3459 NOT be decremented upon deleting elements. For example:
3462 // assume 'size' returned is equal to 5
3463 OCITableDelete(...); // delete one element
3465 // 'size' returned will still be 5
3467 To get the count minus the deleted elements use OCITableSize().
3468 Continuing the above example,
3471 // 'size' returned will be equal to 4
3473 Note, a trim operation (OCICollTrim) will decrement the count
3474 by the number of trimmed elements. Continuing the above example,
3476 OCICollTrim(..,1..); // trim one element
3478 // 'size' returned will be equal to 4
3480 OCI_SUCCESS if the function completes successfully.
3481 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3483 error during loading of collection into object cache
3484 any of the input parameters is null
3487 /*------------------------------ OCICollMax ---------------------------------*/
3489 sb4 OCICollMax( OCIEnv *env, const OCIColl *coll );
3491 NAME: OCICollMax - OCIColl return MAXimum size (upper-bound) of the
3492 given collection (in number of elements)
3494 env(IN) - pointer to OCI environment handle
3495 coll (IN) - collection whose upper-bound in number of elements
3498 Returns the max number of elements that the given collection can hold.
3499 A value 0 indicates that the collection has no upper-bound.
3501 coll must point to a valid collection descriptor
3503 upper-bound of the given collection
3506 /*-------------------------- OCICollGetElem ---------------------------------*/
3508 sword OCICollGetElem( OCIEnv *env, OCIError *err, const OCIColl *coll,
3509 sb4 index, boolean *exists, void **elem,
3512 NAME: OCICollGetElem - OCIColl GET pointer to the element at the given index
3514 env (IN/OUT) - OCI environment handle initialized in object mode.
3515 err (IN/OUT) - error handle. If there is an error, it is
3516 recorded in 'err' and this function returns OCI_ERROR.
3517 The error recorded in 'err' can be retrieved by calling
3519 coll (IN) - pointer to the element in this collection is returned
3520 index (IN) - index of the element whose pointer is returned
3521 exists (OUT) - set to FALSE if element at the specified index does
3523 elem (OUT) - address of the desired element is returned
3524 elemind (OUT) [optional] - address of the null indicator information
3525 is returned; if (elemind == NULL) then the null indicator
3526 information will NOT be returned
3528 Get the address of the element at the given position. Optionally
3529 this function also returns the address of the element's null indicator
3532 The following table describes for each collection element type
3533 what the corresponding element pointer type is. The element pointer
3534 is returned via the 'elem' parameter of OCICollGetElem().
3536 Element Type *elem is set to
3537 ----------------------- ---------------
3538 Oracle Number (OCINumber) OCINumber*
3539 Date (OCIDate) OCIDate*
3540 Variable-length string (OCIString* ) OCIString**
3541 Variable-length raw (OCIRaw* ) OCIRaw**
3542 object reference (OCIRef* ) OCIRef**
3543 lob locator (OCILobLocator* ) OCILobLocator**
3544 object type (e.g. person) person*
3546 The element pointer returned by OCICollGetElem() is in a form
3547 such that it can not only be used to access the
3548 element data but also is in a form that can be used as the target
3549 (i.e left-hand-side) of an assignment statement.
3551 For example, assume the user is iterating over the elements of
3552 a collection whose element type is object reference (OCIRef* ). A call
3553 to OCICollGetElem() returns pointer to a reference handle
3554 (i.e. OCIRef** ). After getting, the pointer to the collection
3555 element, the user may wish to modify it by assigning a new reference.
3556 This can be accomplished via the ref assignment function shown below:
3558 sword OCIRefAssign( OCIEnv *env, OCIError *err, const OCIRef *source,
3561 Note that the 'target' parameter of OCIRefAssign() is of type
3562 'OCIRef**'. Hence OCICollGetElem() returns 'OCIRef**'.
3563 If '*target == NULL' a new ref will be allocated by OCIRefAssign()
3564 and returned via the 'target' parameter.
3566 Similarly, if the collection element was of type string (OCIString* ),
3567 OCICollGetElem() returns pointer to string handle
3568 (i.e. OCIString** ). If a new string is assigned, via
3569 OCIStringAssign() or OCIStringAssignText() the type of the target
3570 must be 'OCIString **'.
3572 If the collection element is of type Oracle number, OCICollGetElem()
3573 returns OCINumber*. The prototype of OCINumberAssign() is shown below:
3575 sword OCINumberAssign(OCIError *err, const OCINumber *from,
3578 OCI_SUCCESS if the function completes successfully.
3579 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3581 any of the input parameters is null
3584 /*------------------------- OCICollGetElemArray -----------------------------*/
3586 sword OCICollGetElemArray( OCIEnv *env, OCIError *err, const OCIColl *coll,
3587 sb4 index, boolean *exists, void **elem,
3588 void **elemind, uword *nelems);
3590 NAME: OCICollGetElemArray - OCIColl GET pointers to elements from given index
3592 env (IN/OUT) - OCI environment handle initialized in object mode.
3593 err (IN/OUT) - error handle. If there is an error, it is
3594 recorded in 'err' and this function returns OCI_ERROR.
3595 The error recorded in 'err' can be retrieved by calling
3597 coll (IN) - pointers to the elements in this collection is returned
3598 index (IN) - starting index of the element
3599 exists (OUT) - set to FALSE if element at the specified index does
3601 elem (OUT) - address of the desired elements is returned
3602 elemind (OUT) [optional] - address of the null indicators information
3603 is returned; if (elemind == NULL) then the null indicator
3604 information will NOT be returned
3605 nelems(IN/OUT) - Upper bound of elem and/or elemind array
3607 Get the address of the elements from the given position. Optionally
3608 this function also returns the address of the element's null indicator
3611 The following table describes for each collection element type
3612 what the corresponding element pointer type is. The element pointer
3613 is returned via the 'elem' parameter of OCICollGetElem().
3615 Element Type *elem is set to
3616 ----------------------- ---------------
3617 Oracle Number (OCINumber) OCINumber*
3618 Date (OCIDate) OCIDate*
3619 Variable-length string (OCIString* ) OCIString**
3620 Variable-length raw (OCIRaw* ) OCIRaw**
3621 object reference (OCIRef* ) OCIRef**
3622 lob locator (OCILobLocator* ) OCILobLocator**
3623 object type (e.g. person) person*
3625 The element pointer returned by OCICollGetElem() is in a form
3626 such that it can not only be used to access the
3627 element data but also is in a form that can be used as the target
3628 (i.e left-hand-side) of an assignment statement.
3630 For example, assume the user is iterating over the elements of
3631 a collection whose element type is object reference (OCIRef* ). A call
3632 to OCICollGetElem() returns pointer to a reference handle
3633 (i.e. OCIRef** ). After getting, the pointer to the collection
3634 element, the user may wish to modify it by assigning a new reference.
3635 This can be accomplished via the ref assignment function shown below:
3637 sword OCIRefAssign( OCIEnv *env, OCIError *err, const OCIRef *source,
3640 Note that the 'target' parameter of OCIRefAssign() is of type
3641 'OCIRef**'. Hence OCICollGetElem() returns 'OCIRef**'.
3642 If '*target == NULL' a new ref will be allocated by OCIRefAssign()
3643 and returned via the 'target' parameter.
3645 Similarly, if the collection element was of type string (OCIString* ),
3646 OCICollGetElem() returns pointer to string handle
3647 (i.e. OCIString** ). If a new string is assigned, via
3648 OCIStringAssign() or OCIStringAssignText() the type of the target
3649 must be 'OCIString **'.
3651 If the collection element is of type Oracle number, OCICollGetElem()
3652 returns OCINumber*. The prototype of OCINumberAssign() is shown below:
3654 sword OCINumberAssign(OCIError *err, const OCINumber *from,
3657 OCI_SUCCESS if the function completes successfully.
3658 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3660 any of the input parameters is null
3663 /*----------------------- OCICollAssignElem ---------------------------------*/
3665 sword OCICollAssignElem( OCIEnv *env, OCIError *err, sb4 index,
3667 const void *elemind, OCIColl *coll );
3669 NAME: OCICollAssignElem - OCIColl ASsign Element
3671 env (IN/OUT) - OCI environment handle initialized in object mode.
3672 err (IN/OUT) - error handle. If there is an error, it is
3673 recorded in 'err' and this function returns OCI_ERROR.
3674 The error recorded in 'err' can be retrieved by calling
3676 index (IN) - index of the element whose is assigned to
3677 elem (IN) - element which is assigned from (source element)
3678 elemind (IN) [optional] - pointer to the element's null indicator
3679 information; if (elemind == NULL) then the null indicator
3680 information of the assigned element will be set to non-null.
3681 coll (IN/OUT) - collection to be updated
3683 Assign the given element value 'elem' to the element at coll[index].
3684 If the collection is of type nested table, the element at the given
3685 index may not exist (i.e. may have been deleted). In this case, the
3686 given element is inserted at index 'index'.
3687 Otherwise, the element at index 'index' is updated with the value
3690 Note that the given element is deep-copied and
3691 'elem' is strictly an input parameter.
3693 OCI_SUCCESS if the function completes successfully.
3694 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3696 any of the input parameters is null
3698 given index is out of bounds of the given collection
3701 /*--------------------------- OCICollAssign ---------------------------------*/
3703 sword OCICollAssign( OCIEnv *env, OCIError *err, const OCIColl *rhs,
3706 NAME: OCICollAssign - OCIColl ASsiGn collection
3708 env (IN/OUT) - OCI environment handle initialized in object mode.
3709 err (IN/OUT) - error handle. If there is an error, it is
3710 recorded in 'err' and this function returns OCI_ERROR.
3711 The error recorded in 'err' can be retrieved by calling
3713 rhs (IN) - collection to be assigned from
3714 lhs (OUT) - collection to be assigned to
3716 Assign 'rhs' to 'lhs'. The 'lhs' collection may be decreased or
3717 increased depending upon the size of 'rhs'. If the 'lhs' contains
3718 any elements then the elements will be deleted prior to the
3719 assignment. This function performs a deep-copy. The memory for the
3720 elements comes from the object cache.
3722 An error is returned if the element types of the lhs and rhs
3723 collections do not match. Also, an error is returned if the
3724 upper-bound of the lhs collection is less than the current number of
3725 elements in the rhs collection.
3727 OCI_SUCCESS if the function completes successfully.
3728 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3730 any of the input parameters is null
3732 type mis-match of lhs and rhs collections
3733 upper-bound of lhs collection is less than the current number of
3734 elements in the rhs collection
3737 /*--------------------------- OCICollAppend ---------------------------------*/
3739 sword OCICollAppend( OCIEnv *env, OCIError *err, const void *elem,
3740 const void *elemind, OCIColl *coll );
3742 NAME: OCICollAppend - OCIColl APPend collection
3744 env (IN/OUT) - OCI environment handle initialized in object mode.
3745 err (IN/OUT) - error handle. If there is an error, it is
3746 recorded in 'err' and this function returns OCI_ERROR.
3747 The error recorded in 'err' can be retrieved by calling
3749 elem (IN) - pointer to the element which is appended to the end
3750 of the given collection
3751 elemind (IN) [optional] - pointer to the element's null indicator
3752 information; if (elemind == NULL) then the null indicator
3753 information of the appended element will be set to non-null.
3754 coll (IN/OUT) - updated collection
3756 Append the given element to the end of the given collection.
3757 Appending an element is equivalent to:
3758 - increasing the size of the collection by 1 element
3759 - updating (deep-copying) the last element's data with the given
3762 Note that the pointer to the given element 'elem' will not be saved
3763 by this function. So 'elem' is strictly an input parameter.
3764 An error is returned if the current size of the collection
3765 is equal to the max size (upper-bound) of the collection prior to
3766 appending the element.
3768 OCI_SUCCESS if the function completes successfully.
3769 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3771 any of the input parameters is null
3773 current size of collection == max size of the collection
3776 /*----------------------------- OCICollTrim ---------------------------------*/
3778 sword OCICollTrim( OCIEnv *env, OCIError *err, sb4 trim_num,
3781 NAME: OCICollTrim - OCIColl Trim elements from the end of the collection
3783 env (IN/OUT) - OCI environment handle initialized in object mode.
3784 err (IN/OUT) - error handle. If there is an error, it is
3785 recorded in 'err' and this function returns OCI_ERROR.
3786 The error recorded in 'err' can be retrieved by calling
3788 trim_num (IN) - number of elements to trim
3789 coll (IN/OUT) - 'trim_num' of elements are removed (freed) from the
3790 end of the collection
3792 Trim the collection by the given number of elements. The elements are
3793 removed from the end of the collection.
3795 An error is returned if the 'trim_num' is greater than the current
3796 size of the collection.
3798 OCI_SUCCESS if the function completes successfully.
3799 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3801 any of the input parameters is null
3802 'trim_num' is greater than the current size of the collection.
3805 /*--------------------------- OCICollIsLocator ------------------------------*/
3807 sword OCICollIsLocator(OCIEnv *env, OCIError *err, const OCIColl *coll,
3810 Name: OCICollIsLocator - OCIColl indicates whether a collection is locator
3813 env(IN) - pointer to OCI environment handle
3814 err (IN/OUT) - error handle. If there is an error, it is
3815 recorded in 'err' and this function returns OCI_ERROR.
3816 The error recorded in 'err' can be retrieved by calling
3818 coll (IN) - collection item.
3819 result (OUT) - TRUE if the collection item is a locator, FALSE
3822 Returns TRUE in the result OUT parameter if the collection item is a
3823 locator, otherwise returns FALSE.
3825 OCI_SUCCESS if the function completes successfully.
3826 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3829 /*---------------------------- OCIIterCreate --------------------------------*/
3831 sword OCIIterCreate( OCIEnv *env, OCIError *err, const OCIColl *coll,
3834 NAME: OCIIterCreate - OCIColl Create an ITerator to scan the collection
3837 env (IN/OUT) - OCI environment handle initialized in object mode.
3838 err (IN/OUT) - error handle. If there is an error, it is
3839 recorded in 'err' and this function returns OCI_ERROR.
3840 The error recorded in 'err' can be retrieved by calling
3842 coll (IN) - collection which will be scanned; the different
3843 collection types are varray and nested table
3844 itr (OUT) - address to the allocated collection iterator is
3845 returned by this function
3847 Create an iterator to scan the elements of the collection. The
3848 iterator is created in the object cache. The iterator is initialized
3849 to point to the beginning of the collection.
3851 If the next function (OCIIterNext) is called immediately
3852 after creating the iterator then the first element of the collection
3854 If the previous function (OCIIterPrev) is called immediately after
3855 creating the iterator then "at beginning of collection" error is
3858 OCI_SUCCESS if the function completes successfully.
3859 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3861 any of the input parameters is null
3865 /*----------------------------- OCIIterDelete ------------------------------*/
3867 sword OCIIterDelete( OCIEnv *env, OCIError *err, OCIIter **itr );
3869 NAME: OCIIterDelete - OCIColl Delete ITerator
3871 env (IN/OUT) - OCI environment handle initialized in object mode.
3872 err (IN/OUT) - error handle. If there is an error, it is
3873 recorded in 'err' and this function returns OCI_ERROR.
3874 The error recorded in 'err' can be retrieved by calling
3876 itr (IN/OUT) - the allocated collection iterator is destroyed and
3877 the 'itr' is set to NULL prior to returning
3879 Delete the iterator which was previously created by a call to
3882 OCI_SUCCESS if the function completes successfully.
3883 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3885 any of the input parameters is null
3889 /*----------------------------- OCIIterInit ---------------------------------*/
3891 sword OCIIterInit( OCIEnv *env, OCIError *err, const OCIColl *coll,
3894 NAME: OCIIterInit - OCIColl Initialize ITerator to scan the given
3897 env (IN/OUT) - OCI environment handle initialized in object mode.
3898 err (IN/OUT) - error handle. If there is an error, it is
3899 recorded in 'err' and this function returns OCI_ERROR.
3900 The error recorded in 'err' can be retrieved by calling
3902 coll (IN) - collection which will be scanned; the different
3903 collection types are varray and nested table
3904 itr (IN/OUT) - pointer to an allocated collection iterator
3906 Initializes the given iterator to point to the beginning of the
3907 given collection. This function can be used to:
3909 a. reset an iterator to point back to the beginning of the collection
3910 b. reuse an allocated iterator to scan a different collection
3912 OCI_SUCCESS if the function completes successfully.
3913 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3915 any of the input parameters is null
3918 (*------------------------ OCIIterGetCurrent --------------------------------*)
3920 TOCIIterGetCurrent = function(hndl: POCIEnv; err: POCIError; itr: POCIIter;
3921 elem: PPointer; elemind: PPointer): sword; cdecl;
3923 NAME: OCIIterGetCurrent - OCIColl Iterator based, get CURrent collection
3926 env (IN/OUT) - OCI environment handle initialized in object mode.
3927 err (IN/OUT) - error handle. If there is an error, it is
3928 recorded in 'err' and this function returns OCI_ERROR.
3929 The error recorded in 'err' can be retrieved by calling
3931 itr (IN) - iterator which points to the current element
3932 elem (OUT) - address of the element pointed by the iterator is returned
3933 elemind (OUT) [optional] - address of the element's null indicator
3934 information is returned; if (elemind == NULL) then the null
3935 indicator information will NOT be returned
3937 Returns pointer to the current element and its corresponding null
3940 OCI_SUCCESS if the function completes successfully.
3941 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3943 any of the input parameters is null
3946 (*------------------------------ OCIIterNext --------------------------------*)
3948 TOCIIterNext = function(hndl: POCIEnv; err: POCIError; itr: POCIIter;
3949 elem: PPointer; elemind: PPointer; eoc: PBoolean): sword; cdecl;
3951 NAME: OCIIterNext - OCIColl Iterator based, get NeXT collection element
3953 env (IN/OUT) - OCI environment handle initialized in object mode.
3954 err (IN/OUT) - error handle. If there is an error, it is
3955 recorded in 'err' and this function returns OCI_ERROR.
3956 The error recorded in 'err' can be retrieved by calling
3958 itr (IN/OUT) - iterator is updated to point to the next element
3959 elem (OUT) - after updating the iterator to point to the next element,
3960 address of the element is returned
3961 elemind (OUT) [optional] - address of the element's null indicator
3962 information is returned; if (elemind == NULL) then the null
3963 indicator information will NOT be returned
3964 eoc (OUT) - TRUE if iterator is at End Of Collection (i.e. next
3965 element does not exist) else FALSE
3967 Returns pointer to the next element and its corresponding null
3968 information. The iterator is updated to point to the next element.
3970 If the iterator is pointing to the last element of the collection
3971 prior to executing this function, then calling this function will
3972 set eoc flag to TRUE. The iterator will be left unchanged in this
3975 OCI_SUCCESS if the function completes successfully.
3976 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
3978 any of the input parameters is null
3981 (*------------------------------ OCIIterPrev --------------------------------*)
3983 TOCIIterPrev = function(hndl: POCIEnv; err: POCIError; itr: POCIIter;
3984 elem: PPointer; elemind: PPointer; boc: PBoolean): sword; cdecl;
3986 NAME: OCIIterPrev - OCIColl Iterator based, get PReVious collection element
3988 env (IN/OUT) - OCI environment handle initialized in object mode.
3989 err (IN/OUT) - error handle. If there is an error, it is
3990 recorded in 'err' and this function returns OCI_ERROR.
3991 The error recorded in 'err' can be retrieved by calling
3993 itr (IN/OUT) - iterator is updated to point to the previous
3995 elem (OUT) - after updating the iterator to point to the previous
3996 element, address of the element is returned
3997 elemind (OUT) [optional] - address of the element's null indicator
3998 information is returned; if (elemind == NULL) then the null
3999 indicator information will NOT be returned
4000 boc (OUT) - TRUE if iterator is at Beginning Of Collection (i.e.
4001 previous element does not exist) else FALSE.
4003 Returns pointer to the previous element and its corresponding null
4004 information. The iterator is updated to point to the previous element.
4006 If the iterator is pointing to the first element of the collection
4007 prior to executing this function, then calling this function will
4008 set 'boc' to TRUE. The iterator will be left unchanged in this
4011 OCI_SUCCESS if the function completes successfully.
4012 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
4014 any of the input parameters is null
4016 (*****************************************************************************
4017 * FUNCTIONS WHICH OPERATE ONLY ON NESTED TABLE OCITable*() *
4018 *****************************************************************************
4020 *---------------------------- OCITableSize ---------------------------------*)
4022 TOCITableSize = function(hndl: POCIEnv; err: POCIError; const tbl: POCITable;
4023 size: psb4): sword; cdecl;
4025 NAME: OCITableSize - OCITable return current SIZe of the given
4026 nested table (not including deleted elements)
4028 env(IN) - pointer to OCI environment handle
4029 err (IN/OUT) - error handle. If there is an error, it is
4030 recorded in 'err' and this function returns OCI_ERROR.
4031 The error recorded in 'err' can be retrieved by calling
4033 tbl (IN) - nested table whose number of elements is returned
4034 size (OUT) - current number of elements in the nested table. The count
4035 does not include deleted elements.
4037 Returns the count of elements in the given nested table.
4039 The count returned by OCITableSize() will be decremented upon
4040 deleting elements from the nested table. So, this count DOES NOT
4041 includes any "holes" created by deleting elements.
4045 // assume 'size' returned is equal to 5
4046 OCITableDelete(...); // delete one element
4048 // 'size' returned will be equal to 4
4050 To get the count plus the count of deleted elements use
4051 OCICollSize(). Continuing the above example,
4054 // 'size' returned will still be equal to 5
4056 OCI_SUCCESS if the function completes successfully.
4057 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
4059 error during loading of nested table into object cache
4060 any of the input parameters is null
4063 (*---------------------- OCITableExists ---------------------------------*)
4065 TOCITableExists = function(hndl: POCIEnv; err: POCIError; const tbl: POCITable;
4066 index: sb4; exists: PBoolean): sword; cdecl;
4068 NAME: OCITableExists - OCITable test whether element at the given index
4071 env (IN/OUT) - OCI environment handle initialized in object mode.
4072 err (IN/OUT) - error handle. If there is an error, it is
4073 recorded in 'err' and this function returns OCI_ERROR.
4074 The error recorded in 'err' can be retrieved by calling
4076 tbl (IN) - table in which the given index is checked
4077 index (IN) - index of the element which is checked for existence
4078 exists (OUT) - set to TRUE if element at given 'index' exists
4081 Test whether an element exists at the given 'index'.
4083 OCI_SUCCESS if the function completes successfully.
4084 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
4086 any of the input parameters is null
4089 (*--------------------------- OCITableDelete -------------------------------*)
4091 TOCITableDelete = function(hndl: POCIEnv; err: POCIError; index: sb4;
4092 tbl: POCITable): sword; cdecl;
4094 NAME: OCITableDelete - OCITable DELete element at the specified index
4096 env (IN/OUT) - OCI environment handle initialized in object mode.
4097 err (IN/OUT) - error handle. If there is an error, it is
4098 recorded in 'err' and this function returns OCI_ERROR.
4099 The error recorded in 'err' can be retrieved by calling
4101 index (IN) - index of the element which must be deleted
4102 tbl (IN) - table whose element is deleted
4104 Delete the element at the given 'index'. Note that the position
4105 ordinals of the remaining elements of the table is not changed by the
4106 delete operation. So delete creates "holes" in the table.
4108 An error is returned if the element at the specified 'index' has
4109 been previously deleted.
4111 OCI_SUCCESS if the function completes successfully.
4112 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
4114 any of the input parameters is null
4115 given index is not valid
4118 (*--------------------------- OCITableFirst ---------------------------------*)
4120 TOCITableFirst = function(hndl: POCIEnv; err: POCIError; const tbl: POCITable;
4121 index: sb4): sword; cdecl;
4123 NAME: OCITableFirst - OCITable return FirST index of table
4125 env (IN/OUT) - OCI environment handle initialized in object mode.
4126 err (IN/OUT) - error handle. If there is an error, it is
4127 recorded in 'err' and this function returns OCI_ERROR.
4128 The error recorded in 'err' can be retrieved by calling
4130 tbl (IN) - table which is scanned
4131 index (OUT) - first index of the element which exists in the given
4134 Return the first index of the element which exists in the given
4137 OCI_SUCCESS if the function completes successfully.
4138 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
4143 (*---------------------------- OCITableLast ---------------------------------*)
4145 TOCITableLast = function(hndl: POCIEnv; err: POCIError; const tbl: POCITable;
4146 index: sb4): sword; cdecl;
4148 NAME: OCITableFirst - OCITable return LaST index of table
4150 env (IN/OUT) - OCI environment handle initialized in object mode.
4151 err (IN/OUT) - error handle. If there is an error, it is
4152 recorded in 'err' and this function returns OCI_ERROR.
4153 The error recorded in 'err' can be retrieved by calling
4155 tbl (IN) - table which is scanned
4156 index (OUT) - last index of the element which exists in the given
4159 Return the last index of the element which exists in the given
4162 OCI_SUCCESS if the function completes successfully.
4163 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
4168 (*---------------------------- OCITableNext ---------------------------------*)
4170 TOCITableNext = function(hndl: POCIEnv; err: POCIError; index: sb4;
4171 const tbl: POCITable; next_index: psb4;
4172 exists: PBoolean): sword; cdecl;
4174 NAME: OCITableNext - OCITable return NeXT available index of table
4176 env (IN/OUT) - OCI environment handle initialized in object mode.
4177 err (IN/OUT) - error handle. If there is an error, it is
4178 recorded in 'err' and this function returns OCI_ERROR.
4179 The error recorded in 'err' can be retrieved by calling
4181 index (IN) - starting at 'index' the index of the next element
4182 which exists is returned
4183 tbl (IN) - table which is scanned
4184 next_index (OUT) - index of the next element which exists
4186 exists (OUT) - FALSE if no next index available else TRUE
4188 Return the smallest position j, greater than 'index', such that
4191 OCI_SUCCESS if the function completes successfully.
4192 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
4194 no next index available
4197 /*---------------------------- OCITablePrev ---------------------------------*)
4199 TOCITablePrev = function(hndl: POCIEnv; err: POCIError; index: sb4;
4200 const tbl: POCITable; prev_index: psb4;
4201 exists: PBoolean): sword; cdecl;
4203 NAME: OCITablePrev - OCITable return PReVious available index of table
4205 env (IN/OUT) - OCI environment handle initialized in object mode.
4206 err (IN/OUT) - error handle. If there is an error, it is
4207 recorded in 'err' and this function returns OCI_ERROR.
4208 The error recorded in 'err' can be retrieved by calling
4210 index (IN) - starting at 'index' the index of the previous element
4211 which exists is returned
4212 tbl (IN) - table which is scanned
4213 prev_index (OUT) - index of the previous element which exists
4215 exists (OUT) - FALSE if no next index available else TRUE
4217 Return the largest position j, less than 'index', such that
4220 OCI_SUCCESS if the function completes successfully.
4221 OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
4223 no previous index available
4226 (*--------------------------------orciap.h-----------------------------------*
4228 (*-------------------------------- OCIPing ----------------------------------*)
4229 TOCIPing = function(svchp: POCISvcCtx; errhp: POCIError; mode: ub4): sword; cdecl;
4230 (*---------------------------------orid.h------------------------------------*
4231 * PUBLIC FUNCTIONS *
4232 *---------------------------------------------------------------------------*)
4234 (*-------------------------- OCIObjectSetAttr ----------------------------*)
4235 TOCIObjectSetAttr = function(env: POCIEnv; err: POCIError; instance: Pointer;
4236 null_struct: pointer; tdo: POCIType; const names: PPAnsiChar;
4237 const lengths: pub4; const name_count: ub4;
4238 const indexes: pub4; const index_count: ub4;
4239 const null_status: POCIInd; const attr_null_struct: Pointer;
4240 const attr_value: Pointer): sword; cdecl;
4242 NAME: OCIObjectSetAttr - ORID SET value
4244 env (IN) - OCI environment handle initialized in object mode
4245 err (IN) - error handle. If there is an error, it is
4246 recorded in 'err' and this function returns OCI_ERROR.
4247 The error recorded in 'err' can be retrieved by calling
4249 instance (IN) - pointer to an ADT instance
4250 null_struct (IN) - the null structure of the ADT instance or array
4251 tdo (IN) - pointer to the TDO
4252 names (IN) - array of attribute names. This is used to specify
4253 the names of the attributes in the path expression.
4254 lengths (IN) - array of lengths of attribute names.
4255 name_count (IN) - number of element in the array 'names'.
4256 indexes (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4 * )0.
4257 index_count (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4)0.
4258 attr_null_status (IN) - the null status of the attribute if the type of
4259 attribute is primitive.
4260 attr_null_struct (IN) - the null structure of an ADT or collection
4262 attr_value (IN) - pointer to the attribute value.
4265 This function set the attribute of the given object with the given
4266 value. The position of the attribute is specified as a path
4267 expression which is an array of names and an array of indexes.
4271 For path expression stanford.cs.stu[5].addr, the arrays will look like
4272 names = {"stanford", "cs", "stu", "addr"}
4273 lengths = {8, 2, 3, 4}
4276 Also see the above example.
4279 (*-------------------------- OCIObjectGetAttr ----------------------------*)
4280 TOCIObjectGetAttr = function(env: POCIEnv; err: POCIError; instance: Pointer;
4281 null_struct: Pointer; tdo: POCIType;
4282 const names: PPoratext; const lengths: pub4;
4283 const name_count: ub4; const indexes: pub4;
4284 const index_count: ub4; attr_null_status: PPOCIInd;
4285 attr_null_struct, attr_value: PPointer;
4286 attr_tdo: PPOCIType): sword; cdecl;
4288 NAME: OCIObjectGetAttr - ORID GET value
4290 env (IN) - OCI environment handle initialized in object mode
4291 err (IN) - error handle. If there is an error, it is
4292 recorded in 'err' and this function returns OCI_ERROR.
4293 The error recorded in 'err' can be retrieved by calling
4295 instance (IN) - pointer to an ADT instance
4296 null_struct (IN) - the null structure of the ADT instance or array
4297 tdo (IN) - pointer to the TDO
4298 names (IN) - array of attribute names. This is used to specify
4299 the names of the attributes in the path expression.
4300 lengths (IN) - array of lengths of attribute names.
4301 name_count (IN) - number of element in the array 'names'.
4302 indexes (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4 * )0.
4303 index_count (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4)0.
4304 attr_null_status (OUT) - the null status of the attribute if the type
4305 of attribute is primitive.
4306 attr_null_struct (OUT) - the null structure of an ADT or collection
4308 attr_value (OUT) - pointer to the attribute value.
4309 attr_tdo (OUT) - pointer to the TDO of the attribute.
4311 - a valid OCI environment handle must be given.
4313 This function gets a value from an ADT instance or from an array.
4314 If the parameter 'instance' points to an ADT instance, then the path
4315 expression specifies the location of the attribute in the ADT.
4316 It is assumed that the object is pinned and that the value returned
4317 is valid until the object is unpinned.
4321 See example in OCIObjectSetAttr(). Also see the above example.
4324 {--------------------------------ori.h-------------------------------------- }
4325 { PUBLIC TYPES AND CONSTANTS }
4326 {--------------------------------------------------------------------------- }
4328 {--------------------------------------------------------------------------- }
4329 { PUBLIC FUNCTIONS }
4330 {--------------------------------------------------------------------------- }
4331 {--------------------------------------------------------------------------- }
4332 { OBJECT/INSTANCE OPERATIONS }
4333 {--------------------------------------------------------------------------- }
4334 {--------------------------- OCIObjectNew ---------------------------------- }
4336 TOCIObjectNew = function(env: POCIEnv; err: POCIError; const svc: POCISvcCtx;
4337 const typecode: OCITypeCode; const tdo: POCIType; const table: Pointer;
4338 const duration: OCIDuration; const value: boolean;
4339 instance: PPointer): sword; cdecl;
4341 NAME: OCIObjectNew - OCI new (create) a standalone instance
4343 env (IN/OUT) - OCI environment handle initialized in object mode
4344 err (IN/OUT) - error handle. If there is an error, it is
4345 recorded in 'err' and this function returns OCI_ERROR.
4346 The error recorded in 'err' can be retrieved by calling
4348 svc (IN) - OCI service handle.
4349 typecode (IN) - the typecode of the type of the instance.
4350 tdo (IN, optional) - pointer to the type descriptor object. The
4351 TDO describes the type of the instance that is to be
4352 created. Refer to OCITypeByName() for obtaining a TDO.
4353 The TDO is required for creating a named type (e.g. an
4354 object or a collection).
4355 table (IN, optional) - pointer to a table object which specifies a
4356 table in the server. This parameter can be set to NULL
4357 if no table is given. See the description below to find
4358 out how the table object and the TDO are used together
4359 to determine the kind of instances (persistent,
4360 transient, value) to be created. Also see
4361 OCIObjectPinTable() for retrieving a table object.
4362 duration (IN) - this is an overloaded parameter. The use of this
4363 parameter is based on the kind of the instance that is
4365 a) persistent object. This parameter specifies the
4367 b) transient object. This parameter specififes the
4368 allocation duration and pin duration.
4369 c) value. This parameter specifies the allocation
4371 value (IN) - specifies whether the created object is a value.
4372 If TRUE, then a value is created. Otherwise, a
4373 referenceable object is created. If the instance is
4374 not an object, then this parameter is ignored.
4375 instance (OUT) - address of the newly created instance
4378 - a valid OCI environment handle must be given.
4380 This function creates a new instance of the type specified by the
4381 typecode or the TDO. Based on the parameters 'typecode' (or 'tdo'),
4382 'value' and 'table', different kinds of instances can be created:
4384 The parameter 'table' is not NULL?
4387 ----------------------------------------------------------------
4388 | object type (value=TRUE) | value | value |
4389 ----------------------------------------------------------------
4390 | object type (value=FALSE) | persistent obj | transient obj |
4391 type ----------------------------------------------------------------
4392 | built-in type | value | value |
4393 ----------------------------------------------------------------
4394 | collection type | value | value |
4395 ----------------------------------------------------------------
4397 This function allocates the top level memory chunk of an OTS instance.
4398 The attributes in the top level memory are initialized (e.g. an
4399 attribute of varchar2 is initialized to a vstring of 0 length).
4401 If the instance is an object, the object is marked existed but is
4404 FOR PERSISTENT OBJECTS:
4405 The object is marked dirty and existed. The allocation duration for
4406 the object is session. The object is pinned and the pin duration is
4407 specified by the given parameter 'duration'.
4409 FOR TRANSIENT OBJECTS:
4410 The object is pinned. The allocation duration and the pin duration are
4411 specified by the given parameter 'duration'.
4414 The allocation duration is specified by the given parameter 'duration'.
4417 if environment handle or error handle is null, return
4419 if operation suceeds, return OCI_SUCCESS.
4420 if operation fails, return OCI_ERROR.
4422 {--------------------------- OCIObjectPin ---------------------------------- }
4423 POCIComplexObject = Pointer;
4424 PPOCIComplexObject = ^POCIComplexObject;
4428 TOCIObjectPin = function(env: POCIEnv; err: POCIError;
4429 const object_ref: POCIRef; const corhdl: POCIComplexObject;
4430 const pin_option: OCIPinOpt; const pin_duration: OCIDuration;
4431 const lock_option: OCILockOpt; _object: PPointer): sword; cdecl;
4433 NAME: OCIObjectPin - OCI pin a referenceable object
4435 env (IN/OUT) - OCI environment handle initialized in object mode
4436 err (IN/OUT) - error handle. If there is an error, it is
4437 recorded in 'err' and this function returns
4438 OCI_ERROR. The error recorded in 'err' can be
4439 retrieved by calling OCIErrorGet().
4440 object_ref (IN) - the reference to the object.
4441 corhdl (IN) - handle for complex object retrieval.
4442 pin_option (IN) - See description below.
4443 pin_duration (IN) - The duration of which the object is being accesed
4444 by a client. The object is implicitly unpinned at
4445 the end of the pin duration.
4446 If OCI_DURATION_NULL is passed, there is no pin
4447 promotion if the object is already loaded into
4448 the cache. If the object is not yet loaded, then
4449 the pin duration is set to OCI_DURATION_DEFAULT.
4450 lock_option (IN) - lock option (e.g., exclusive). If a lock option
4451 is specified, the object is locked in the server.
4452 See 'oro.h' for description about lock option.
4453 object (OUT) - the pointer to the pinned object.
4456 - a valid OCI environment handle must be given.
4459 This function pins a referenceable object instance given the object
4460 reference. The process of pinning serves three purposes:
4462 1) locate an object given its reference. This is done by the object
4463 cache which keeps track of the objects in the object heap.
4465 2) notify the object cache that an object is being in use. An object
4466 can be pinned many times. A pinned object will remain in memory
4467 until it is completely unpinned (see OCIObjectUnpin()).
4469 3) notify the object cache that a persistent object is being in use
4470 such that the persistent object cannot be aged out. Since a
4471 persistent object can be loaded from the server whenever is needed,
4472 the memory utilization can be increased if a completely unpinned
4473 persistent object can be freed (aged out), even before the
4474 allocation duration is expired.
4476 Also see OCIObjectUnpin() for more information about unpinning.
4478 FOR PERSISTENT OBJECTS:
4480 When pinning a persistent object, if it is not in the cache, the object
4481 will be fetched from the persistent store. The allocation duration of
4482 the object is session. If the object is already in the cache, it is
4483 returned to the client. The object will be locked in the server if a
4484 lock option is specified.
4486 This function will return an error for a non-existent object.
4488 A pin option is used to specify the copy of the object that is to be
4491 1) If option is OCI_PIN_ANY (pin any), if the object is already
4492 in the environment heap, return this object. Otherwise, the object
4493 is retrieved from the database. This option is useful when the
4494 client knows that he has the exclusive access to the data in a
4497 2) If option is OCI_PIN_LATEST (pin latest), if the object is
4498 not cached, it is retrieved from the database. If the object is
4499 cached, it is refreshed with the latest version. See
4500 OCIObjectRefresh() for more information about refreshing.
4502 3) If option is OCI_PIN_RECENT (pin recent), if the object is loaded
4503 into the cache in the current transaction, the object is returned.
4504 If the object is not loaded in the current transaction, the object
4505 is refreshed from the server.
4507 FOR TRANSIENT OBJECTS:
4509 This function will return an error if the transient object has already
4510 been freed. This function does not return an error if an exclusive
4511 lock is specified in the lock option.
4514 if environment handle or error handle is null, return
4516 if operation suceeds, return OCI_SUCCESS.
4517 if operation fails, return OCI_ERROR.
4519 {------------------------------ OCIObjectUnpin ----------------------------- }
4520 TOCIObjectUnpin = function(env: POCIEnv; err: POCIError;
4521 const _object: Pointer): sword; cdecl;
4523 NAME: OCIObjectUnpin - OCI unpin a referenceable object
4525 env (IN/OUT) - OCI environment handle initialized in object mode
4526 err (IN/OUT) - error handle. If there is an error, it is
4527 recorded in 'err' and this function returns OCI_ERROR.
4528 The error recorded in 'err' can be retrieved by
4529 calling OCIErrorGet().
4530 object (IN) - pointer to an object
4532 - a valid OCI environment handle must be given.
4533 - The specified object must be pinned.
4535 This function unpins an object. An object is completely unpinned when
4536 1) the object was unpinned N times after it has been pinned N times
4537 (by calling OCIObjectPin()).
4538 2) it is the end of the pin duration
4539 3) the function OCIObjectPinCountReset() is called
4541 There is a pin count associated with each object which is incremented
4542 whenever an object is pinned. When the pin count of the object is zero,
4543 the object is said to be completely unpinned. An unpinned object can
4544 be freed without error.
4546 FOR PERSISTENT OBJECTS:
4547 When a persistent object is completely unpinned, it becomes a candidate
4548 for aging. The memory of an object is freed when it is aged out. Aging
4549 is used to maximize the utilization of memory. An dirty object cannot
4550 be aged out unless it is flushed.
4552 FOR TRANSIENT OBJECTS:
4553 The pin count of the object is decremented. A transient can be freed
4554 only at the end of its allocation duration or when it is explicitly
4555 deleted by calling OCIObjectFree().
4558 This function will return an error for value.
4561 if environment handle or error handle is null, return
4563 if operation suceeds, return OCI_SUCCESS.
4564 if operation fails, return OCI_ERROR.
4566 {---------------------------- OCIObjectPinCountReset ----------------------- }
4567 TOCIObjectPinCountReset = function (env: POCIEnv; err: POCIError;
4568 const _object: pointer): sword; cdecl;
4570 NAME: OCIObjectPinCountReset - OCI resets the pin count of a referenceable
4573 env (IN/OUT) - OCI environment handle initialized in object mode
4574 err (IN/OUT) - error handle. If there is an error, it is
4575 recorded in 'err' and this function returns OCI_ERROR.
4576 The error recorded in 'err' can be retrieved by
4577 calling OCIErrorGet().
4578 object (IN) - pointer to an object
4580 - a valid OCI environment handle must be given.
4581 - The specified object must be pinned.
4583 This function completely unpins an object. When an object is
4584 completely unpinned, it can be freed without error.
4586 FOR PERSISTENT OBJECTS:
4587 When a persistent object is completely unpinned, it becomes a candidate
4588 for aging. The memory of an object is freed when it is aged out. Aging
4589 is used to maximize the utilization of memory. An dirty object cannot
4590 be aged out unless it is flushed.
4592 FOR TRANSIENT OBJECTS:
4593 The pin count of the object is decremented. A transient can be freed
4594 only at the end of its allocation duration or when it is explicitly
4595 freed by calling OCIObjectFree().
4598 This function will return an error for value.
4601 if environment handle or error handle is null, return
4603 if operation suceeds, return OCI_SUCCESS.
4604 if operation fails, return OCI_ERROR.
4606 {--------------------------- OCIObjectLock --------------------------------- }
4607 TOCIObjectLock = function(env: POCIEnv; err: POCIError;
4608 const _object: pointer): sword; cdecl;
4611 NAME: OCIObjectLock - OCI lock a persistent object
4613 env (IN/OUT) - OCI environment handle initialized in object mode
4614 err (IN/OUT) - error handle. If there is an error, it is
4615 recorded in 'err' and this function returns OCI_ERROR.
4616 The error recorded in 'err' can be retrieved by
4617 calling OCIErrorGet().
4618 object (IN) - pointer to the persistent object
4620 - a valid OCI environment handle must be given.
4621 - The specified object must be pinned.
4623 This function locks a persistent object at the server. Unlike
4624 OCIObjectLockNoWait() this function waits if another user currently
4625 holds a lock on the desired object. This function
4626 returns an error if:
4627 1) the object is non-existent.
4629 This function will return an error for transient objects and values.
4630 The lock of an object is released at the end of a transaction.
4633 if environment handle or error handle is null, return
4635 if operation suceeds, return OCI_SUCCESS.
4636 if operation fails, return OCI_ERROR.
4638 {------------------------ OCIObjectLockNoWait ------------------------------ }
4639 TOCIObjectLockNoWait = function(env: POCIEnv; err: POCIError;
4640 const _object: pointer): sword; cdecl;
4643 NAME: OCIObjectLockNoWait - OCI lock a persistent object, do not wait for
4644 the lock, return error if lock not available
4646 env (IN/OUT) - OCI environment handle initialized in object mode
4647 err (IN/OUT) - error handle. If there is an error, it is
4648 recorded in 'err' and this function returns OCI_ERROR.
4649 The error recorded in 'err' can be retrieved by
4650 calling OCIErrorGet().
4651 object (IN) - pointer to the persistent object
4653 - a valid OCI environment handle must be given.
4654 - The specified object must be pinned.
4656 This function locks a persistent object at the server. Unlike
4657 OCIObjectLock() this function will not wait if another user holds
4658 the lock on the desired object. This function returns an error if:
4659 1) the object is non-existent.
4660 2) the object is currently locked by another user in which
4661 case this function returns with an error.
4663 This function will return an error for transient objects and values.
4664 The lock of an object is released at the end of a transaction.
4667 if environment handle or error handle is null, return
4669 if operation suceeds, return OCI_SUCCESS.
4670 if operation fails, return OCI_ERROR.
4672 {--------------------------- OCIObjectMarkUpdate --------------------------- }
4673 TOCIObjectMarkUpdate = function(env: POCIEnv; err: POCIError;
4674 const _object: pointer): sword; cdecl;
4677 NAME: OCIObjectMarkUpdate - OCI marks an object as updated
4679 env (IN/OUT) - OCI environment handle initialized in object mode
4680 err (IN/OUT) - error handle. If there is an error, it is
4681 recorded in 'err' and this function returns OCI_ERROR.
4682 The error recorded in 'err' can be retrieved by
4683 calling OCIErrorGet().
4684 object (IN) - pointer to the persistent object
4686 - a valid OCI environment handle must be given.
4687 - The specified object must be pinned.
4689 FOR PERSISTENT OBJECTS:
4690 This function marks the specified persistent object as updated. The
4691 persistent objects will be written to the server when the object cache
4692 is flushed. The object is not locked or flushed by this function. It
4693 is an error to update a deleted object.
4695 After an object is marked updated and flushed, this function must be
4696 called again to mark the object as updated if it has been dirtied
4697 after it is being flushed.
4699 FOR TRANSIENT OBJECTS:
4700 This function marks the specified transient object as updated. The
4701 transient objects will NOT be written to the server. It is an error
4702 to update a deleted object.
4705 It is an no-op for values.
4708 if environment handle or error handle is null, return
4710 if operation suceeds, return OCI_SUCCESS.
4711 if operation fails, return OCI_ERROR.
4713 {----------------------------- OCIObjectUnmark ----------------------------- }
4714 TOCIObjectUnmark = function(env: POCIEnv; err: POCIError;
4715 const _object:pointer): sword; cdecl;
4718 NAME: OCIObjectUnmark - OCI unmarks an object
4720 env (IN/OUT) - OCI environment handle initialized in object mode
4721 err (IN/OUT) - error handle. If there is an error, it is
4722 recorded in 'err' and this function returns OCI_ERROR.
4723 The error recorded in 'err' can be retrieved by
4724 calling OCIErrorGet().
4725 object (IN) - pointer to the persistent object
4727 - a valid OCI environment handle must be given.
4728 - The specified object must be pinned.
4730 FOR PERSISTENT OBJECTS AND TRANSIENT OBJECTS:
4731 This function unmarks the specified persistent object as dirty. Changes
4732 that are made to the object will not be written to the server. If the
4733 object is marked locked, it remains marked locked. The changes that
4734 have already made to the object will not be undone implicitly.
4737 It is an no-op for values.
4740 if environment handle or error handle is null, return
4742 if operation suceeds, return OCI_SUCCESS.
4743 if operation fails, return OCI_ERROR.
4745 {----------------------------- OCIObjectUnmarkByRef ------------------------ }
4746 TOCIObjectUnmarkByRef = function(env: POCIEnv; err: POCIError;
4747 const ref: POCIRef): sword; cdecl;
4750 NAME: OCIObjectUnmarkByRef - OCI unmarks an object by Ref
4752 env (IN/OUT) - OCI environment handle initialized in object mode
4753 err (IN/OUT) - error handle. If there is an error, it is
4754 recorded in 'err' and this function returns OCI_ERROR.
4755 The error recorded in 'err' can be retrieved by
4756 calling OCIErrorGet().
4757 ref (IN) - reference of the object
4759 - a valid OCI environment handle must be given.
4760 - The specified object must be pinned.
4762 FOR PERSISTENT OBJECTS AND TRANSIENT OBJECTS:
4763 This function unmarks the specified persistent object as dirty. Changes
4764 that are made to the object will not be written to the server. If the
4765 object is marked locked, it remains marked locked. The changes that
4766 have already made to the object will not be undone implicitly.
4769 It is an no-op for values.
4772 if environment handle or error handle is null, return
4774 if operation suceeds, return OCI_SUCCESS.
4775 if operation fails, return OCI_ERROR.
4777 {--------------------------- OCIObjectFree --------------------------------- }
4778 TOCIObjectFree = function(env: POCIEnv; err: POCIError;
4779 const instance: pointer; const flags: ub2): sword; cdecl;
4782 NAME: OCIObjectFree - OCI free (and unpin) an standalone instance
4784 env (IN/OUT) - OCI environment handle initialized in object mode
4785 err (IN/OUT) - error handle. If there is an error, it is
4786 recorded in 'err' and this function returns
4787 OCI_ERROR. The error recorded in 'err' can be
4788 retrieved by calling OCIErrorGet().
4789 instance (IN) - pointer to a standalone instance.
4790 flags (IN) - If OCI_OBJECT_FREE_FORCE is set, free the object
4791 even if it is pinned or dirty.
4792 If OCI_OBJECT_FREE_NONULL is set, the null
4793 structure will not be freed.
4795 - a valid OCI environment handle must be given.
4796 - The instance to be freed must be standalone.
4797 - If the instance is a referenceable object, the object must be pinned.
4799 This function deallocates all the memory allocated for an OTS instance,
4800 including the null structure.
4802 FOR PERSISTENT OBJECTS:
4803 This function will return an error if the client is attempting to free
4804 a dirty persistent object that has not been flushed. The client should
4805 either flush the persistent object or set the parameter 'flag' to
4806 OCI_OBJECT_FREE_FORCE.
4808 This function will call OCIObjectUnpin() once to check if the object
4809 can be completely unpin. If it succeeds, the rest of the function will
4810 proceed to free the object. If it fails, then an error is returned
4811 unless the parameter 'flag' is set to OCI_OBJECT_FREE_FORCE.
4813 Freeing a persistent object in memory will not change the persistent
4814 state of that object at the server. For example, the object will
4815 remain locked after the object is freed.
4817 FOR TRANSIENT OBJECTS:
4819 This function will call OCIObjectUnpin() once to check if the object
4820 can be completely unpin. If it succeeds, the rest of the function will
4821 proceed to free the object. If it fails, then an error is returned
4822 unless the parameter 'flag' is set to OCI_OBJECT_FREE_FORCE.
4825 The memory of the object is freed immediately.
4828 if environment handle or error handle is null, return
4830 if operation suceeds, return OCI_SUCCESS.
4831 if operation fails, return OCI_ERROR.
4833 {----------------------- OCIObjectMarkDeleteByRef -------------------------- }
4834 TOCIObjectMarkDeleteByRef = function(env: POCIEnv; err: POCIError;
4835 const object_ref:POCIRef): sword; cdecl;
4838 NAME: OCIObjectMarkDeleteByRef - OCI "delete" (and unpin) an object given
4841 env (IN/OUT) - OCI environment handle initialized in object mode
4842 err (IN/OUT) - error handle. If there is an error, it is
4843 recorded in 'err' and this function returns
4844 OCI_ERROR. The error recorded in 'err' can be
4845 retrieved by calling OCIErrorGet().
4846 object_ref (IN) - ref of the object to be deleted
4849 - a valid OCI environment handle must be given.
4851 This function marks the object designated by 'object_ref' as deleted.
4853 FOR PERSISTENT OBJECTS:
4854 If the object is not loaded, then a temporary object is created and is
4855 marked deleted. Otherwise, the object is marked deleted.
4857 The object is deleted in the server when the object is flushed.
4859 FOR TRANSIENT OBJECTS:
4860 The object is marked deleted. The object is not freed until it is
4864 if environment handle or error handle is null, return
4866 if operation suceeds, return OCI_SUCCESS.
4867 if operation fails, return OCI_ERROR.
4869 {--------------------------- OCIObjectMarkDelete --------------------------- }
4870 TOCIObjectMarkDelete = function(env: POCIEnv; err: POCIError;
4871 const instance:pointer): sword; cdecl;
4874 NAME: OCIObjectMarkDelete - OCI "delete" an instance given a Pointer
4876 env (IN/OUT) - OCI environment handle initialized in object mode
4877 err (IN/OUT) - error handle. If there is an error, it is
4878 recorded in 'err' and this function returns
4879 OCI_ERROR. The error recorded in 'err' can be
4880 retrieved by calling OCIErrorGet().
4881 instance (IN) - pointer to the instance
4883 - a valid OCI environment handle must be given.
4884 - The instance must be standalone.
4885 - If the instance is a referenceable object, then it must be pinned.
4888 FOR PERSISTENT OBJECTS:
4889 The object is marked deleted. The memory of the object is not freed.
4890 The object is deleted in the server when the object is flushed.
4892 FOR TRANSIENT OBJECTS:
4893 The object is marked deleted. The memory of the object is not freed.
4896 This function frees a value immediately.
4899 if environment handle or error handle is null, return
4901 if operation suceeds, return OCI_SUCCESS.
4902 if operation fails, return OCI_ERROR.
4904 {---------------------------- OCIObjectFlush ------------------------------- }
4905 TOCIObjectFlush = function(env: POCIEnv; err: POCIError;
4906 const _object: pointer): sword; cdecl;
4909 NAME: OCIObjectFlush - OCI flush a persistent object
4911 env (IN/OUT) - OCI environment handle initialized in object mode
4912 err (IN/OUT) - error handle. If there is an error, it is
4913 recorded in 'err' and this function returns
4914 OCI_ERROR. The error recorded in 'err' can be
4915 retrieved by calling OCIErrorGet().
4916 object (IN) - pointer to the persistent object
4918 - a valid OCI environment handle must be given.
4919 - The specified object must be pinned.
4921 This function flushes a modified persistent object to the server.
4922 An exclusive lock is obtained implicitly for the object when flushed.
4924 When the object is written to the server, triggers may be fired.
4925 Objects can be modified by the triggers at the server. To keep the
4926 objects in the object cache being coherent with the database, the
4927 clients can free or refresh the objects in the cache.
4929 This function will return an error for transient objects and values.
4932 if environment handle or error handle is null, return
4934 if operation suceeds, return OCI_SUCCESS.
4935 if operation fails, return OCI_ERROR.
4937 {------------------------ OCIObjectRefresh --------------------------------- }
4938 TOCIObjectRefresh = function(env: POCIEnv; err: POCIError;
4939 _object: pointer): sword; cdecl;
4942 NAME: OCIObjectRefresh - OCI refresh a persistent object
4944 env (IN/OUT) - OCI environment handle initialized in object mode
4945 err (IN/OUT) - error handle. If there is an error, it is
4946 recorded in 'err' and this function returns
4947 OCI_ERROR. The error recorded in 'err' can be
4948 retrieved by calling OCIErrorGet().
4949 object (IN) - pointer to the persistent object
4951 - a valid OCI environment handle must be given.
4952 - The specified object must be pinned.
4954 This function refreshes an unmarked object with data retrieved from the
4955 latest snapshot in the server. An object should be refreshed when the
4956 objects in the cache are inconsistent with the objects at
4958 1) When an object is flushed to the server, triggers can be fired to
4959 modify more objects in the server. The same objects (modified by
4960 the triggers) in the object cache become obsolete.
4961 2) When the user issues a SQL or executes a PL/SQL procedure to modify
4962 any object in the server, the same object in the cache becomes
4965 The object that is refreshed will be 'replaced-in-place'. When an
4966 object is 'replaced-in-place', the top level memory of the object will
4967 be reused so that new data can be loaded into the same memory address.
4968 The top level memory of the null structre is also reused. Unlike the
4969 top level memory chunk, the secondary memory chunks may be resized and
4970 reallocated. The client should be careful when holding onto a pointer
4971 to the secondary memory chunk (e.g. assigning the address of a
4972 secondary memory to a local variable), since this pointer can become
4973 invalid after the object is refreshed.
4975 The object state will be modified as followed after being refreshed:
4976 - existent : set to appropriate value
4977 - pinned : unchanged
4978 - allocation duration : unchanged
4979 - pin duration : unchanged
4981 This function is an no-op for transient objects or values.
4984 if environment handle or error handle is null, return
4986 if operation suceeds, return OCI_SUCCESS.
4987 if operation fails, return OCI_ERROR.
4989 {---------------------------- OCIObjectCopy -------------------------------- }
4990 TOCIObjectCopy = function(env: POCIEnv; err: POCIError; const svc: POCISvcCtx;
4991 const source, null_source, target, null_target: pointer; const tdo: POCIType;
4992 const duration: OCIDuration; const option: ub1): sword; cdecl;
4995 NAME: OCIObjectCopy - OCI copy one instance to another
4997 env (IN/OUT) - OCI environment handle initialized in object mode
4998 err (IN/OUT) - error handle. If there is an error, it is
4999 recorded in 'err' and this function returns
5000 OCI_ERROR. The error recorded in 'err' can be
5001 retrieved by calling OCIErrorGet().
5002 svc (IN) - OCI service context handle
5003 source (IN) - pointer to the source instance
5004 null_source (IN) - pointer to the null structure of the source
5005 target (IN) - pointer to the target instance
5006 null_target (IN) - pointer to the null structure of the target
5007 tdo (IN) - the TDO for both source and target
5008 duration (IN) - allocation duration of the target memory
5009 option (IN) - specify the copy option:
5010 OROOCOSFN - Set Reference to Null. All references
5011 in the source will not be copied to the target. The
5012 references in the target are set to null.
5014 - a valid OCI environment handle must be given.
5015 - If source or target is referenceable, it must be pinned.
5016 - The target or the containing instance of the target must be already
5017 be instantiated (e.g. created by OCIObjectNew()).
5018 - The source and target instances must be of the same type. If the
5019 source and target are located in a different databases, then the
5020 same type must exist in both databases.
5022 This function copies the contents of the 'source' instance to the
5023 'target' instance. This function performs a deep-copy such that the
5024 data that is copied/duplicated include:
5025 a) all the top level attributes (see the exceptions below)
5026 b) all the secondary memory (of the source) that is reachable from the
5027 top level attributes.
5028 c) the null structure of the instance
5030 Memory is allocated with the specified allocation duration.
5032 Certain data items are not copied:
5033 a) If the option OCI_OBJECTCOPY_NOREF is specified, then all references
5034 in the source are not copied. Instead, the references in the target
5036 b) If the attribute is a LOB, then it is set to null.
5039 if environment handle or error handle is null, return
5041 if operation suceeds, return OCI_SUCCESS.
5042 if operation fails, return OCI_ERROR.
5044 {---------------------------- OCIObjectGetTypeRef -------------------------- }
5045 TOCIObjectGetTypeRef = function(env: POCIEnv; err: POCIError;
5046 const instance:pointer; type_ref: POCIRef): sword; cdecl;
5049 NAME: OCIObjectGetTypeRef - get the type reference of a standalone object
5051 env (IN/OUT) - OCI environment handle initialized in object mode
5052 err (IN/OUT) - error handle. If there is an error, it is
5053 recorded in 'err' and this function returns
5054 OCI_ERROR. The error recorded in 'err' can be
5055 retrieved by calling OCIErrorGet().
5056 instance (IN) - pointer to an standalone instance
5057 type_ref (OUT) - reference to the type of the object. The reference
5058 must already be allocated.
5060 - a valid OCI environment handle must be given.
5061 - The instance must be standalone.
5062 - If the object is referenceable, the specified object must be pinned.
5063 - The reference must already be allocated.
5065 This function returns a reference to the TDO of a standalone instance.
5067 if environment handle or error handle is null, return
5069 if operation suceeds, return OCI_SUCCESS.
5070 if operation fails, return OCI_ERROR.
5072 {--------------------------- OCIObjectGetObjectRef ------------------------- }
5073 TOCIObjectGetObjectRef = function(env: POCIEnv; err: POCIError;
5074 const _object: pointer; bject_ref: POCIRef): sword; cdecl;
5077 NAME: OCIObjectGetObjectRef - OCI get the object reference of an
5078 referenceable object
5080 env (IN/OUT) - OCI environment handle initialized in object mode
5081 err (IN/OUT) - error handle. If there is an error, it is
5082 recorded in 'err' and this function returns
5083 OCI_ERROR. The error recorded in 'err' can be
5084 retrieved by calling OCIErrorGet().
5085 object (IN) - pointer to a persistent object
5086 object_ref (OUT) - reference of the given object. The reference must
5087 already be allocated.
5089 - a valid OCI environment handle must be given.
5090 - The specified object must be pinned.
5091 - The reference must already be allocated.
5093 This function returns a reference to the given object. It returns an
5096 if environment handle or error handle is null, return
5098 if operation suceeds, return OCI_SUCCESS.
5099 if operation fails, return OCI_ERROR.
5101 {--------------------------- OCIObjectMakeObjectRef ----------------------- }
5102 TOCIObjectMakeObjectRef = function(env: POCIEnv; err: POCIError;
5103 const svc: POCISvcCtx; const table: pointer; const values: PPointer;
5104 const array_len: ub4; object_ref: POCIRef): sword; cdecl;
5107 NAME: OCIObjectMakeObjectRef - OCI Create an object reference to a
5108 referenceable object.
5110 env (IN/OUT) - OCI environment handle initialized in object mode
5111 err (IN/OUT) - error handle. If there is an error, it is
5112 recorded in 'err' and this function returns
5113 OCI_ERROR. The error recorded in 'err' can be
5114 retrieved by calling OCIErrorGet().
5115 svc (IN) - the service context
5116 table (IN) - A pointer to the table object (must be pinned)
5117 attrlist (IN) - A list of values (OCI type values) from which
5118 the ref is to be created.
5119 attrcnt (IN) - The length of the attrlist array.
5120 object_ref (OUT) - reference of the given object. The reference must
5121 already be allocated.
5123 - a valid OCI environment handle must be given.
5124 - The specified table object must be pinned.
5125 - The reference must already be allocated.
5127 This function creates a reference given the values that make up the
5128 reference and also a pointer to the table object.
5129 Based on the table's OID property, whether it is a pk based OID or
5130 a system generated OID, the function creates a sys-generated REF or
5132 In case of system generated REFs pass in a OCIRaw which is 16 bytes
5133 long contatining the sys generated OID.
5134 In case of PK refs pass in the OCI equivalent for numbers, chars etc..
5136 if environment handle or error handle is null, return
5138 if operation suceeds, return OCI_SUCCESS.
5139 if operation fails, return OCI_ERROR.
5141 {--------------------------- OCIObjectGetPrimaryKeyTypeRef --------------- }
5142 TOCIObjectGetPrimaryKeyTypeRef = function(env: POCIEnv; err: POCIError;
5143 const svc:POCISvcCtx; const table: pointer;
5144 type_ref: POCIRef): sword; cdecl;
5147 NAME: OCIObjectGetPrimaryKeyTypeRef - OCI get the REF to the pk OID type
5149 env (IN/OUT) - OCI environment handle initialized in object mode
5150 err (IN/OUT) - error handle. If there is an error, it is
5151 recorded in 'err' and this function returns
5152 OCI_ERROR. The error recorded in 'err' can be
5153 retrieved by calling OCIErrorGet().
5154 svc (IN) - the service context
5155 table (IN) - pointer to the table object
5156 type_ref (OUT) - reference of the pk type. The reference must
5157 already be allocated.
5159 - a valid OCI environment handle must be given.
5160 - The specified table object must be pinned.
5161 - The reference must already be allocated.
5163 This function returns a reference to the pk type. It returns an
5164 error for values. If the table is not a Pk oid table/view, then
5167 if environment handle or error handle is null, return
5169 if operation suceeds, return OCI_SUCCESS.
5170 if operation fails, return OCI_ERROR.
5172 {-------------------------- OCIObjectGetInd -------------------------------- }
5173 TOCIObjectGetInd = function(env: POCIEnv; err: POCIError;
5174 const instance: pointer; null_struct: PPointer): sword; cdecl;
5177 NAME: OCIObjectGetInd - OCI get the null structure of a standalone object
5179 env (IN/OUT) - OCI environment handle initialized in object mode
5180 err (IN/OUT) - error handle. If there is an error, it is
5181 recorded in 'err' and this function returns
5182 OCI_ERROR. The error recorded in 'err' can be
5183 retrieved by calling OCIErrorGet().
5184 instance (IN) - pointer to the instance
5185 null_struct (OUT) - null structure
5187 - a valid OCI environment handle must be given.
5188 - The object must be standalone.
5189 - If the object is referenceable, the specified object must be pinned.
5191 This function returns the null structure of an instance. This function
5192 will allocate the top level memory of the null structure if it is not
5193 already allocated. If an null structure cannot be allocated for the
5194 instance, then an error is returned. This function only works for
5195 ADT or row type instance.
5197 if environment handle or error handle is null, return
5199 if operation suceeds, return OCI_SUCCESS.
5200 if operation fails, return OCI_ERROR.
5202 {------------------------- OCIObjectExists -------------------------------- }
5203 TOCIObjectExists = function(env: POCIEnv; err: POCIError; const ins: pointer;
5204 exist: PBoolean): sword; cdecl;
5207 NAME: OCIObjectExist - OCI checks if the object exists
5209 env (IN/OUT) - OCI environment handle initialized in object mode
5210 err (IN/OUT) - error handle. If there is an error, it is
5211 recorded in 'err' and this function returns
5212 OCI_ERROR. The error recorded in 'err' can be
5213 retrieved by calling OCIErrorGet().
5214 ins (IN) - pointer to an instance
5215 exist (OUT) - return TRUE if the object exists
5217 - a valid OCI environment handle must be given.
5218 - The object must be standalone.
5219 - if object is a referenceable, it must be pinned.
5221 This function returns the existence of an instance. If the instance
5222 is a value, this function always returns TRUE.
5224 if environment handle or error handle is null, return
5226 if operation suceeds, return OCI_SUCCESS.
5227 if operation fails, return OCI_ERROR.
5229 {------------------------- OCIObjectGetProperty --------------------------- }
5230 TOCIObjectGetProperty = function(envh: POCIEnv; errh: POCIError;
5231 const obj: pointer; const propertyId: OCIObjectPropId;
5232 _property: pointer; size: Pub4): sword; cdecl;
5235 NAME: OCIObjectGetProperty - OCIObject Get Property of given object
5237 env (IN/OUT) - OCI environment handle initialized in object mode
5238 err (IN/OUT) - error handle. If there is an error, it is
5239 recorded in 'err' and this function returns
5240 OCI_ERROR. The error recorded in 'err' can be
5241 retrieved by calling OCIErrorGet().
5242 obj (IN) - object whose property is returned
5243 propertyId (IN) - id which identifies the desired property
5244 property (OUT) - buffer into which the desired property is
5246 size (IN/OUT) - on input specifies the size of the property buffer
5247 passed by caller, on output will contain the
5248 size in bytes of the property returned.
5249 This parameter is required for string type
5250 properties only (e.g OCI_OBJECTPROP_SCHEMA,
5251 OCI_OBJECTPROP_TABLE). For non-string
5252 properties this parameter is ignored since
5255 This function returns the specified property of the object.
5256 The desired property is identified by 'propertyId'. The property
5257 value is copied into 'property' and for string typed properties
5258 the string size is returned via 'size'.
5260 Objects are classified as persistent, transient and value
5261 depending upon the lifetime and referenceability of the object.
5262 Some of the properties are applicable only to persistent
5263 objects and some others only apply to persistent and
5264 transient objects. An error is returned if the user tries to
5265 get a property which in not applicable to the given object.
5266 To avoid such an error, the user should first check whether
5267 the object is persistent or transient or value
5268 (OCI_OBJECTPROP_LIFETIME property) and then appropriately
5269 query for other properties.
5271 The different property ids and the corresponding type of
5272 'property' argument is given below.
5274 OCI_OBJECTPROP_LIFETIME
5275 This identifies whether the given object is a persistent
5276 object (OCI_OBJECT_PERSISTENT) or a
5277 transient object (OCI_OBJECT_TRANSIENT) or a
5278 value instance (OCI_OBJECT_VALUE).
5279 'property' argument must be a pointer to a variable of
5280 type OCIObjectLifetime.
5282 OCI_OBJECTPROP_SCHEMA
5283 This returns the schema name of the table in which the
5284 object exists. An error is returned if the given object
5285 points to a transient instance or a value. If the input
5286 buffer is not big enough to hold the schema name an error
5287 is returned, the error message will communicate the
5288 required size. Upon success, the size of the returned
5289 schema name in bytes is returned via 'size'.
5290 'property' argument must be an array of type text and 'size'
5291 should be set to size of array in bytes by the caller.
5293 OCI_OBJECTPROP_TABLE
5294 This returns the table name in which the object exists. An
5295 error is returned if the given object points to a
5296 transient instance or a value. If the input buffer is not
5297 big enough to hold the table name an error is returned,
5298 the error message will communicate the required size. Upon
5299 success, the size of the returned table name in bytes is
5300 returned via 'size'. 'property' argument must be an array
5301 of type text and 'size' should be set to size of array in
5302 bytes by the caller.
5304 OCI_OBJECTPROP_PIN_DURATION
5305 This returns the pin duration of the object.
5306 An error is returned if the given object points to a value
5307 instance. Valid pin durations are: OCI_DURATION_SESSION and
5309 'property' argument must be a pointer to a variable of type
5312 OCI_OBJECTPROP_ALLOC_DURATION
5313 This returns the allocation duration of the object.
5314 Valid allocation durations are: OCI_DURATION_SESSION and
5316 'property' argument must be a pointer to a variable of type
5320 This returns the lock status of the
5321 object. The possible lock status is enumerated by OCILockOpt.
5322 An error is returned if the given object points to a transient
5324 'property' argument must be a pointer to a variable of
5326 Note, the lock status of an object can also be retrieved by
5327 calling OCIObjectIsLocked().
5329 OCI_OBJECTPROP_MARKSTATUS
5330 This returns the status flag which indicates whether the
5331 object is a new object, updated object and/or deleted object.
5332 The following macros can be used to test the mark status
5335 OCI_OBJECT_IS_UPDATED(flag)
5336 OCI_OBJECT_IS_DELETED(flag)
5337 OCI_OBJECT_IS_NEW(flag)
5338 OCI_OBJECT_IS_DIRTY(flag)
5340 An object is dirty if it is a new object or marked deleted or
5342 An error is returned if the given object points to a transient
5343 or value instance. 'property' argument must be of type
5344 OCIObjectMarkStatus.
5347 This identifies whether the specified object is a view object
5348 or not. If property value returned is TRUE, it indicates the
5349 object is a view otherwise it is not.
5350 'property' argument must be of type boolean.
5353 if environment handle or error handle is null, return
5355 if operation suceeds, return OCI_SUCCESS.
5356 if operation fails, return OCI_ERROR. Possible errors are TBD
5358 {---------------------------- OCIObjectIsLocked -------------------------- }
5359 TOCIObjectIsLocked = function(env: POCIEnv; err: POCIError; const ins: pointer;
5360 lock: Pboolean): sword; cdecl;
5363 NAME: OCIObjectIsLocked - OCI get the lock status of a standalone object
5365 env (IN/OUT) - OCI environment handle initialized in object mode
5366 err (IN/OUT) - error handle. If there is an error, it is
5367 recorded in 'err' and this function returns
5368 OCI_ERROR. The error recorded in 'err' can be
5369 retrieved by calling OCIErrorGet().
5370 ins (IN) - pointer to an instance
5371 lock (OUT) - return value for the lock status.
5373 - a valid OCI environment handle must be given.
5374 - The instance must be standalone.
5375 - If the object is referenceable, the specified object must be pinned.
5377 This function returns the lock status of an instance. If the instance
5378 is a value, this function always returns FALSE.
5380 if environment handle or error handle is null, return
5382 if operation suceeds, return OCI_SUCCESS.
5383 if operation fails, return OCI_ERROR.
5385 {------------------------- OCIObjectIsDirty ------------------------------ }
5386 TOCIObjectIsDirty = function(env: POCIEnv; err: POCIError; const ins: pointer;
5387 dirty:Pboolean): sword; cdecl;
5390 NAME: OCIObjectIsDirty - OCI get the dirty status of a standalone object
5392 env (IN/OUT) - OCI environment handle initialized in object mode
5393 err (IN/OUT) - error handle. If there is an error, it is
5394 recorded in 'err' and this function returns
5395 OCI_ERROR. The error recorded in 'err' can be
5396 retrieved by calling OCIErrorGet().
5397 ins (IN) - pointer to an instance
5398 dirty (OUT) - return value for the dirty status.
5400 - a valid OCI environment handle must be given.
5401 - The instance must be standalone.
5402 - if instance is an object, the instance must be pinned.
5404 This function returns the dirty status of an instance. If the instance
5405 is a value, this function always returns FALSE.
5407 if environment handle or error handle is null, return
5409 if operation suceeds, return OCI_SUCCESS.
5410 if operation fails, return OCI_ERROR.
5412 {--------------------------- OCIObjectPinTable ----------------------------- }
5413 TOCIObjectPinTable = function(env: POCIEnv; err: POCIError;
5414 const svc:POCISvcCtx; const schema_name: Poratext; const s_n_length: ub4;
5415 const object_name: Poratext; const o_n_length:ub4;
5416 const scope_obj_ref: POCIRef; const pin_duration: OCIDuration;
5417 _object: PPointer): sword; cdecl;
5420 NAME: OCIObjectPinTable - OCI get table object
5422 env (IN/OUT) - OCI environment handle initialized in object mode
5423 err (IN/OUT) - error handle. If there is an error, it is
5424 recorded in 'err' and this function returns
5425 OCI_ERROR. The error recorded in 'err' can be
5426 retrieved by calling OCIErrorGet().
5427 svc (IN) - OCI service context handle
5428 schema_name (IN, optional) - schema name of the table
5429 s_n_length (IN, optional) - length of the schema name
5430 object_name (IN) - name of the table
5431 o_n_length (IN) - length of the table name
5432 scope_obj_ref (IN, optional) - reference of the scoping object
5433 pin_duration (IN) - pin duration. See description in OCIObjectPin().
5434 object (OUT) - the pinned table object
5436 - a valid OCI environment handle must be given.
5438 This function pin a table object with the specified pin duration.
5439 The client can unpin the object by calling OCIObjectUnpin(). See
5440 OCIObjectPin() and OCIObjectUnpin() for more information about pinning
5443 if environment handle or error handle is null, return
5445 if operation suceeds, return OCI_SUCCESS.
5446 if operation fails, return OCI_ERROR.
5448 {------------------------- OCIObjectArrayPin ------------------------------- }
5449 TOCIObjectArrayPin = function(env: POCIEnv; err: POCIError;
5450 const ref_array: PPOCIRef; const array_size: ub4;
5451 const cor_array: PPOCIComplexObject; const cor_array_size: ub4;
5452 const pin_option: OCIPinOpt; const pin_duration: OCIDuration;
5453 const lock: OCILockOpt; obj_array: PPointer;
5454 pos: Pub4): sword; cdecl;
5457 NAME: OCIObjectArrayPin - ORIO array pin
5459 env (IN/OUT) - OCI environment handle initialized in object mode
5460 err (IN/OUT) - error handle. If there is an error, it is
5461 recorded in 'err' and this function returns
5462 OCI_ERROR. The error recorded in 'err' can be
5463 retrieved by calling OCIErrorGet().
5464 ref_array (IN) - array of references to be pinned
5465 array_size (IN) - number of elements in the array of references
5466 pin_option (IN) - pin option. See OCIObjectPin().
5467 pin_duration (IN) - pin duration. See OCIObjectPin().
5468 lock_option (IN) - lock option. See OCIObjectPin().
5469 obj_array (OUT) - If this argument is not NULL, the pinned objects
5470 will be returned in the array. The user must
5471 allocate this array with element type being
5472 'void *'. The size of this array is identical to
5474 pos (OUT) - If there is an error, this argument will contain
5475 the element that is causing the error. Note that
5476 this argument is set to 1 for the first element in
5479 - a valid OCI environment handle must be given.
5480 - If 'obj_array' is not NULL, then it must already be allocated and
5481 the size of 'obj_array' is 'array_size'.
5483 This function pin an array of references. All the pinned objects are
5484 retrieved from the database in one network roundtrip. If the user
5485 specifies an output array ('obj_array'), then the address of the
5486 pinned objects will be assigned to the elements in the array. See
5487 OCIObjectPin() for more information about pinning.
5489 if environment handle or error handle is null, return
5491 if operation suceeds, return OCI_SUCCESS.
5492 if operation fails, return OCI_ERROR.
5494 {--------------------------------------------------------------------------- }
5495 { HEAP/CACHE OPERATIONS }
5496 {--------------------------------------------------------------------------- }
5497 {--------------------------- OCICacheFlush --------------------------------- }
5498 TOCICacheFlushGet = function(context: pointer; last: Pub1): POCIRef; cdecl;
5499 TOCICacheFlush = function(env: POCIEnv; err: POCIError; const svc:POCISvcCtx;
5500 const context: pointer; const get: TOCICacheFlushGet;
5501 ref: PPOCIRef): sword; cdecl;
5504 NAME: OCICacheFlush - OCI flush persistent objects
5506 env (IN/OUT) - OCI environment handle initialized in object mode
5507 err (IN/OUT) - error handle. If there is an error, it is
5508 recorded in 'err' and this function returns
5509 OCI_ERROR. The error recorded in 'err' can be
5510 retrieved by calling OCIErrorGet().
5511 svc (IN) [optional] - OCI service context. If null pointer is
5512 specified, then the dirty objects in all connections
5514 context (IN) [optional] - specifies an user context that is an
5515 argument to the client callback function 'get'. This
5516 parameter is set to NULL if there is no user context.
5517 get (IN) [optional] - an client-defined function which acts an
5518 iterator to retrieve a batch of dirty objects that need
5519 to be flushed. If the function is not NULL, this function
5520 will be called to get a reference of a dirty object.
5521 This is repeated until a null reference is returned by
5522 the client function or the parameter 'last' is set to
5523 TRUE. The parameter 'context' is passed to get()
5524 for each invocation of the client function. This
5525 parameter should be NULL if user callback is not given.
5526 If the object that is returned by the client function is
5527 not a dirtied persistent object, the object is ignored.
5528 All the objects that are returned from the client
5529 function must be from newed or pinned the same service
5530 context, otherwise, an error is signalled. Note that the
5531 returned objects are flushed in the order in which they
5533 ref (OUT) [optional] - if there is an error in flushing the
5534 objects, (*ref) will point to the object that
5535 is causing the error. If 'ref' is NULL, then the object
5536 will not be returned. If '*ref' is NULL, then a
5537 reference will be allocated and set to point to the
5538 object. If '*ref' is not NULL, then the reference of
5539 the object is copied into the given space. If the
5540 error is not caused by any of the dirtied object,
5541 the given ref is initalized to be a NULL reference
5542 (OCIRefIsNull(*ref) is TRUE).
5544 - a valid OCI environment handle must be given.
5546 This function flushes the modified persistent objects from the
5547 environment heap to the server. The objects are flushed in the order
5548 that they are marked updated or deleted.
5550 See OCIObjectFlush() for more information about flushing.
5553 if environment handle or error handle is null, return
5555 if operation suceeds, return OCI_SUCCESS.
5556 if operation fails, return OCI_ERROR.
5558 {--------------------------- OCICacheRefresh ------------------------------- }
5559 TOCICacheRefreshGet = function(context: pointer): POCIRef; cdecl;
5560 TOCICacheRefresh = function(env: POCIEnv; err: POCIError;
5561 const svc: POCISvcCtx; const option: OCIRefreshOpt; const context: pointer;
5562 get: TOCICacheRefreshGet; ref: PPOCIRef): sword; cdecl;
5565 NAME: OCICacheRefresh - OCI ReFreSh persistent objects
5567 env (IN/OUT) - OCI environment handle initialized in object mode
5568 err (IN/OUT) - error handle. If there is an error, it is
5569 recorded in 'err' and this function returns
5570 OCI_ERROR. The error recorded in 'err' can be
5571 retrieved by calling OCIErrorGet().
5572 svc (IN) [optional] - OCI service context. If null pointer is
5573 specified, then the persistent objects in all connections
5575 option (IN) [optional] - if OCI_REFRESH_LOAD is specified, all
5576 objects that is loaded within the transaction are
5577 refreshed. If the option is OCI_REFERSH_LOAD and the
5578 parameter 'get' is not NULL, this function will ignore
5580 context (IN) [optional] - specifies an user context that is an
5581 argument to the client callback function 'get'. This
5582 parameter is set to NULL if there is no user context.
5583 get (IN) [optional] - an client-defined function which acts an
5584 iterator to retrieve a batch of objects that need to be
5585 refreshed. If the function is not NULL, this function
5586 will be called to get a reference of an object. If
5587 the reference is not NULL, then the object will be
5588 refreshed. These steps are repeated until a null
5589 reference is returned by this function. The parameter
5590 'context' is passed to get() for each invocation of the
5591 client function. This parameter should be NULL if user
5592 callback is not given.
5593 ref (OUT) [optional] - if there is an error in refreshing the
5594 objects, (*ref) will point to the object that
5595 is causing the error. If 'ref' is NULL, then the object
5596 will not be returned. If '*ref' is NULL, then a
5597 reference will be allocated and set to point to the
5598 object. If '*ref' is not NULL, then the reference of
5599 the object is copied into the given space. If the
5600 error is not caused by any of the object,
5601 the given ref is initalized to be a NULL reference
5602 (OCIRefIsNull(*ref) is TRUE).
5604 - a valid OCI environment handle must be given.
5606 This function refreshes all pinned persistent objects. All unpinned
5607 persistent objects are freed. See OCIObjectRefresh() for more
5608 information about refreshing.
5610 if environment handle or error handle is null, return
5612 if operation suceeds, return OCI_SUCCESS.
5613 if operation fails, return OCI_ERROR.
5615 {---------------------------- OCICacheUnpin -------------------------------- }
5616 TOCICacheUnpin = function(env: POCIEnv; err: POCIError;
5617 const svc:POCISvcCtx): sword; cdecl;
5620 NAME: OCICacheUnpin - OCI UNPin objects
5622 env (IN/OUT) - OCI environment handle initialized in object mode
5623 err (IN/OUT) - error handle. If there is an error, it is
5624 recorded in 'err' and this function returns
5625 OCI_ERROR. The error recorded in 'err' can be
5626 retrieved by calling OCIErrorGet().
5627 svc (IN) [optional] - OCI service context. If null pointer is
5628 specified, then the objects in all connections
5631 - a valid OCI environment handle must be given.
5633 If a connection is specified, this function completely unpins the
5634 persistent objects in that connection. Otherwise, all persistent
5635 objects in the heap are completely unpinned. All transient objects in
5636 the heap are also completely unpinned. See OCIObjectUnpin() for more
5637 information about unpinning.
5639 if environment handle or error handle is null, return
5641 if operation suceeds, return OCI_SUCCESS.
5642 if operation fails, return OCI_ERROR.
5644 {----------------------------- OCICacheFree -------------------------------- }
5645 TOCICacheFree = function(env: POCIEnv; err: POCIError;
5646 const svc: POCISvcCtx): sword; cdecl;
5649 NAME: OCICacheFree - OCI FREe instances
5651 env (IN/OUT) - OCI environment handle initialized in object mode
5652 err (IN/OUT) - error handle. If there is an error, it is
5653 recorded in 'err' and this function returns
5654 OCI_ERROR. The error recorded in 'err' can be
5655 retrieved by calling OCIErrorGet().
5656 svc (IN) [optional] - OCI service context. If null pointer is
5657 specified, then the objects in all connections
5660 - a valid OCI environment handle must be given.
5662 If a connection is specified, this function frees the persistent
5663 objects, transient objects and values allocated for that connection.
5664 Otherwise, all persistent objects, transient objects and values in the
5665 heap are freed. Objects are freed regardless of their pin count. See
5666 OCIObjectFree() for more information about freeing an instance.
5668 if environment handle or error handle is null, return
5670 if operation suceeds, return OCI_SUCCESS.
5671 if operation fails, return OCI_ERROR.
5673 {---------------------------- OCICacheUnmark ------------------------------- }
5674 TOCICacheUnmark = function(env: POCIEnv; err: POCIError;
5675 const svc: POCISvcCtx): sword; cdecl;
5678 NAME: OCICacheUnmark - OCI Unmark all dirty objects
5680 env (IN/OUT) - OCI environment handle initialized in object mode
5681 err (IN/OUT) - error handle. If there is an error, it is
5682 recorded in 'err' and this function returns
5683 OCI_ERROR. The error recorded in 'err' can be
5684 retrieved by calling OCIErrorGet().
5685 svc (IN) [optional] - OCI service context. If null pointer is
5686 specified, then the objects in all connections
5689 - a valid OCI environment handle must be given.
5691 If a connection is specified, this function unmarks all dirty objects
5692 in that connection. Otherwise, all dirty objects in the cache are
5693 unmarked. See OCIObjectUnmark() for more information about unmarking
5696 if environment handle or error handle is null, return
5698 if operation suceeds, return OCI_SUCCESS.
5699 if operation fails, return OCI_ERROR.
5701 TOCIDurationBegin = function(env: POCIEnv; err: POCIError;
5702 svc: POCISvcCtx; const parent: OCIDuration;
5703 dur: POCIDuration): sword; cdecl;
5706 NAME: OCIDurationBegin - OCI DURATION BEGIN
5708 env (IN/OUT) - OCI environment handle initialized in object mode
5709 This should be passed NULL, when cartridge services
5711 err (IN/OUT) - error handle. If there is an error, it is
5712 recorded in 'err' and this function returns OCI_ERROR.
5713 The error recorded in 'err' can be retrieved by calling
5715 svc (IN/OUT) - OCI service handle.
5716 parent (IN) - parent for the duration to be started.
5717 dur (OUT) - newly created user duration
5719 - a valid OCI environment handle must be given for non-cartridge
5721 - For cartridge services, NULL should be given for environment handle
5722 - A valid service handle must be given in all cases.
5724 This function starts a new user duration. A user can have multiple
5725 active user durations simultaneously. The user durations do not have
5728 The object subsystem predefines 3 durations :
5729 1) session - memory allocated with session duration comes from
5730 the UGA heap (OCI_DURATION_SESSION). A session
5731 duration terminates at the end of the user session.
5732 2) transaction - memory allocated with transaction duration comes
5733 from the UGA heap (OCI_DURATION_TRANS). A trans-
5734 action duration terminates at the end of the user
5736 3) call - memory allocated with call duration comes from PGA
5737 heap (OCI_DURATION_CALL). A call duration terminates
5738 at the end of the user call.
5740 Each user duration has a parent duration. A parent duration can be a
5741 predefined duration or another user duration. The relationship between
5742 a user duration and its parent duration (child duration) are:
5744 1) An user duration is nested within the parent duration. When its
5745 parent duration terminates, the user duration will also terminate.
5746 2) The memory allocated with an user duration comes from the heap of
5747 its parent duration. For example, if the parent duration of an
5748 user duration is call, then the memory allocated with the user
5749 duration will also come from the PGA heap.
5751 This function can be used as both part of cartridge services as well
5752 as without cartridge services.
5753 The difference in the function in the case of cartridge and
5754 non-cartridge services is:
5755 In case of cartridge services, as descibed above a new user
5756 duration is created as a child of the "parent" duration.
5757 But when used for non-cartridge purposes, when a pre-defined
5758 duration is passed in as parent, it is mapped to the cache duration
5759 for that connection (which is created if not already present) and
5760 the new user duration will be child of the cache duration.
5763 if environment handle and service handle is null or if error
5764 handle is null return OCI_INVALID_HANDLE.
5765 if operation suceeds, return OCI_SUCCESS.
5766 if operation fails, return OCI_ERROR.
5768 TOCIDurationEnd = function(env: POCIEnv; err: POCIError; svc: POCISvcCtx;
5769 duration: OCIDuration): sword; cdecl;
5772 NAME: OCIDurationEnd - OCI DURATION END
5774 env (IN/OUT) - OCI environment handle initialized in object mode
5775 This should be passed NULL, when cartridge services
5777 err (IN/OUT) - error handle. If there is an error, it is
5778 recorded in 'err' and this function returns OCI_ERROR.
5779 The error recorded in 'err' can be retrieved by calling
5781 svc (IN/OUT) - OCI service handle.
5782 dur (OUT) - a previously created user duration using
5785 - a valid OCI environment handle must be given for non-cartridge
5787 - For cartridge services, NULL should be given for environment handle
5788 - A valid service handle must be given in all cases.
5790 This function terminates a user duration. All memory allocated for
5791 this duration is freed.
5793 This function can be used as both part of cartridge services as well
5794 as without cartridge services. In both cased, the heap duration
5795 is freed and all the allocated memory for that duration is freed.
5796 The difference in the function in the case of cartridge and
5797 non-cartridge services is:
5798 In case of non-cartridge services, if the duration is pre-
5799 defined, the associated cache duration (see OCIDurationBegin())
5800 is also terminated and the following is done.
5801 1) The child durations are terminated.
5802 2) All objects pinned for this duration are unpinned.
5803 3) All instances allocated for this duration are freed.
5805 In case of cartridge services, only the heap duration is
5806 freed. All the context entries allocated for that duration are
5807 freed from the context hash table..
5810 if environment handle and service handle is null or if error
5811 handle is null return OCI_INVALID_HANDLE.
5812 if operation suceeds, return OCI_SUCCESS.
5813 if operation fails, return OCI_ERROR.
5816 (*-----------------------------ort.h----------------------------------------*)
5818 {----------------------------- TYPE DESCRIPTION ---------------------------- }
5820 * OCIType - OCI Type Description Object
5822 * The contents of an 'OCIType' is private/opaque to clients. Clients just
5823 * need to declare and pass 'OCIType' pointers in to the type manage
5825 * The pointer points to the type in the object cache. Thus, clients don't
5826 * need to allocate space for this type and must NEVER free the pointer to the
5831 {------------------------- TYPE ELEMENT DESCRIPTION ------------------------ }
5833 * OCITypeElem - OCI Type Element object
5835 * The contents of an 'OCITypeElem' is private/opaque to clients. Clients just
5836 * need to declare and pass 'OCITypeElem' pointers in to the type manager
5839 * 'OCITypeElem' objects contains type element information such as the numeric
5840 * precision for example, for number objects, and the number of elements for
5842 * They ARE used to describe type attributes, collection elements,
5843 * method parameters, and method results. Hence they are pass in or returned
5844 * by attribute, collection, and method parameter/result accessors.
5846 {--------------------------- METHOD DESCRIPTION --------------------------- }
5848 * OCITypeMethod - OCI Method Description object
5850 * The contents of an 'OCITypeMethod' is private/opaque to clients. Clients
5851 * just need to declare and pass 'OCITypeMethod' pointers in to the type
5852 * manager functions.
5853 * The pointer points to the method in the object cache. Thus, clients don't
5854 * need to allocate space for this type and must NEVER free the pointer to
5855 * the 'OCITypeMethod'.
5857 {--------------------------- TYPE ACCESS ITERATOR -------------------------- }
5859 * OCITypeIter- OCI Type Iterator
5861 * The contents of an 'orti' is private/opaque to clients. Clients just
5862 * need to declare and pass 'orti' pointers in to the type manager functions.
5863 * The iterator is used to retreive MDO's and ADO's that belong to the TDO
5864 * one at a time. It needs to be allocated by the 'OCITypeIterNew()' function
5865 * call and deallocated with the 'OCITypeIterFree()' function call.
5867 {================== }
5868 { PUBLIC FUNCTIONS }
5869 {================== }
5870 {-------------------------------------------------------------------------- }
5872 {-------------------------------------------------------------------------- }
5873 {-----------------------_- OCITypeIterNew --------------------------------- }
5876 TOCITypeIterNew = function (env: POCIEnv; err: POCIError; const tdo: POCIType;
5877 iterator_ort: PPOCITypeIter):sword; cdecl;
5880 NAME: OCITypeIterNew - OCI Iterator NEW
5882 env (IN/OUT) - OCI environment handle initialized in object mode
5883 err (IN/OUT) - error handle. If there is an error, it is
5884 recorded in 'err' and this function returns OCI_ERROR.
5885 The error recorded in 'err' can be retrieved by calling
5887 tdo (IN) - pointer to the pinned type in the object cache to
5888 initialize the iterator with
5889 iterator_ort (OUT) - pointer to the pointer to the new iterator created
5891 Create a new instance of a method/attribute iterator and initalize
5894 OCI_SUCCESS if the function completes successfully.
5895 OCI_INVALID_HANDLE if 'env' or 'err' is null.
5897 1) any of the required parameters is null.
5898 2) error while allocating space for the iterator.
5900 {------------------------ OCITypeIterSet --------------------------------- }
5902 TOCITypeIterSet = function(env: POCIEnv; err: POCIError; const tdo: POCIType;
5903 iterator_ort: POCITypeIter): sword; cdecl;
5906 NAME: OCITypeIterSet - OCI Iterator SET
5908 env (IN/OUT) - OCI environment handle initialized in object mode
5909 err (IN/OUT) - error handle. If there is an error, it is
5910 recorded in 'err' and this function returns OCI_ERROR.
5911 The error recorded in 'err' can be retrieved by calling
5913 tdo (IN) - pointer to the pinned type in the object cache to
5914 initialize the iterator with
5915 iterator_ort (IN/OUT) - pointer to the iterator to set
5917 Initializes the iterator. This is used to reset the state of the
5920 OCI_SUCCESS if the function completes successfully.
5921 OCI_INVALID_HANDLE if 'env' or 'err' is null.
5923 1) any of the required parameters is null.
5925 {------------------------ OCITypeIterFree --------------------------------- }
5927 TOCITypeIterFree = function(env: POCIEnv; err: POCIError;
5928 iterator_ort: POCITypeIter):sword;
5931 NAME: OCITypeIterFree - OCI Iterator FREe
5933 env (IN/OUT) - OCI environment handle initialized in object mode
5934 err (IN/OUT) - error handle. If there is an error, it is
5935 recorded in 'err' and this function returns OCI_ERROR.
5936 The error recorded in 'err' can be retrieved by calling
5938 iterator_ort (IN/OUT) - pointer to the iterator to free
5940 Free space allocated for the iterator.
5942 OCI_SUCCESS if the function completes successfully.
5943 OCI_INVALID_HANDLE if 'env' or 'err' is null.
5945 1) any of the required parameters is null.
5946 2) error while freeing the iterator, probably bad iterator pointer.
5948 {-------------------------------------------------------------------------- }
5950 {-------------------------------------------------------------------------- }
5952 TOCITypeByName = function(env: POCIEnv; err: POCIError; const svc: POCISvcCtx;
5953 schema_name: Poratext; const s_length: ub4; const type_name: Poratext;
5954 const t_length: ub4; version_name: Poratext; const v_length: ub4;
5955 const pin_duration: OCIDuration; const get_option: OCITypeGetOpt;
5956 tdo: PPOCIType): sword; cdecl;
5959 NAME: OCITypeByName - OCI Get the most current version of an existing TYPe
5962 env (IN/OUT) - OCI environment handle initialized in object mode
5963 err (IN/OUT) - error handle. If there is an error, it is
5964 recorded in 'err' and this function returns OCI_ERROR.
5965 The error recorded in 'err' can be retrieved by calling
5967 svc (IN) - OCI service handle
5968 schema_name (IN, optional) - name of schema associated with the
5969 type. By default, the user's schema name is used.
5970 s_length (IN) - length of the 'schema_name' parameter
5971 type_name (IN) - name of the type to get
5972 t_length (IN) - length of the 'type_name' parameter
5973 version_name (IN, optional) - user readable version of the type.
5974 Pass (oratext *)0 for the most current version.
5975 v_length (IN) - length of version_name in bytes. Should be 0 if
5976 the most current version is to be retrieved.
5977 pin_duration (IN) - pin duration (e.g. until the end of current
5978 transaction). See 'oro.h' for a description of
5980 get_option (IN) - options for loading the types. It can be one of two
5982 OCI_TYPEGET_HEADER for only the header to be loaded, or
5983 OCI_TYPEGET_ALL for the TDO and all ADO and MDOs to be
5985 tdo (OUT) - pointer to the pinned type in the object cache
5987 Get a pointer to a version of the existing type associated
5988 with schema/type name.
5990 OCI_SUCCESS if the function completes successfully.
5991 OCI_INVALID_HANDLE if 'env' or 'err' is null.
5993 1) any of the required parameters is null.
5994 2) the adt type associated with schema/type name does not exist.
5996 Schema and type names are CASE-SENSITIVE. If they have been created
5997 via SQL, you need to use uppercase names.
5999 TOCITypeArrayByName = function(env: POCIEnv; err: POCIError; svc: POCISvcCtx;
6000 array_len: ub4; schema_name: PPoratext; s_length: Pub4;
6001 type_name: PPoratext; t_length: Pub4; version_name: PPoratext;
6002 v_length: Pub4; pin_duration: OCIDuration; get_option: OCITypeGetOpt;
6003 tdo: PPOCIType): sword; cdecl;
6006 NAME: OCITypeArrayByName - OCI Get array of TYPes by name.
6008 env (IN/OUT) - OCI environment handle initialized in object mode
6009 err (IN/OUT) - error handle. If there is an error, it is
6010 recorded in 'err' and this function returns OCI_ERROR.
6011 The error recorded in 'err' can be retrieved by calling
6013 svc (IN) - OCI service handle
6014 array_len (IN) - number of schema_name/type_name/version_name entries to
6016 schema_name (IN, optional) - array of schema names associated with the
6017 types to be retrieved. The array must have array_len
6018 elements if specified.
6019 If 0 is supplied, the default schema is assumed, otherwise
6020 it MUST have array_len number of elements.
6021 0 can be supplied for one or more of the entries to indicate
6022 that the default schema is desired for those entries.
6023 s_length (IN) - array of schema_name lengths with each entry
6024 corresponding to the length of the corresponding schema_name
6025 entry in the schema_name array in bytes.
6026 The array must either have array_len number of elements or
6027 it MUST be 0 if schema_name is not specified.
6028 type_name (IN) - array of the names of the types to retrieve. This
6029 MUST have array_len number of elements.
6030 t_length (IN) - array of the lengths of type names in the type_name
6032 version_name (IN) - array of the version names of the types to retrieve
6033 corresponding. This can be 0 to indicate retrieval of the
6034 most current versions, or it MUST have array_len number of
6036 If 0 is supplied, the most current version is assumed,
6037 otherwise it MUST have array_len number of elements.
6038 0 can be supplied for one or more of the entries to indicate
6039 that the current version is desired for those entries.
6040 v_length (IN) - array of the lengths of version names in the
6041 version_name array in bytes.
6042 pin_duration (IN) - pin duration (e.g. until the end of current
6043 transaction) for the types retreieve. See 'oro.h' for a
6044 description of each option.
6045 get_option (IN) - options for loading the types. It can be one of two
6047 OCI_TYPEGET_HEADER for only the header to be loaded, or
6048 OCI_TYPEGET_ALL for the TDO and all ADO and MDOs to be
6050 tdo (OUT) - output array for the pointers to each pinned type in the
6051 object cache. It must have space for array_len pointers.
6052 Use OCIObjectGetObjectRef() to obtain the CREF to each
6053 pinned type descriptor.
6055 Get pointers to the existing types associated with the schema/type name
6056 array. This is similar to OCITypeByName() except that all the TDO's are
6057 retreived via a single network roundtrip.
6059 OCI_SUCCESS if the function completes successfully.
6060 OCI_INVALID_HANDLE if 'env' or 'err' is null.
6062 1) any of the required parameters is null.
6063 2) one or more adt types associated with a schema/type name entry
6066 TOCITypeByRef = function(env: POCIEnv; err: POCIError; type_ref: POCIRef;
6067 pin_duration: OCIDuration; get_option: OCITypeGetOpt;
6068 tdo: PPOCIType): sword; cdecl;
6071 NAME: OCITypeArrayByRef - OCI Get array of TYPes by REF.
6073 env (IN/OUT) - OCI environment handle initialized in object mode
6074 err (IN/OUT) - error handle. If there is an error, it is
6075 recorded in 'err' and this function returns OCI_ERROR.
6076 The error recorded in 'err' can be retrieved by calling
6078 type_ref (IN) - OCIRef * pointing to the particular version of
6079 the type descriptor object to obtain.
6080 The array must have array_len elements if specified.
6081 pin_duration (IN) - pin duration (e.g. until the end of current
6082 transaction) for the type to retreieve. See 'oro.h' for a
6083 description of each option.
6084 get_option (IN) - options for loading the type. It can be one of two
6086 OCI_TYPEGET_HEADER for only the header to be loaded, or
6087 OCI_TYPEGET_ALL for the TDO and all ADO and MDOs to be
6089 tdo (OUT) - pointer to the pinned type in the object cache
6092 with the schema/type name array. This is similar to OCITypeByName()
6093 except that all the TDO's are retreived via a single network roundtrip.
6095 OCI_SUCCESS if the function completes successfully.
6096 OCI_INVALID_HANDLE if 'env' or 'err' is null.
6098 1) any of the required parameters is null.
6099 2) one or more adt types associated with a schema/type name entry
6102 TOCITypeArrayByRef = function(env: POCIEnv; err: POCIError; array_len: ub4;
6103 type_ref: PPOCIRef; pin_duration: OCIDuration; get_option: OCITypeGetOpt;
6104 tdo: PPOCIType): sword; cdecl;
6107 NAME: OCITypeArrayByRef - OCI Get array of TYPes by REF.
6109 env (IN/OUT) - OCI environment handle initialized in object mode
6110 err (IN/OUT) - error handle. If there is an error, it is
6111 recorded in 'err' and this function returns OCI_ERROR.
6112 The error recorded in 'err' can be retrieved by calling
6114 array_len (IN) - number of schema_name/type_name/version_name entries to
6116 type_ref (IN) - array of OCIRef * pointing to the particular version of
6117 the type descriptor object to obtain.
6118 The array must have array_len elements if specified.
6119 pin_duration (IN) - pin duration (e.g. until the end of current
6120 transaction) for the types retreieve. See 'oro.h' for a
6121 description of each option.
6122 get_option (IN) - options for loading the types. It can be one of two
6124 OCI_TYPEGET_HEADER for only the header to be loaded, or
6125 OCI_TYPEGET_ALL for the TDO and all ADO and MDOs to be
6127 tdo (OUT) - output array for the pointers to each pinned type in the
6128 object cache. It must have space for array_len pointers.
6129 Use OCIObjectGetObjectRef() to obtain the CREF to each
6130 pinned type descriptor.
6133 with the schema/type name array. This is similar to OCITypeByName()
6134 except that all the TDO's are retreived via a single network roundtrip.
6136 OCI_SUCCESS if the function completes successfully.
6137 OCI_INVALID_HANDLE if 'env' or 'err' is null.
6139 1) any of the required parameters is null.
6140 2) one or more adt types associated with a schema/type name entry
6143 {-------------------------------------------------------------------------- }
6145 {-------------------------------------------------------------------------- }
6146 {---------------------------- OCITypeName --------------------------------- }
6148 TOCITypeName = function(env: POCIEnv; err: POCIError; tdo: POCIType;
6149 n_length: Pub4): poratext; cdecl;
6152 NAME: OCITypeName - ORT Get a Type's naME.
6154 env (IN/OUT) - OCI environment handle initialized in object mode
6155 err (IN/OUT) - error handle. If there is an error, it is
6156 recorded in 'err' and this function returns OCI_ERROR.
6157 The error recorded in 'err' can be retrieved by calling
6159 tdo (IN) - pointer to to the type descriptor in the object cache
6160 n_length (OUT) - length (in bytes) of the returned type name. The
6161 caller must allocate space for the ub4 before calling this
6164 1) All type accessors require that the type be pinned before calling
6166 2) All input parameters must not be NULL and must be valid.
6167 3) 'n_length' must point to an allocated ub4.
6169 Get the name of the type.
6171 the name of the type
6173 The type descriptor, 'tdo', must be unpinned when the accessed
6174 information is no longer needed.
6176 {------------------------ OCITypeSchema --------------------------------- }
6178 TOCITypeSchema = function(env: POCIEnv; err: POCIError; const tdo: POCIType;
6179 n_length: Pub4): poratext; cdecl;
6182 NAME: OCITypeSchema - ORT Get a Type's SCHema name.
6184 env (IN/OUT) - OCI environment handle initialized in object mode
6185 err (IN/OUT) - error handle. If there is an error, it is
6186 recorded in 'err' and this function returns OCI_ERROR.
6187 The error recorded in 'err' can be retrieved by calling
6189 tdo (IN) - pointer to to the type descriptor in the object cache
6190 n_length (OUT) - length (in bytes) of the returned schema name. The
6191 caller must allocate space for the ub4 before calling this
6194 1) All type accessors require that the type be pinned before calling
6196 2) All input parameters must not be NULL and must be valid.
6197 3) 'n_length' must point to an allocated ub4.
6199 Get the schema name of the type.
6201 the schema name of the type
6203 The type descriptor, 'tdo', must be unpinned when the accessed
6204 information is no longer needed.
6206 {------------------------ OCITypeTypeCode --------------------------------- }
6208 TOCITypeTypeCode = function(env: POCIEnv; err: POCIError;
6209 const tdo: POCIType): OCITypeCode; cdecl;
6212 NAME: OCITypeTypeCode - OCI Get a Type's Type Code.
6214 env (IN/OUT) - OCI environment handle initialized in object mode
6215 err (IN/OUT) - error handle. If there is an error, it is
6216 recorded in 'err' and this function returns OCI_ERROR.
6217 The error recorded in 'err' can be retrieved by calling
6219 tdo (IN) - pointer to to the type descriptor in the object cache
6221 1) All type accessors require that the type be pinned before calling
6223 2) All input parameters must not be NULL and must be valid.
6225 Get the type code of the type.
6227 The type code of the type.
6229 The type descriptor, 'tdo', must be unpinned when the accessed
6230 information is no longer needed.
6232 {----------------------- OCITypeCollTypeCode ------------------------------- }
6234 TOCITypeCollTypeCode = function(env:POCIEnv; err:POCIError;
6235 const tdo: POCIType): OCITypeCode; cdecl;
6238 NAME: OCITypeCollTypeCode - OCI Get a Domain Type's Type Code.
6240 env (IN/OUT) - OCI environment handle initialized in object mode
6241 err (IN/OUT) - error handle. If there is an error, it is
6242 recorded in 'err' and this function returns OCI_ERROR.
6243 The error recorded in 'err' can be retrieved by calling
6245 tdo (IN) - pointer to to the type descriptor in the object cache
6247 1) All type accessors require that the type be pinned before calling
6249 2) All input parameters must not be NULL and must be valid.
6250 3) 'tdo' MUST point to a named collection type.
6252 Get the type code of the named collection type. For V8.0, named
6253 collection types can only be variable length arrays and nested tables.
6255 OCI_TYPECODE_VARRAY for variable length array, and
6256 OCI_TYPECODE_TABLE for nested tables.
6258 The type descriptor, 'tdo', should be unpinned when the accessed
6259 information is no longer needed.
6261 {------------------------- OCITypeVersion --------------------------------- }
6263 (* Const before type ignored *)
6264 TOCITypeVersion = function(env: POCIEnv; err: POCIError; const tdo: POCIType;
6265 v_length: Pub4): poratext; cdecl;
6268 NAME: OCITypeVersion - OCI Get a Type's user-readable VersioN.
6270 env (IN/OUT) - OCI environment handle initialized in object mode
6271 err (IN/OUT) - error handle. If there is an error, it is
6272 recorded in 'err' and this function returns OCI_ERROR.
6273 The error recorded in 'err' can be retrieved by calling
6275 tdo (IN) - pointer to to the type descriptor in the object cache
6276 v_length (OUT) - length (in bytes) of the returned user-readable
6277 version. The caller must allocate space for the ub4 before
6278 calling this routine.
6280 1) All type accessors require that the type be pinned before calling
6282 2) All input parameters must not be NULL and must be valid.
6283 3) 'v_length' must point to an allocated ub4.
6285 Get the user-readable version of the type.
6287 The user-readable version of the type
6289 The type descriptor, 'tdo', must be unpinned when the accessed
6290 information is no longer needed.
6292 {--------------------------- OCITypeAttrs --------------------------------- }
6294 TOCITypeAttrs = function(env: POCIEnv; err: POCIError;
6295 const tdo:POCIType): ub4; cdecl;
6298 NAME: OCITypeAttrs - OCI Get a Type's Number of Attributes.
6300 env (IN/OUT) - OCI environment handle initialized in object mode
6301 err (IN/OUT) - error handle. If there is an error, it is
6302 recorded in 'err' and this function returns OCI_ERROR.
6303 The error recorded in 'err' can be retrieved by calling
6305 tdo (IN) - pointer to to the type descriptor in the object cache
6307 1) All type accessors require that the type be pinned before calling
6309 2) All input parameters must not be NULL and must be valid.
6311 Get the number of attributes in the type.
6313 The number of attributes in the type. 0 for ALL non-ADTs.
6315 The type descriptor, 'tdo', must be unpinned when the accessed
6316 information is no longer needed.
6318 {------------------------- OCITypeMethods --------------------------------- }
6320 TOCITypeMethods = function(env: POCIEnv; err: POCIError;
6321 const tdo: POCIType): ub4; cdecl;
6324 NAME: OCITypeMethods - OCI Get a Type's Number of Methods.
6326 env (IN/OUT) - OCI environment handle initialized in object mode
6327 err (IN/OUT) - error handle. If there is an error, it is
6328 recorded in 'err' and this function returns OCI_ERROR.
6329 The error recorded in 'err' can be retrieved by calling
6331 tdo (IN) - pointer to to the type descriptor in the object cache
6333 1) All type accessors require that the type be pinned before calling
6335 2) All input parameters must not be NULL and must be valid.
6337 Get the number of methods in a type.
6339 The number of methods in the type
6341 The type descriptor, 'tdo', must be unpinned when the accessed
6342 information is no longer needed.
6344 {-------------------------------------------------------------------------- }
6345 { TYPE ELEMENT INFORMATION ACCESSORS }
6346 {-------------------------------------------------------------------------- }
6347 {------------------------ OCITypeElemName --------------------------------- }
6349 TOCITypeElemName = function(env: POCIEnv; err: POCIError;
6350 const elem: POCITypeElem; n_length:Pub4): poratext; cdecl;
6353 NAME: OCITypeElemName - OCI Get an Attribute's NaMe.
6355 env (IN/OUT) - OCI environment handle initialized in object mode
6356 err (IN/OUT) - error handle. If there is an error, it is
6357 recorded in 'err' and this function returns OCI_ERROR.
6358 The error recorded in 'err' can be retrieved by calling
6360 elem (IN) - pointer to the type element descriptor in the object cache
6361 n_length (OUT) - length (in bytes) of the returned attribute name.
6362 The caller must allocate space for the ub4 before calling this
6365 1) All type accessors require that the type be pinned before calling
6367 2) All input parameters must not be NULL and must be valid.
6368 3) 'n_length' must point to an allocated ub4.
6370 Get the name of the attribute.
6372 the name of the attribute and the length in n_length
6374 The type must be unpinned when the accessed information is no
6377 {------------------------ OCITypeElemTypeCode ------------------------------ }
6379 TOCITypeElemTypeCode = function(env: POCIEnv; err: POCIError;
6380 const elem: POCITypeElem): OCITypeCode; cdecl;
6383 NAME: OCITypeElemTypeCode - OCI Get an Attribute's TypeCode.
6385 env (IN/OUT) - OCI environment handle initialized in object mode
6386 err (IN/OUT) - error handle. If there is an error, it is
6387 recorded in 'err' and this function returns OCI_ERROR.
6388 The error recorded in 'err' can be retrieved by calling
6390 elem (IN) - pointer to the type element descriptor in the object cache
6392 1) All type accessors require that the type be pinned before calling
6394 2) All input parameters must not be NULL and must be valid.
6396 Get the typecode of an attribute's type.
6398 the typecode of the attribute's type. If this is a scalar type, the
6399 typecode sufficiently describes the scalar type and no further calls
6400 need to be made. Valid scalar types include: OCI_TYPECODE_SIGNED8,
6401 OCI_TYPECODE_UNSIGNED8, OCI_TYPECODE_SIGNED16, OCI_TYPECODE_UNSIGNED16,
6402 OCI_TYPECODE_SIGNED32, OCI_TYPECODE_UNSIGNED32, OCI_TYPECODE_REAL,
6403 OCI_TYPECODE_DOUBLE, OCI_TYPECODE_DATE,
6404 OCI_TYPECODE_MLSLABEL, OROTCOID, OCI_TYPECODE_OCTET, or OROTCLOB.
6405 This function converts the CREF (stored in the attribute) into a
6408 The type must be unpinned when the accessed information is no
6411 {------------------------ OCITypeElemType --------------------------------- }
6413 TOCITypeElemType = function(env: POCIEnv; err: POCIError;
6414 const elem: POCITypeElem; elem_tdo:PPOCIType): sword; cdecl;
6418 env (IN/OUT) - OCI environment handle initialized in object mode
6419 err (IN/OUT) - error handle. If there is an error, it is
6420 recorded in 'err' and this function returns OCI_ERROR.
6421 The error recorded in 'err' can be retrieved by calling
6423 elem (IN) - pointer to the type element descriptor in the object cache
6424 elem_tdo (OUT) - If the function completes successfully, 'elem_tdo'
6425 points to the type descriptor (in the object cache) of the type of
6429 1) All type accessors require that the type be pinned before calling
6430 any accessor. This can be done by calling 'OCITypeByName()'.
6431 2) if 'elem' is not null, it must point to a valid type element descriptor
6432 in the object cache.
6435 Get the type tdo of the type of this element.
6437 OCI_SUCCESS if the function completes successfully.
6438 OCI_INVALID_HANDLE if 'env' or 'err' is null.
6440 1) any of the parameters is null.
6443 The type must be unpinned when the accessed information is no
6444 longer needed. This can be done by calling 'OCIObjectUnpin()'.
6446 {------------------------- OCITypeElemFlags ------------------------------- }
6448 TOCITypeElemFlags = function(env: POCIEnv; err: POCIError;
6449 const elem: POCITypeElem): ub4; cdecl;
6452 NAME: OCITypeElemFlags - OCI Get a Elem's FLags
6453 (inline, constant, virtual, constructor,
6456 env (IN/OUT) - OCI environment handle initialized in object mode
6457 err (IN/OUT) - error handle. If there is an error, it is
6458 recorded in 'err' and this function returns OCI_ERROR.
6459 The error recorded in 'err' can be retrieved by calling
6461 elem (IN) - pointer to the type element descriptor in the object cache
6463 1) All type accessors require that the type be pinned before calling
6465 2) All input parameters must not be NULL and must be valid.
6467 Get the flags of a type element (attribute, parameter).
6469 The flags of the type element.
6471 The flag bits are not externally documented. Use only the macros
6472 in the last section (ie. OCI_TYPEPARAM_IS_REQUIRED, and
6473 OCI_TYPEELEM_IS_REF) to test for them only. The type must be unpinned
6474 when the accessed information is no longer needed.
6476 {------------------------ OCITypeElemNumPrec ------------------------------ }
6478 TOCITypeElemNumPrec = function(env: POCIEnv; err: POCIError;
6479 const elem: POCITypeElem): ub1; cdecl;
6482 NAME: OCITypeElemNumPrec - Get a Number's Precision. This includes float,
6483 decimal, real, double, and oracle number.
6485 env (IN/OUT) - OCI environment handle initialized in object mode
6486 err (IN/OUT) - error handle. If there is an error, it is
6487 recorded in 'err' and this function returns OCI_ERROR.
6488 The error recorded in 'err' can be retrieved by calling
6490 elem (IN) - pointer to the type element descriptor in the object cache
6492 All input parameters must not be NULL and must be valid.
6494 Get the precision of a float, decimal, long, unsigned long, real,
6495 double, or Oracle number type.
6497 the precision of the float, decimal, long, unsigned long, real, double,
6500 {------------------------- OCITypeElemNumScale ----------------------------- }
6502 TOCITypeElemNumScale = function(env: POCIEnv; err: POCIError;
6503 const elem: POCITypeElem): sb1; cdecl;
6506 NAME: OCITypeElemNumScale - Get a decimal or oracle Number's Scale
6508 env (IN/OUT) - OCI environment handle initialized in object mode
6509 err (IN/OUT) - error handle. If there is an error, it is
6510 recorded in 'err' and this function returns OCI_ERROR.
6511 The error recorded in 'err' can be retrieved by calling
6513 elem (IN) - pointer to the type element descriptor in the object cache
6515 All input parameters must not be NULL and must be valid.
6517 Get the scale of a decimal, or Oracle number type.
6519 the scale of the decimal, or Oracle number
6521 {------------------------ OCITypeElemLength ------------------------------- }
6523 TOCITypeElemLength = function(env: POCIEnv; err: POCIError;
6524 const elem:POCITypeElem): ub4; cdecl;
6527 NAME: OCITypeElemLength - Get a raw, fixed or variable length String's
6530 env (IN/OUT) - OCI environment handle initialized in object mode
6531 err (IN/OUT) - error handle. If there is an error, it is
6532 recorded in 'err' and this function returns OCI_ERROR.
6533 The error recorded in 'err' can be retrieved by calling
6535 elem (IN) - pointer to the type element descriptor in the object cache
6537 All input parameters must not be NULL and must be valid.
6539 Get the length of a raw, fixed or variable length string type.
6541 length of the raw, fixed or variable length string
6543 {----------------------- OCITypeElemCharSetID ----------------------------- }
6545 TOCITypeElemCharSetID = function(env: POCIEnv; err: POCIError;
6546 const elem: POCITypeElem): ub2; cdecl;
6549 NAME: OCITypeElemCharSetID - Get a fixed or variable length String's
6552 env (IN/OUT) - OCI environment handle initialized in object mode
6553 err (IN/OUT) - error handle. If there is an error, it is
6554 recorded in 'err' and this function returns OCI_ERROR.
6555 The error recorded in 'err' can be retrieved by calling
6557 elem (IN) - pointer to the type element descriptor in the object cache
6559 All input parameters must not be NULL and must be valid.
6561 Get the character set ID of a fixed or variable length string type.
6563 character set ID of the fixed or variable length string
6565 {---------------------- OCITypeElemCharSetForm ---------------------------- }
6567 TOCITypeElemCharSetForm = function(env: POCIEnv; err: POCIError;
6568 const elem: POCITypeElem): ub2; cdecl;
6571 NAME: OCITypeElemCharSetForm - Get a fixed or variable length String's
6572 character set specification form.
6574 env (IN/OUT) - OCI environment handle initialized in object mode
6575 err (IN/OUT) - error handle. If there is an error, it is
6576 recorded in 'err' and this function returns OCI_ERROR.
6577 The error recorded in 'err' can be retrieved by calling
6579 elem (IN) - pointer to the attribute information in the object cache
6581 All input parameters must not be NULL and must be valid.
6583 Get the character form of a fixed or variable length string type.
6584 The character form is an enumerated value that can be one of the
6586 SQLCS_IMPLICIT for CHAR, VARCHAR2, CLOB w/o a specified set
6587 SQLCS_NCHAR for NCHAR, NCHAR VARYING, NCLOB
6588 SQLCS_EXPLICIT for CHAR, etc, with "CHARACTER SET ..." syntax
6589 SQLCS_FLEXIBLE for PL/SQL "flexible" parameters
6591 character form of the fixed or variable string
6593 {--------------------- OCITypeElemParameterizedType ------------------------ }
6595 TOCITypeElemParameterizedType = function(env: POCIEnv; err: POCIError;
6596 const elem: POCITypeElem; type_stored: PPOCIType): sword; cdecl;
6599 NAME: OCITypeElemParameterizedType
6601 env (IN/OUT) - OCI environment handle initialized in object mode
6602 err (IN/OUT) - error handle. If there is an error, it is
6603 recorded in 'err' and this function returns OCI_ERROR.
6604 The error recorded in 'err' can be retrieved by calling
6606 elem (IN) - pointer to the type element descriptor in the object cache
6607 type_stored (OUT) - If the function completes successfully,
6608 and the parameterized type is complex, 'type_stored' is NULL.
6609 Otherwise, 'type_stored' points to the type descriptor (in the
6610 object cache) of the type that is stored in the parameterized
6611 type. The caller must allocate space for the OCIType*
6612 before calling this routine and must not write into the space.
6614 All input parameters must be valid.
6616 Get a descriptor to the parameter type of a parameterized type.
6617 Parameterized types are types of the form:
6620 etc, where T is the parameter in the parameterized type.
6621 Additionally is_ref is set if the parameter is a PTR or REF.
6622 For example, it is set for REF T or VARRAY(n) OF REF T.
6624 OCI_SUCCESS if the function completes successfully.
6625 OCI_INVALID_HANDLE if 'env' or 'err' is null.
6627 1) any of the parameters is null.
6628 2) 'type_stored' is not NULL but points to NULL data.
6630 Complex parameterized types will be in a future release (once
6631 typedefs are supported. When setting the parameterized type
6632 information, the user must typedef the contents if it's a
6633 complex parameterized type. Ex. for varray<varray<car>>, use
6634 'typedef varray<car> varcar' and then use varray<varcar>.
6636 {----------------------- OCITypeElemExtTypeCode ---------------------------- }
6638 TOCITypeElemExtTypeCode = function(env: POCIEnv; err: POCIError;
6639 const elem: POCITypeElem): OCITypeCode; cdecl;
6642 NAME: OCITypeElemExtTypeCode - OCI Get an element's SQLT constant.
6644 env (IN/OUT) - OCI environment handle initialized in object mode
6645 err (IN/OUT) - error handle. If there is an error, it is
6646 recorded in 'err' and this function returns OCI_ERROR.
6647 The error recorded in 'err' can be retrieved by calling
6649 elem (IN) - pointer to the type element descriptor in the object cache
6651 1) All type accessors require that the type be pinned before calling
6653 2) All input parameters must not be NULL and must be valid.
6655 Get the internal Oracle typecode associated with an attribute's type.
6656 This is the actual typecode for the attribute when it gets mapped
6657 to a column in the Oracle database.
6659 The Oracle typecode associated with the attribute's type.
6661 The type must be unpinned when the accessed information is no
6664 {-------------------------------------------------------------------------- }
6665 { ATTRIBUTE ACCESSORS }
6666 {-------------------------------------------------------------------------- }
6667 {------------------------ OCITypeAttrByName ------------------------------- }
6669 TOCITypeAttrByName = function(env: POCIEnv; err: POCIError;
6670 const tdo: POCIType; const name: Poratext; const n_length: ub4;
6671 elem: PPOCITypeElem): sword; cdecl;
6674 NAME: OCITypeAttrByName - OCI Get an Attribute By Name.
6676 env (IN/OUT) - OCI environment handle initialized in object mode
6677 err (IN/OUT) - error handle. If there is an error, it is
6678 recorded in 'err' and this function returns OCI_ERROR.
6679 The error recorded in 'err' can be retrieved by calling
6681 tdo (IN) - pointer to to the type descriptor in the object cache
6682 name (IN) - the attribute's name
6683 n_length (IN) - length (in bytes) of the 'name' parameter
6684 elem (OUT) - If this function completes successfully, 'elem' points to
6685 the selected type element descriptor pertaining to the
6686 attributein the object cache.
6688 1) All type accessors require that the type be pinned before calling
6690 2) if 'tdo' is not null, it must point to a valid type descriptor
6691 in the object cache.
6693 Get an attribute given its name.
6695 OCI_SUCCESS if the function completes successfully.
6696 OCI_INVALID_HANDLE if 'env' or 'err' is null.
6698 1) any of the required parameters is null.
6699 2) the type does not contain an attribute with the input 'name'.
6702 The type descriptor, 'tdo', must be unpinned when the accessed
6703 information is no longer needed.
6704 Schema and type names are CASE-SENSITIVE. If they have been created
6705 via SQL, you need to use uppercase names.
6707 {------------------------ OCITypeAttrNext --------------------------------- }
6709 TOCITypeAttrNext = function(env: POCIEnv; err: POCIError;
6710 iterator_ort: POCITypeIter; elem: PPOCITypeElem): sword; cdecl;
6713 NAME: OCITypeAttrNext - OCI Get an Attribute By Iteration.
6715 env (IN/OUT) - OCI environment handle initialized in object mode
6716 err (IN/OUT) - error handle. If there is an error, it is
6717 recorded in 'err' and this function returns OCI_ERROR.
6718 The error recorded in 'err' can be retrieved by calling
6720 iterator_ort (IN/OUT) - iterator for retrieving the next attribute;
6721 see OCITypeIterNew() to initialize iterator.
6722 elem (OUT) - If this function completes successfully, 'elem' points to
6723 the selected type element descriptor pertaining to the
6724 attributein the object cache.
6726 1) All type accessors require that the type be pinned before calling
6728 2) if 'tdo' is not null, it must point to a valid type descriptor
6729 in the object cache.
6731 Iterate to the next attribute to retrieve.
6733 OCI_SUCCESS if the function completes successfully.
6734 OCI_NO_DATA if there are no more attributes to iterate on; use
6735 OCITypeIterSet() to reset the iterator if necessary.
6736 OCI_INVALID_HANDLE if 'env' or 'err' is null.
6738 1) any of the required parameters is null.
6740 The type must be unpinned when the accessed information is no
6743 {-------------------------------------------------------------------------- }
6744 { COLLECTION ACCESSORS }
6745 {-------------------------------------------------------------------------- }
6746 {------------------------ OCITypeCollElem --------------------------------- }
6748 TOCITypeCollElem = function(env: POCIEnv; err: POCIError; const tdo:POCIType;
6749 element: PPOCITypeElem): sword; cdecl;
6752 NAME: OCITypeCollElem
6754 env (IN/OUT) - OCI environment handle initialized in object mode
6755 err (IN/OUT) - error handle. If there is an error, it is
6756 recorded in 'err' and this function returns OCI_ERROR.
6757 The error recorded in 'err' can be retrieved by calling
6759 tdo (IN) - pointer to the type descriptor in the object cache
6760 element (IN/OUT) - If the function completes successfully, this
6761 points to the descriptor for the collection's element.
6762 It is stored in the same format as an ADT attribute's
6764 If *element is NULL, OCITypeCollElem() implicitly allocates a
6765 new instance of OCITypeElem in the object cache. This instance
6767 automatically freed at the end of the session, and does not have
6768 to be freed explicitly.
6769 If *element is not NULL, OCITypeCollElem() assumes that it
6770 points to a valid OCITypeElem descriptor and will copy the
6773 All input parameters must be valid.
6775 Get a pointer to the descriptor (OCITypeElem) of the element of an
6776 array or the rowtype of a nested table.
6778 OCI_SUCCESS if the function completes successfully.
6779 OCI_INVALID_HANDLE if 'env' or 'err' is null.
6781 1) any of the parameters is null.
6782 2) the type TDO does not point to a valid collection's type.
6784 Complex parameterized types will be in a future release (once
6785 typedefs are supported. When setting the parameterized type
6786 information, the user must typedef the contents if it's a
6787 complex parameterized type. Ex. for varray<varray<car>>, use
6788 'typedef varray<car> varcar' and then use varray<varcar>.
6790 {------------------------ OCITypeCollSize --------------------------------- }
6792 TOCITypeCollSize = function(env: POCIEnv; err: POCIError; const tdo: POCIType;
6793 num_elems: Pub4): sword; cdecl;
6796 NAME: OCITypeCollSize - OCI Get a Collection's Number of Elements.
6798 env (IN/OUT) - OCI environment handle initialized in object mode
6799 err (IN/OUT) - error handle. If there is an error, it is
6800 recorded in 'err' and this function returns OCI_ERROR.
6801 The error recorded in 'err' can be retrieved by calling
6803 tdo (IN) - pointer to the type descriptor in the object cache
6804 num_elems (OUT) - number of elements in collection
6806 All input parameters must be valid. tdo points to an array type
6807 defined as a domain.
6809 Get the number of elements stored in a fixed array or the maximum
6810 number of elements in a variable array.
6812 OCI_SUCCESS if the function completes successfully.
6813 OCI_INVALID_HANDLE if 'env' or 'err' is null.
6815 1) any of the parameters is null.
6816 2) 'tdo' does not point to a domain with a collection type.
6818 Complex parameterized types will be in a future release (once
6819 typedefs are supported. When setting the parameterized type
6820 information, the user must typedef the contents if it's a
6821 complex parameterized type. Ex. for varray<varray<car>>, use
6822 'typedef varray<car> varcar' and then use varray<varcar>.
6824 {------------------------ OCITypeCollExtTypeCode --------------------------- }
6826 TOCITypeCollExtTypeCode = function(env: POCIEnv; err: POCIError;
6827 const tdo:POCIType; sqt_code: POCITypeCode): sword; cdecl;
6830 NAME: ortcsqt - OCI Get a Collection element's DTY constant.
6832 env (IN/OUT) - OCI environment handle initialized in object mode
6833 err (IN/OUT) - error handle. If there is an error, it is
6834 recorded in 'err' and this function returns OCI_ERROR.
6835 The error recorded in 'err' can be retrieved by calling
6837 tdo (IN) - pointer to the type descriptor in the object cache
6838 sqt_code (OUT) - SQLT code of type element.
6840 1) All type accessors require that the type be pinned before calling
6842 2) All input parameters must not be NULL and must be valid.
6844 Get the SQLT constant associated with an domain's element type.
6845 The SQLT codes are defined in <sqldef.h> and are needed for OCI/OOCI
6848 OCI_SUCCESS if the function completes successfully.
6849 OCI_INVALID_HANDLE if 'env' or 'err' is null.
6851 1) any of the parameters is null.
6852 2) 'tdo' does not point to a domain with a collection type.
6854 The type must be unpinned when the accessed information is no
6857 {-------------------------------------------------------------------------- }
6858 { METHOD ACCESSORS }
6859 {-------------------------------------------------------------------------- }
6860 {------------------------- OCITypeMethodOverload -------------------------- }
6862 TOCITypeMethodOverload = function(env: POCIEnv; err: POCIError;
6863 const tdo: POCIType; const method_name: Poratext;
6864 const m_length: ub4): ub4; cdecl;
6867 NAME: OCITypeMethodOverload - OCI Get type's Number of Overloaded names
6868 for the given method name.
6870 gp (IN/OUT) - pga environment handle. Any errors are recorded here.
6871 tdo (IN) - pointer to to the type descriptor in the object cache
6872 method_name (IN) - the method's name
6873 m_length (IN) - length (in bytes) of the 'method_name' parameter
6875 1) All type accessors require that the type be pinned before calling
6877 2) if 'tdo' is not null, it must point to a valid type descriptor
6878 in the object cache.
6880 Overloading of methods implies that more than one method may have the
6881 same method name. This routine returns the number of methods that
6882 have the given method name. If there are no methods with the input
6883 method name, 'num_methods' is 0. The caller uses this information when
6884 allocating space for the array of mdo and/or position pointers before
6885 calling 'OCITypeMethodByName()' or 'ortgmps()'.
6887 The number of methods with the given name. 0 if none contains the
6890 Schema and type names are CASE-SENSITIVE. If they have been created
6891 via SQL, you need to use uppercase names.
6893 {------------------------ OCITypeMethodByName ------------------------------ }
6895 TOCITypeMethodByName = function(env: POCIEnv; err: POCIError;
6896 const tdo: POCIType; const method_name: Poratext; const m_length: ub4;
6897 mdos: PPOCITypeMethod): sword; cdecl;
6900 NAME: OCITypeMethodByName - OCI Get one or more Methods with Name.
6902 env (IN/OUT) - OCI environment handle initialized in object mode
6903 err (IN/OUT) - error handle. If there is an error, it is
6904 recorded in 'err' and this function returns OCI_ERROR.
6905 The error recorded in 'err' can be retrieved by calling
6907 tdo (IN) - pointer to to the type descriptor in the object cache
6908 method_name (IN) - the methods' name
6909 m_length (IN) - length (in bytes) of the 'name' parameter
6910 mdos (OUT) - If this function completes successfully, 'mdos' points to
6911 the selected methods in the object cache. The caller must
6912 allocate space for the array of OCITypeMethod pointers before
6913 calling this routine and must not write into the space.
6914 The number of OCITypeMethod pointers that will be returned can
6915 be obtained by calling 'OCITypeMethodOverload()'.
6917 1) All type accessors require that the type be pinned before calling
6919 2) if 'tdo' is not null, it must point to a valid type descriptor
6920 in the object cache.
6922 Get one or more methods given the name.
6924 OCI_SUCCESS if the function completes successfully.
6925 OCI_INVALID_HANDLE if 'env' or 'err' is null.
6927 1) any of the required parameters is null.
6928 2) No methods in type has name 'name'.
6929 3) 'mdos' is not NULL but points to NULL data.
6931 The type must be unpinned when the accessed information is no
6933 Schema and type names are CASE-SENSITIVE. If they have been created
6934 via SQL, you need to use uppercase names.
6936 {------------------------ OCITypeMethodNext -------------------------------- }
6938 TOCITypeMethodNext = function(env: POCIEnv; err: POCIError;
6939 iterator_ort: POCITypeIter; mdo: PPOCITypeMethod): sword; cdecl;
6942 NAME: OCITypeMethodNext - OCI Get a Method By Iteration.
6944 env (IN/OUT) - OCI environment handle initialized in object mode
6945 err (IN/OUT) - error handle. If there is an error, it is
6946 recorded in 'err' and this function returns OCI_ERROR.
6947 The error recorded in 'err' can be retrieved by calling
6949 iterator_ort (IN/OUT) - iterator for retrieving the next method;
6950 see OCITypeIterNew() to set iterator.
6951 mdo (OUT) - If this function completes successfully, 'mdo' points to
6952 the selected method descriptor in the object cache. Positions
6953 start at 1. The caller must allocate space for the
6954 OCITypeMethod* before calling this routine and must not write
6957 1) All type accessors require that the type be pinned before calling
6959 2) if 'tdo' is not null, it must point to a valid type descriptor
6960 in the object cache.
6962 Iterate to the next method to retrieve.
6964 OCI_SUCCESS if the function completes successfully.
6965 OCI_NO_DATA if there are no more attributes to iterate on; use
6966 OCITypeIterSet() to reset the iterator if necessary.
6967 OCI_INVALID_HANDLE if 'env' or 'err' is null.
6969 1) any of the required parameters is null.
6970 2) 'mdo' is not NULL but points to NULL data.
6972 The type must be unpinned when the accessed information is no
6975 {------------------------ OCITypeMethodName -------------------------------- }
6977 TOCITypeMethodName = function(env:POCIEnv; err: POCIError;
6978 const mdo: POCITypeMethod; n_length: Pub4): poratext; cdecl;
6980 NAME: OCITypeMethodName - OCI Get a Method's NaMe.
6982 env (IN/OUT) - OCI environment handle initialized in object mode
6983 err (IN/OUT) - error handle. If there is an error, it is
6984 recorded in 'err' and this function returns OCI_ERROR.
6985 The error recorded in 'err' can be retrieved by calling
6987 mdo (IN) - pointer to the method descriptor in the object cache
6988 n_length (OUT) - length (in bytes) of the 'name' parameter. The caller
6989 must allocate space for the ub4 before calling this routine.
6991 1) All type accessors require that the type be pinned before calling
6993 2) All input parameters must not be NULL and must be valid.
6995 Get the (non-unique) real name of the method.
6997 the non-unique name of the method or NULL if there is an error.
6999 The type must be unpinned when the accessed information is no
7002 {------------------------ OCITypeMethodEncap ------------------------------- }
7004 TOCITypeMethodEncap = function(env: POCIEnv; err: POCIError;
7005 const mdo: POCITypeMethod): OCITypeEncap; cdecl;
7008 NAME: OCITypeMethodEncap - Get a Method's ENcapsulation (private/public).
7010 env (IN/OUT) - OCI environment handle initialized in object mode
7011 err (IN/OUT) - error handle. If there is an error, it is
7012 recorded in 'err' and this function returns OCI_ERROR.
7013 The error recorded in 'err' can be retrieved by calling
7015 mdo (IN) - pointer to the method descriptor in the object cache
7017 1) All type accessors require that the type be pinned before calling
7019 2) All input parameters must not be NULL and must be valid.
7021 Get the encapsulation (private, or public) of a method.
7023 the encapsulation (private, or public) of the method
7025 The type must be unpinned when the accessed information is no
7028 {------------------------ OCITypeMethodFlags ------------------------------- }
7030 TOCITypeMethodFlags = function(env: POCIEnv; err: POCIError;
7031 const mdo:POCITypeMethod): OCITypeMethodFlag; cdecl;
7034 NAME: OCITypeMethodFlags - OCI Get a Method's FLags
7035 (inline, constant, virtual, constructor,
7038 env (IN/OUT) - OCI environment handle initialized in object mode
7039 err (IN/OUT) - error handle. If there is an error, it is
7040 recorded in 'err' and this function returns OCI_ERROR.
7041 The error recorded in 'err' can be retrieved by calling
7043 mdo (IN) - pointer to the method descriptor in the object cache
7045 1) All type accessors require that the type be pinned before calling
7047 2) All input parameters must not be NULL and must be valid.
7049 Get the flags (inline, constant, virutal, constructor, destructor) of
7052 the flags (inline, constant, virutal, constructor, destructor) of
7055 The type must be unpinned when the accessed information is no
7058 {------------------------ OCITypeMethodMap --------------------------------- }
7060 TOCITypeMethodMap = function(env: POCIEnv; err: POCIError; const tdo: POCIType;
7061 mdo: PPOCITypeMethod): sword; cdecl;
7064 NAME: OCITypeMethodMap - OCI Get the Method's MAP function.
7066 env (IN/OUT) - OCI environment handle initialized in object mode
7067 err (IN/OUT) - error handle. If there is an error, it is
7068 recorded in 'err' and this function returns OCI_ERROR.
7069 The error recorded in 'err' can be retrieved by calling
7071 tdo (IN) - pointer to to the type descriptor in the object cache
7072 mdo (OUT) - If this function completes successfully, and there is a
7073 map function for this type, 'mdo' points to the selected method
7074 descriptor in the object cache. Otherwise, 'mdo' is null.
7076 1) All type accessors require that the type be pinned before calling
7078 2) All required input parameters must not be NULL and must be valid.
7080 A type may have only one map function. 'OCITypeMethodMap()' finds
7081 this function, if it exists, and returns a reference and a pointer to
7082 the method descriptor in the object cache. If the type does not have a
7083 map (relative ordering) function, then 'mdo_ref' and 'mdo' are set
7084 to null and an error is returned.
7086 OCI_SUCCESS if the function completes successfully.
7087 OCI_INVALID_HANDLE if 'env' or 'err' is null.
7089 the type does not contain a map function.
7091 The type must be unpinned when the accessed information is no
7094 {------------------------ OCITypeMethodOrder ------------------------------- }
7096 TOCITypeMethodOrder = function(env: POCIEnv; err: POCIError;
7097 const tdo: POCIType; mdo: PPOCITypeMethod): sword; cdecl;
7100 NAME: OCITypeMethodOrder - OCI Get the Method's ORder function.
7102 env (IN/OUT) - OCI environment handle initialized in object mode
7103 err (IN/OUT) - error handle. If there is an error, it is
7104 recorded in 'err' and this function returns OCI_ERROR.
7105 The error recorded in 'err' can be retrieved by calling
7107 tdo (IN) - pointer to to the type descriptor in the object cache
7108 mdo (OUT) - If this function completes successfully, and there is a
7109 map function for this type, 'mdo' points to the selected method
7110 descriptor in the object cache. Otherwise, 'mdo' is null.
7112 1) All type accessors require that the type be pinned before calling
7114 2) All required input parameters must not be NULL and must be valid.
7116 A type may have only one ORder or MAP function. 'OCITypeMethodOrder()'
7117 finds this function, if it exists, and returns a ref and a pointer
7118 to the method descriptor in the object cache. If the type does not
7119 have a map (relative ordering) function, then 'mdo_ref' and 'mdo' are
7120 set to null and an error is returned.
7122 OCI_SUCCESS if the function completes successfully.
7123 OCI_INVALID_HANDLE if 'env' or 'err' is null.
7125 the type does not contain a map function.
7127 The type must be unpinned when the accessed information is no
7130 {------------------------ OCITypeMethodParams ------------------------------ }
7132 TOCITypeMethodParams = function(env: POCIEnv; err: POCIError;
7133 const mdo: POCITypeMethod): ub4; cdecl;
7136 NAME: OCITypeMethodParams - OCI Get a Method's Number of Parameters.
7138 env (IN/OUT) - OCI environment handle initialized in object mode
7139 err (IN/OUT) - error handle. If there is an error, it is
7140 recorded in 'err' and this function returns OCI_ERROR.
7141 The error recorded in 'err' can be retrieved by calling
7143 mdo (IN) - pointer to the method descriptor in the object cache
7145 1) All type accessors require that the type be pinned before calling
7147 2) All input parameters must not be NULL and must be valid.
7149 Get the number of parameters in a method.
7151 the number of parameters in the method
7153 The type must be unpinned when the accessed information is no
7156 {-------------------------------------------------------------------------- }
7157 { RESULT ACCESSORS }
7158 {-------------------------------------------------------------------------- }
7159 {-------------------------- OCITypeResult --------------------------------- }
7161 TOCITypeResult = function(env: POCIEnv; err: POCIError;
7162 const mdo: POCITypeMethod; elem: PPOCITypeElem): sword; cdecl;
7165 NAME: OCITypeResult - OCI Get a method's result type descriptor.
7167 env (IN/OUT) - OCI environment handle initialized in object mode
7168 err (IN/OUT) - error handle. If there is an error, it is
7169 recorded in 'err' and this function returns OCI_ERROR.
7170 The error recorded in 'err' can be retrieved by calling
7172 mdo (IN) - pointer to the method descriptor in the object cache
7173 elem (OUT) - If this function completes successfully, 'rdo' points to
7174 the selected result (parameter) descriptor in the object cache.
7176 1) All type accessors require that the type be pinned before calling
7178 2) 'elem' MUST be the address of an OCITypeElem pointer.
7180 Get the result of a method.
7182 OCI_SUCCESS if the function completes successfully.
7183 OCI_INVALID_HANDLE if 'env' or 'err' is null.
7185 1) any of the required parameters is null.
7186 2) method returns no results.
7188 The method must be unpinned when the accessed information is no
7191 {-------------------------------------------------------------------------- }
7192 { PARAMETER ACCESSORS }
7193 {-------------------------------------------------------------------------- }
7194 {------------------------ OCITypeParamByPos ------------------------------- }
7196 TOCITypeParamByPos = function(env: POCIEnv; err: POCIError;
7197 const mdo: POCITypeMethod; const position: ub4;
7198 elem: PPOCITypeElem): sword; cdecl;
7201 NAME: OCITypeParamByPos - OCI Get a Parameter in a method By Position.
7203 env (IN/OUT) - OCI environment handle initialized in object mode
7204 err (IN/OUT) - error handle. If there is an error, it is
7205 recorded in 'err' and this function returns OCI_ERROR.
7206 The error recorded in 'err' can be retrieved by calling
7208 mdo (IN) - pointer to the method descriptor in the object cache
7209 position (IN) - the parameter's position. Positions start at 1.
7210 elem (OUT) - If this function completes successfully, 'elem' points to
7211 the selected parameter descriptor in the object cache.
7213 1) All type accessors require that the type be pinned before calling
7216 Get a parameter given its position in the method. Positions start
7219 OCI_SUCCESS if the function completes successfully.
7220 OCI_INVALID_HANDLE if 'env' or 'err' is null.
7222 1) any of the required parameters is null.
7223 2) 'position' is not >= 1 and <= the number of parameters in the
7226 The type must be unpinned when the accessed information is no
7229 {------------------------ OCITypeParamByName ------------------------------- }
7231 TOCITypeParamByName = function(env: POCIEnv; err: POCIError;
7232 const mdo: POCITypeMethod; const name: Poratext; const n_length: ub4;
7233 elem:PPOCITypeElem): sword; cdecl;
7236 NAME: OCITypeParamByName - OCI Get a Parameter in a method By Name.
7238 env (IN/OUT) - OCI environment handle initialized in object mode
7239 err (IN/OUT) - error handle. If there is an error, it is
7240 recorded in 'err' and this function returns OCI_ERROR.
7241 The error recorded in 'err' can be retrieved by calling
7243 mdo (IN) - pointer to the method descriptor in the object cache
7244 name (IN) - the parameter's name
7245 n_length (IN) - length (in bytes) of the 'name' parameter
7246 elem (OUT) - If this function completes successfully, 'elem' points to
7247 the selected parameter descriptor in the object cache.
7249 1) All type accessors require that the type be pinned before calling
7251 2) if 'mdo' is not null, it must point to a valid method descriptor
7252 in the object cache.
7254 Get a parameter given its name.
7256 OCI_SUCCESS if the function completes successfully.
7257 OCI_INVALID_HANDLE if 'env' or 'err' is null.
7259 1) any of the required parameters is null.
7260 2) the method does not contain a parameter with the input 'name'.
7262 The type must be unpinned when the accessed information is no
7265 {------------------------ OCITypeParamPos --------------------------------- }
7267 TOCITypeParamPos = function(env: POCIEnv; err: POCIError;
7268 const mdo: POCITypeMethod; const name: Poratext; const n_length: ub4;
7269 position: Pub4; elem: PPOCITypeElem): sword; cdecl;
7272 NAME: OCITypeParamPos - OCI Get a parameter's position in a method
7274 env (IN/OUT) - OCI environment handle initialized in object mode
7275 err (IN/OUT) - error handle. If there is an error, it is
7276 recorded in 'err' and this function returns OCI_ERROR.
7277 The error recorded in 'err' can be retrieved by calling
7279 mdo (IN) - pointer to the method descriptor in the object cache
7280 name (IN) - the parameter's name
7281 n_length (IN) - length (in bytes) of the 'name' parameter
7282 position (OUT) - If this function completes successfully, 'position'
7283 points to the position of the parameter in the method starting
7284 at position 1. position MUST point to space for a ub4.
7285 elem (OUT) - If this function completes successfully, and
7286 the input 'elem' is not NULL, 'elem' points to the selected
7287 parameter descriptor in the object cache.
7289 1) All type accessors require that the type be pinned before calling
7291 2) if 'mdo' is not null, it must point to a valid method descriptor
7292 in the object cache.
7294 Get the position of a parameter in a method. Positions start at 1.
7296 OCI_SUCCESS if the function completes successfully.
7297 OCI_INVALID_HANDLE if 'env' or 'err' is null.
7299 1) any of the parameters is null.
7300 2) the method does not contain a parameter with the input 'name'.
7302 The type must be unpinned when the accessed information is no
7305 {------------------------ OCITypeParamElemMode ----------------------------- }
7307 TOCITypeElemParamMode = function(env: POCIEnv; err: POCIError;
7308 const elem: POCITypeElem): OCITypeParamMode; cdecl;
7311 NAME: OCITypeElemParamMode - OCI Get a parameter's mode
7313 env (IN/OUT) - OCI environment handle initialized in object mode
7314 err (IN/OUT) - error handle. If there is an error, it is
7315 recorded in 'err' and this function returns OCI_ERROR.
7316 The error recorded in 'err' can be retrieved by calling
7318 elem (IN) - pointer to the parameter descriptor in the object cache
7319 (represented by an OCITypeElem)
7321 1) All type accessors require that the type be pinned before calling
7323 2) All input parameters must not be NULL and must be valid.
7325 Get the mode (in, out, or in/out) of the parameter.
7327 the mode (in, out, or in/out) of the parameter
7329 The type must be unpinned when the accessed information is no
7332 {------------------------- OCITypeElemDefaultValue ------------------------- }
7334 TOCITypeElemDefaultValue = function(env: POCIEnv; err: POCIError;
7335 const elem: POCITypeElem; d_v_length: Pub4): poratext; cdecl;
7338 NAME: OCITypeElemDefaultValue - OCI Get the element's Default Value.
7340 env (IN/OUT) - OCI environment handle initialized in object mode
7341 err (IN/OUT) - error handle. If there is an error, it is
7342 recorded in 'err' and this function returns OCI_ERROR.
7343 The error recorded in 'err' can be retrieved by calling
7345 elem (IN) - pointer to the parameter descriptor in the object cache
7346 (represented by an OCITypeElem)
7347 d_v_length (OUT) - length (in bytes) of the returned default value.
7348 The caller must allocate space for the ub4 before calling this
7351 1) All type accessors require that the type be pinned before calling
7353 2) All input parameters must not be NULL and must be valid.
7355 Get the default value in text form (PL/SQL) of an element. For V8.0,
7356 this only makes sense for a method parameter.
7358 The default value (text) of the parameter.
7360 The type must be unpinned when the accessed information is no
7363 {-------------------------------------------------------------------------- }
7364 { TYPE VERSION TABLE }
7365 {-------------------------------------------------------------------------- }
7366 { For V8.0, the type version table is meant to be an internal data structure
7367 only for Oracle clients for type version maintanence purposes. A more
7368 general version of the API may be made public in subsequent releases. }
7369 {--------------------------- OCITypeVTInit -------------------------------- }
7371 TOCITypeVTInit = function(env: POCIEnv; err: POCIError): sword; cdecl;
7374 NAME: OCITypeVTInit - OCI type Version table INItialize
7376 env (IN/OUT) - OCI environment handle initialized in object mode
7377 err (IN/OUT) - error handle. If there is an error, it is
7378 recorded in 'err' and this function returns OCI_ERROR.
7379 The error recorded in 'err' can be retrieved by calling
7384 Allocate space for and initialize the type version table and the type
7385 version table's index.
7387 OCI_SUCCESS if the function completes successfully.
7388 OCI_INVALID_HANDLE if 'env' or 'err' is null.
7389 OCI_ERROR if internal errors occurrs during initialization.
7391 {--------------------------- OCITypeVTInsert ------------------------------- }
7393 TOCITypeVTInsert = function(env: POCIEnv; err: POCIError;
7394 const schema_name: Poratext; const s_n_length: ub4;
7395 const type_name: Poratext; const t_n_length: ub4;
7396 const user_version:Poratext; const u_v_length:ub4): sword; cdecl;
7399 NAME: OCITypeVTInsert - OCI type Version table INSert entry.
7401 env (IN/OUT) - OCI environment handle initialized in object mode
7402 err (IN/OUT) - error handle. If there is an error, it is
7403 recorded in 'err' and this function returns OCI_ERROR.
7404 The error recorded in 'err' can be retrieved by calling
7406 schema_name (IN, optional) - name of schema associated with the
7407 type. By default, the user's schema name is used.
7408 s_n_length (IN) - length of the 'schema_name' parameter
7409 type_name (IN) - type name to insert
7410 t_n_length (IN) - length (in bytes) of the 'type_name' parameter
7411 user_version (IN) - user readable version of the type
7412 u_v_length (IN) - length (in bytes) of the 'user_version' parameter
7416 Insert an entry into the type version table and the type version
7417 table's index. The entry's type name and user readable version
7418 fields are updated with the input values. All other fields are
7419 initialized to null.
7421 OCI_SUCCESS if the function completes successfully.
7422 OCI_INVALID_HANDLE if 'env' or 'err' is null.
7424 1) any of the parameters is invalid.
7425 2) an entry for 'type_name' has already been registered in the
7428 {------------------------------ OCITypeVTSelect ---------------------------- }
7429 { OCITypeVTSelect - OCI type VERSion table SELECT entry }
7431 TOCITypeVTSelect = function(env: POCIEnv; err: POCIError;
7432 const schema_name: Poratext; const s_n_length: ub4;
7433 const type_name: Poratext; const t_n_length: ub4; user_version: PPoratext;
7434 u_v_length: Pub4; version: Pub2): sword; cdecl;
7437 NAME: OCITypeVTSelect - OCI type Version table SELect entry.
7439 env (IN/OUT) - OCI environment handle initialized in object mode
7440 err (IN/OUT) - error handle. If there is an error, it is
7441 recorded in 'err' and this function returns OCI_ERROR.
7442 The error recorded in 'err' can be retrieved by calling
7444 schema_name (IN, optional) - name of schema associated with the
7445 type. By default, the user's schema name is used.
7446 s_n_length (IN) - length of the 'schema_name' parameter
7447 type_name (IN) - type name to select
7448 t_n_length (IN) - length (in bytes) of the 'type_name' parameter
7449 user_version (OUT, optional) - pointer to user readable version of the
7451 u_v_length (OUT, optional) - length (in bytes) of the 'user_version'
7453 version (OUT, optional) - internal type version
7455 All input parameters must not be NULL and must be valid.
7457 Select an entry in the type version table by name.
7459 OCI_SUCCESS if the function completes successfully.
7460 OCI_INVALID_HANDLE if 'env' or 'err' is null.
7462 1) any of the parameters is invalid.
7463 2) an entry with 'type_name' does not exist.
7465 { Compatibility function - following function prototype retained for
7466 compatibility only }
7467 // function ortgcty(env:POCIEnv; err:POCIError; coll_tdo:POCIType; collelem_tdo:PPOCIType):sword;
7469 {--------------------------------------------------------------------------- }
7470 { Transient Type Construction functions }
7471 {--------------------------------------------------------------------------- }
7472 // function TOCITypeBeginCreate(svchp:POCISvcCtx; errhp:POCIError; tc:OCITypeCode; dur:OCIDuration; _type:PPOCIType):sword;
7475 NAME: OCITypeBeginCreate - OCI Type Begin Creation of a transient type.
7477 Begins the construction process for a transient type. The type will be
7478 anonymous (no name). To create a persistent named type, the CREATE TYPE
7479 statement should be used from SQL. Transient types have no identity.
7480 They are pure values.
7482 svchp (IN) - The OCI Service Context.
7483 errhp (IN/OUT) - The OCI error handle. If there is an error, it is
7484 recorded in errhp and this function returns
7485 OCI_ERROR. Diagnostic information can be obtained by
7486 calling OCIErrorGet().
7487 tc - The TypeCode for the type. The Typecode could
7488 correspond to a User Defined Type or a Built-in type.
7489 Currently, the permissible values for User Defined
7490 Types are OCI_TYPECODE_OBJECT for an Object Type
7491 (structured), OCI_TYPECODE_VARRAY for a VARRAY
7492 collection type or OCI_TYPECODE_TABLE for a nested
7493 table collection type. For Object types,
7494 OCITypeAddAttr() needs to be called to add each of
7495 the attribute types. For Collection types,
7496 OCITypeSetCollection() needs to be called.
7497 Subsequently, OCITypeEndCreate() needs to be called
7498 to finish the creation process.
7499 The permissible values for Built-in type codes are
7500 specified in the user manual. Additional information
7501 on built-ins if any (like precision, scale for
7502 numbers, character set info for VARCHAR2s etc.) must
7503 be set with a subsequent call to OCITypeSetBuiltin().
7504 Subsequently OCITypeEndCreate() needs to be called
7505 to finish the creation process.
7506 dur - The allocation duration for the Type. Could be a
7507 predefined or a user defined duration.
7508 type(OUT) - The OCIType (Type Descriptor) that is being
7511 OCI_SUCCESS if the function completes successfully.
7514 // function TOCITypeSetCollection(svchp:POCISvcCtx; errhp:POCIError; _type:POCIType; collelem_info:POCIParam; coll_count:ub4):sword;
7517 NAME: OCITypeSetCollection - OCI Type Set Collection information
7519 Set Collection type information. This call can be called only if the
7520 OCIType has been constructed with a collection typecode.
7522 svchp (IN) - The OCI Service Context.
7523 errhp (IN/OUT) - The OCI error handle. If there is an error, it is
7524 recorded in errhp and this function returns
7525 OCI_ERROR. Diagnostic information can be obtained by
7526 calling OCIErrorGet().
7527 type(IN OUT) - The OCIType (Type Descriptor) that is being
7529 collelem_info - collelem_info provides information on the collection
7530 element. It is obtained by allocating an OCIParam
7531 (parameter handle) and setting type information in
7532 the OCIParam using OCIAttrSet() calls.
7533 coll_count - The count of elements in the collection. Pass 0 for
7534 a nested table (unbounded).
7536 OCI_SUCCESS if the function completes successfully.
7539 // function TOCITypeSetBuiltin(svchp:POCISvcCtx; errhp:POCIError; _type:POCIType; builtin_info:POCIParam):sword;
7542 NAME: OCITypeSetBuiltin - OCI Type Set Builtin information.
7544 Set Built-in type information. This call can be called only if the
7545 OCIType has been constructed with a built-in typecode
7546 (OCI_TYPECODE_NUMBER etc.).
7548 svchp (IN) - The OCI Service Context.
7549 errhp (IN/OUT) - The OCI error handle. If there is an error, it is
7550 recorded in errhp and this function returns
7551 OCI_ERROR. Diagnostic information can be obtained by
7552 calling OCIErrorGet().
7553 type(IN OUT) - The OCIType (Type Descriptor) that is being
7555 builtin_info - builtin_info provides information on the built-in
7556 (like precision, scale, charater set etc.). It is
7557 obtained by allocating an OCIParam (parameter handle)
7558 and setting type information in the OCIParam using
7561 OCI_SUCCESS if the function completes successfully.
7564 (* Const before type ignored *)
7565 // function TOCITypeAddAttr(svchp:POCISvcCtx; errhp:POCIError; _type:POCIType; a_name:Poratext; a_length:ub4;
7566 // attr_info:POCIParam):sword;
7569 NAME: OCITypeAddAttr - OCI Type Add Attribute to an Object Type.
7571 Adds an attribute to an Object type (that was constructed earlier with
7572 typecode OCI_TYPECODE_OBJECT).
7574 svchp (IN) - The OCI Service Context
7575 errhp (IN/OUT) - The OCI error handle. If there is an error, it is
7576 recorded in errhp and this function returns
7577 OCI_ERROR. Diagnostic information can be obtained by
7578 calling OCIErrorGet().
7579 type (IN/OUT) - The Type description that is being constructed.
7580 a_name(IN) - Optional. gives the name of the attribute.
7581 a_length - Optional. gives length of attribute name.
7582 attr_info - Information on the attribute. It is obtained by
7583 allocating an OCIParam (parameter handle) and setting
7584 type information in the OCIParam using OCIAttrSet()
7587 OCI_SUCCESS if the function completes successfully.
7590 // function TOCITypeEndCreate(svchp:POCISvcCtx; errhp:POCIError; _type:POCIType):sword;
7593 NAME: OCITypeEndCreate - OCI Type End Creation
7595 Finishes construction of a type description.Subsequently, only access
7598 svchp (IN) - The OCI Service Context
7599 errhp (IN/OUT) - The OCI error handle. If there is an error, it is
7600 recorded in errhp and this function returns
7601 OCI_ERROR. Diagnostic information can be obtained by
7602 calling OCIErrorGet().
7603 type (IN/OUT) - The Type description that is being constructed.
7605 OCI_SUCCESS if the function completes successfully.
7608 {========================= }
7609 { PUBLIC MACROS AND FLAGS }
7610 {========================= }
7611 {-------------------------------------------------------------------------- }
7612 { TYPE ELEMENT FLAGS }
7613 {-------------------------------------------------------------------------- }
7614 { element is a REF }
7616 OCI_TYPEELEM_REF = $8000;
7617 { parameter is required }
7618 OCI_TYPEPARAM_REQUIRED = $0800;
7619 { macros to test flags }
7620 { was #define dname(params) para_def_expr }
7621 { argument types are unknown }
7622 { return type might be wrong }
7624 TOCI_TYPEELEM_IS_REF = function(elem_flag : longint) : longint;
7626 { was #define dname(params) para_def_expr }
7627 { argument types are unknown }
7628 { return type might be wrong }
7629 TOCI_TYPEPARAM_IS_REQUIRED = function (param_flag : longint) : longint;
7633 OracleOCI_API = record
7634 OCIPasswordChange: TOCIPasswordChange;
7635 OCIInitialize: TOCIInitialize;
7636 OCIEnvInit: TOCIEnvInit;
7637 OCIEnvCreate: TOCIEnvCreate;
7638 OCIEnvNlsCreate: TOCIEnvNlsCreate;
7639 OCIHandleAlloc: TOCIHandleAlloc;
7640 OCIServerAttach: TOCIServerAttach;
7641 OCIAttrSet: TOCIAttrSet;
7642 OCISessionBegin: TOCISessionBegin;
7643 OCISessionEnd: TOCISessionEnd;
7644 OCIServerDetach: TOCIServerDetach;
7645 OCIHandleFree: TOCIHandleFree;
7646 OCIErrorGet: TOCIErrorGet;
7647 OCIStmtPrepare: TOCIStmtPrepare;
7648 OCIStmtExecute: TOCIStmtExecute;
7649 OCIParamGet: TOCIParamGet;
7650 OCIAttrGet: TOCIAttrGet;
7651 OCIStmtFetch: TOCIStmtFetch;
7652 OCIDefineByPos: TOCIDefineByPos;
7653 OCIDefineArrayOfStruct: TOCIDefineArrayOfStruct;
7654 OCIBindByPos: TOCIBindByPos;
7655 OCIBindByName: TOCIBindByName;
7657 OCIDefineObject: TOCIDefineObject;
7660 OCIObjectNew: TOCIObjectNew;
7661 OCIObjectPin: TOCIObjectPin;
7662 OCIObjectUnpin: TOCIObjectUnpin;
7663 OCIObjectPinCountReset: TOCIObjectPinCountReset;
7664 OCIObjectLock: TOCIObjectLock;
7665 OCIObjectLockNoWait: TOCIObjectLockNoWait;
7666 OCIObjectMarkUpdate: TOCIObjectMarkUpdate;
7667 OCIObjectUnmark: TOCIObjectUnmark;
7668 OCIObjectUnmarkByRef: TOCIObjectUnmarkByRef;
7669 OCIObjectFree: TOCIObjectFree;
7670 OCIObjectMarkDeleteByRef: TOCIObjectMarkDeleteByRef;
7671 OCIObjectMarkDelete: TOCIObjectMarkDelete;
7672 OCIObjectFlush: TOCIObjectFlush;
7673 OCIObjectRefresh: TOCIObjectRefresh;
7674 OCIObjectCopy: TOCIObjectCopy;
7675 OCIObjectGetTypeRef: TOCIObjectGetTypeRef;
7676 OCIObjectGetObjectRef: TOCIObjectGetObjectRef;
7677 OCIObjectMakeObjectRef: TOCIObjectMakeObjectRef;
7678 OCIObjectGetPrimaryKeyTypeRef: TOCIObjectGetPrimaryKeyTypeRef;
7679 OCIObjectGetInd: TOCIObjectGetInd;
7680 OCIObjectExists: TOCIObjectExists;
7681 OCIObjectGetProperty: TOCIObjectGetProperty;
7682 OCIObjectIsLocked: TOCIObjectIsLocked;
7683 OCIObjectIsDirty: TOCIObjectIsDirty;
7684 OCIObjectPinTable: TOCIObjectPinTable;
7685 OCIObjectArrayPin: TOCIObjectArrayPin;
7686 OCICacheFlush: TOCICacheFlush;
7687 OCICacheRefresh: TOCICacheRefresh;
7688 OCICacheUnpin: TOCICacheUnpin;
7689 OCICacheFree: TOCICacheFree;
7690 OCICacheUnmark: TOCICacheUnmark;
7691 OCIDurationBegin: TOCIDurationBegin;
7692 OCIDurationEnd: TOCIDurationEnd;
7695 OCITransStart: TOCITransStart;
7696 OCITransCommit: TOCITransCommit;
7697 OCITransRollback: TOCITransRollback;
7698 OCITransDetach: TOCITransDetach;
7699 OCITransPrepare: TOCITransPrepare;
7700 OCITransForget: TOCITransForget;
7701 OCIDescribeAny: TOCIDescribeAny;
7702 OCIBreak: TOCIBreak;
7703 OCIReset: TOCIReset;
7704 OCIDescriptorAlloc: TOCIDescriptorAlloc;
7705 OCIDescriptorFree: TOCIDescriptorFree;
7706 OCIStmtGetPieceInfo: TOCIStmtGetPieceInfo;
7707 OCIStmtSetPieceInfo: TOCIStmtSetPieceInfo;
7708 OCIServerVersion: TOCIServerVersion;
7709 OCIServerRelease: TOCIServerRelease;
7710 OCIBindDynamic: TOCIBindDynamic;
7711 OCIBindObject: TOCIBindObject;
7712 OCIDateTimeAssign: TOCIDateTimeAssign;
7713 OCIDateTimeCheck: TOCIDateTimeCheck;
7714 OCIDateTimeCompare: TOCIDateTimeCompare;
7715 OCIDateTimeConvert: TOCIDateTimeConvert;
7716 OCIDateTimeFromText: TOCIDateTimeFromText;
7717 OCIDateTimeGetDate: TOCIDateTimeGetDate;
7718 OCIDateTimeGetTime: TOCIDateTimeGetTime;
7719 OCIDateTimeGetTimeZoneOffset: TOCIDateTimeGetTimeZoneOffset;
7720 OCIDateTimeSysTimeStamp: TOCIDateTimeSysTimeStamp;
7721 OCIDateTimeConstruct: TOCIDateTimeConstruct;
7722 OCIDateTimeToText: TOCIDateTimeToText;
7723 OCIDateTimeGetTimeZoneName: TOCIDateTimeGetTimeZoneName;
7724 OCILobAppend: TOCILobAppend;
7725 OCILobAssign: TOCILobAssign;
7726 OCILobClose: TOCILobClose;
7727 OCILobCopy: TOCILobCopy;
7728 OCILobCreateTemporary: TOCILobCreateTemporary;
7729 OCILobEnableBuffering: TOCILobEnableBuffering;
7730 OCILobDisableBuffering: TOCILobDisableBuffering;
7731 OCILobErase: TOCILobErase;
7732 OCILobFileExists: TOCILobFileExists;
7733 OCILobFileGetName: TOCILobFileGetName;
7734 OCILobFileSetName: TOCILobFileSetName;
7735 OCILobFlushBuffer: TOCILobFlushBuffer;
7736 OCILobFreeTemporary: TOCILobFreeTemporary;
7737 OCILobCharSetForm: TOCILobCharSetForm;
7738 OCILobCharSetId: TOCILobCharSetId;
7739 OCILobGetLength: TOCILobGetLength;
7740 OCILobIsOpen: TOCILobIsOpen;
7741 OCILobIsTemporary: TOCILobIsTemporary;
7742 OCILobLoadFromFile: TOCILobLoadFromFile;
7743 OCILobLocatorIsInit: TOCILobLocatorIsInit;
7744 OCILobOpen: TOCILobOpen;
7745 OCILobRead: TOCILobRead;
7746 OCILobTrim: TOCILobTrim;
7747 OCILobWrite: TOCILobWrite;
7748 OCIResultSetToStmt: TOCIResultSetToStmt;
7749 OCINlsNumericInfoGet: TOCINlsNumericInfoGet;
7750 OCIClientVersion: TOCIClientVersion;
7752 { OCI Number mapping }
7753 OCINumberInc: TOCINumberInc;
7754 OCINumberDec: TOCINumberDec;
7755 OCINumberSetZero: TOCINumberSetZero;
7756 OCINumberSetPi: TOCINumberSetPi;
7757 OCINumberAdd: TOCINumberAdd;
7758 OCINumberSub: TOCINumberSub;
7759 OCINumberMul: TOCINumberMul;
7760 OCINumberDiv: TOCINumberDiv;
7761 OCINumberMod: TOCINumberMod;
7762 OCINumberIntPower: TOCINumberIntPower;
7763 OCINumberShift: TOCINumberShift;
7764 OCINumberNeg: TOCINumberNeg;
7765 OCINumberToText: TOCINumberToText;
7766 OCINumberFromText: TOCINumberFromText;
7767 OCINumberToInt: TOCINumberToInt;
7768 OCINumberFromInt: TOCINumberFromInt;
7769 OCINumberToReal: TOCINumberToReal;
7770 OCINumberToRealArray: TOCINumberToRealArray;
7771 OCINumberFromReal: TOCINumberFromReal;
7772 OCINumberCmp: TOCINumberCmp;
7773 OCINumberSign: TOCINumberSign;
7774 OCINumberIsZero: TOCINumberIsZero;
7775 OCINumberIsInt: TOCINumberIsInt;
7776 OCINumberAssign: TOCINumberAssign;
7777 OCINumberAbs: TOCINumberAbs;
7778 OCINumberCeil: TOCINumberCeil;
7779 OCINumberFloor: TOCINumberFloor;
7780 OCINumberSqrt: TOCINumberSqrt;
7781 OCINumberTrunc: TOCINumberTrunc;
7782 OCINumberPower: TOCINumberPower;
7783 OCINumberRound: TOCINumberRound;
7784 OCINumberPrec: TOCINumberPrec;
7785 OCINumberSin: TOCINumberSin;
7786 OCINumberArcSin: TOCINumberArcSin;
7787 OCINumberHypSin: TOCINumberHypSin;
7788 OCINumberCos: TOCINumberCos;
7789 OCINumberArcCos: TOCINumberArcCos;
7790 OCINumberHypCos: TOCINumberHypCos;
7791 OCINumberTan: TOCINumberTan;
7792 OCINumberArcTan: TOCINumberArcTan;
7793 OCINumberArcTan2: TOCINumberArcTan2;
7794 OCINumberHypTan: TOCINumberHypTan;
7795 OCINumberExp: TOCINumberExp;
7796 OCINumberLn: TOCINumberLn;
7797 OCINumberLog: TOCINumberLog;
7800 OCIDateAssign: TOCIDateAssign;
7801 OCIDateToText: TOCIDateToText;
7802 OCIDateFromText: TOCIDateFromText;
7803 OCIDateCompare: TOCIDateCompare;
7804 OCIDateAddMonths: TOCIDateAddMonths;
7805 OCIDateAddDays: TOCIDateAddDays;
7806 OCIDateLastDay: TOCIDateLastDay;
7807 OCIDateDaysBetween: TOCIDateDaysBetween;
7808 OCIDateZoneToZone: TOCIDateZoneToZone;
7809 OCIDateNextDay: TOCIDateNextDay;
7811 { OBJECT REFERENCE (REF) }
7812 OCIRefClear: TOCIRefClear;
7813 OCIRefAssign: TOCIRefAssign;
7815 OCITableSize: TOCITableSize;
7816 OCITableExists: TOCITableExists;
7817 OCITableDelete: TOCITableDelete;
7818 OCITableFirst: TOCITableFirst;
7819 OCITableLast: TOCITableLast;
7820 OCITableNext: TOCITableNext;
7821 OCITablePrev: TOCITablePrev;
7823 { Oracle Object Interface for Dynamic Data Access }
7824 OCIObjectSetAttr: TOCIObjectSetAttr;
7825 OCIObjectGetAttr: TOCIObjectGetAttr;
7829 OCITypeIterNew: TOCITypeIterNew;
7830 OCITypeIterSet: TOCITypeIterSet;
7831 OCITypeIterFree: TOCITypeIterFree;
7832 OCITypeByName: TOCITypeByName;
7833 OCITypeArrayByName: TOCITypeArrayByName;
7834 OCITypeByRef: TOCITypeByRef;
7835 OCITypeArrayByRef: TOCITypeArrayByRef;
7836 OCITypeName: TOCITypeName;
7837 OCITypeSchema: TOCITypeSchema;
7838 OCITypeTypeCode: TOCITypeTypeCode;
7839 OCITypeCollTypeCode: TOCITypeCollTypeCode;
7840 OCITypeVersion: TOCITypeVersion;
7841 OCITypeAttrs: TOCITypeAttrs;
7842 OCITypeMethods: TOCITypeMethods;
7843 OCITypeElemName: TOCITypeElemName;
7844 OCITypeElemTypeCode: TOCITypeElemTypeCode;
7845 OCITypeElemType: TOCITypeElemType;
7846 OCITypeElemFlags: TOCITypeElemFlags;
7847 OCITypeElemNumPrec: TOCITypeElemNumPrec;
7848 OCITypeElemNumScale: TOCITypeElemNumScale;
7849 OCITypeElemLength: TOCITypeElemLength;
7850 OCITypeElemCharSetID: TOCITypeElemCharSetID;
7851 OCITypeElemCharSetForm: TOCITypeElemCharSetForm;
7852 OCITypeElemParameterizedType: TOCITypeElemParameterizedType;
7853 OCITypeElemExtTypeCode: TOCITypeElemExtTypeCode;
7854 OCITypeAttrByName: TOCITypeAttrByName;
7855 OCITypeAttrNext: TOCITypeAttrNext;
7856 OCITypeCollElem: TOCITypeCollElem;
7857 OCITypeCollSize: TOCITypeCollSize;
7858 OCITypeCollExtTypeCode: TOCITypeCollExtTypeCode;
7859 OCITypeMethodOverload: TOCITypeMethodOverload;
7860 OCITypeMethodByName: TOCITypeMethodByName;
7861 OCITypeMethodNext: TOCITypeMethodNext;
7862 OCITypeMethodName: TOCITypeMethodName;
7863 OCITypeMethodEncap: TOCITypeMethodEncap;
7864 OCITypeMethodFlags: TOCITypeMethodFlags;
7865 OCITypeMethodMap: TOCITypeMethodMap;
7866 OCITypeMethodOrder: TOCITypeMethodOrder;
7867 OCITypeMethodParams: TOCITypeMethodParams;
7868 OCITypeResult: TOCITypeResult;
7869 OCITypeParamByPos: TOCITypeParamByPos;
7870 OCITypeParamByName: TOCITypeParamByName;
7871 OCITypeParamPos: TOCITypeParamPos;
7872 OCITypeElemParamMode: TOCITypeElemParamMode;
7873 OCITypeElemDefaultValue:TOCITypeElemDefaultValue;
7874 OCITypeVTInit: TOCITypeVTInit;
7875 OCITypeVTInsert: TOCITypeVTInsert;
7876 OCITypeVTSelect: TOCITypeVTSelect;