blob: 10d9f89e652882843c31a1699d4254308d66ffe2 [file] [log] [blame]
Tang Cheng31b95252014-10-23 09:22:35 +08001/* Copyright (c) 1996, 2011, Oracle and/or its affiliates.
2All rights reserved. */
3
4/*
5 NAME
6 ociap.h
7
8 DESCRIPTION
9 Oracle Call Interface - Ansi Prototypes
10
11 RELATED DOCUMENTS
12
13 INSPECTION STATUS
14 Inspection date:
15 Inspection status:
16 Estimated increasing cost defects per page:
17 Rule sets:
18
19 ACCEPTANCE REVIEW STATUS
20 Review date:
21 Review status:
22 Reviewers:
23
24 PUBLIC FUNCTION(S)
25 OCIAttrGet
26 OCIAttrSet
27 OCIBindArrayOfStruct
28 OCIBindByName
29 OCIBindByPos
30 OCIBindDynamic
31 OCIBindObject
32 OCIBreak
33 OCIConnectionPoolCreate
34 OCISessionPoolCreate
35 OCISessionGet
36 OCISessionRelease
37 OCIDateTimeAssign
38 OCIDateTimeCheck
39 OCIDateTimeCompare
40 OCIDateTimeConvert
41 OCIDateTimeFromText
42 OCIDateTimeGetDate
43 OCIDateTimeGetTime
44 OCIDateTimeGetTime
45 OCIDateTimeGetTimeZoneOffset
46 OCIDateTimeSysTimeStamp
47 OCIDateTimeIntervalAdd
48 OCIDateTimeIntervalSub
49 OCIDateTimeConstruct
50 OCIDateTimeSubtract
51 OCIDateTimeToText
52 OCIDateTimeGetTimeZoneName
53 OCIDateTimeToArray
54 OCIDateTimeFromArray
55 OCIRowidToChar
56 OCIDefineArrayOfStruct
57 OCIDefineByPos
58 OCIDefineDynamic
59 OCIDefineObject
60 OCIDescAlloc
61 OCIDescFree
62 OCIDescribeAny
63 OCIEnvCreate
64 OCIEnvNlsCreate
65 OCIEnvInit
66 OCIErrorGet
67 OCIExtractSetKey
68 OCIExtractFromFile
69 OCIIntervalSubtract
70 OCIIntervalMultiply
71 OCIIntervalToNumber
72 OCIIntervalToText
73 OCIIntervalFromTZ
74 OCIKerbAttrSet
75 OCILdaToSvcCtx
76 OCILobAppend
77 OCILobAssign
78 OCILobCharSetForm
79 OCILobCharSetId
80 OCILobCopy
81 OCILobCreateTemporary
82 OCILobDisableBuffering
83 OCILobEnableBuffering
84 OCILobErase
85 OCILobOpen
86 OCILobClose
87 OCILobFileClose
88 OCILobFileCLoseAll
89 OCILobFileExists
90 OCILobFileGetName
91 OCILobFileIsOpen
92 OCILobFileOpen
93 OCILobFileSetName
94 OCILobFlushBuffer
95 OCILobFreeTemporary
96 OCILobGetChunkSize
97 OCILobGetLength
98 OCILobIsEqual
99 OCILobIsTemporary
100 OCILobLoadFromFile
101 OCILobLocatorAssign
102 OCILobLocatorIsInit
103 OCILobRead
104 OCILobTrim
105 OCILobWrite
106 OCILobWriteAppend
107 OCILobGetStorageLimit
108 OCILobGetOptions
109 OCILobSetOptions
110 OCILobGetContentType
111 OCILobSetContentType
112 OCILogoff
113 OCILogon
114 OCILogon2
115 OCIMemoryFree
116 OCIParamGet
117 OCIParamGet
118 OCIPasswordChange
119 OCIReset
120 OCIResultSetToStmt
121 OCIServerAttach
122 OCIServerDetach
123 OCIServerVersion
124 OCISessionBegin
125 OCISessionEnd
126 OCIStmtExecute
127 OCIStmtFetch
128 OCIStmtFetch2
129 OCIStmtGetPieceInfo
130 OCIStmtPrepare
131 OCIStmtPrepare2
132 OCIStmtRelease
133 OCIStmtSetPieceInfo
134 OCIFormatString
135 OCISvcCtxToLda
136 OCITransCommit
137 OCITransDetach
138 OCITransForget
139 OCITransMultiPrepare
140 OCITransPrepare
141 OCITransRollback
142 OCITransStart
143 OCIInitialize
144 OCIEnvCreate
145 OCIEnvNlsCreate
146 OCIFEnvCreate
147 OCIHandleAlloc
148 OCIDescriptorAlloc
149 OCIDescriptorFree
150 OCIArrayDescriptorAlloc
151 OCIArrayDescriptorFree
152 OCIEnvInit
153 OCIServerAttach
154 OCISessionBegin
155 OCISessionEnd
156 OCILogon
157 OCILogon2
158 OCIPasswordChange
159 OCIStmtPrepare
160 OCIStmtPrepare2
161 OCIStmtRelease
162 OCIBindByPos
163 OCIBindByName
164 OCIBindObject
165 OCIBindDynamic
166 OCIBindArrayOfStruct
167 OCIStmtGetPieceInfo
168 OCIStmtSetPieceInfo
169 OCIStmtExecute
170 OCIDefineByPos
171 OCIDefineObject
172 OCIDefineDynamic
173 OCIRowidToChar
174 OCIDefineArrayOfStruct
175 OCIStmtFetch
176 OCIStmtFetch2
177 OCIStmtGetBindInfo
178 OCIDescribeAny
179 OCIParamGet
180 OCIParamSet
181 OCITransStart
182 OCITransMultiPrepare
183 OCIErrorGet
184 OCILobAppend
185 OCILobAssign
186 OCILobCharSetForm
187 OCILobCharSetId
188 OCILobCopy
189 OCILobCreateTemporary
190 OCILobClose
191 OCILobDisableBuffering
192 OCILobEnableBuffering
193 OCILobErase
194 OCILobFileClose
195 OCILobFileExists
196 OCILobFileGetName
197 OCILobFileIsOpen
198 OCILobFileOpen
199 OCILobFileSetName
200 OCILobFlushBuffer
201 OCILobFreeTemporary
202 OCILobGetChunkSize
203 OCILobGetLength
204 OCILobIsEqual
205 OCILobIsOpen
206 OCILobIsTemporary
207 OCILobLoadFromFile
208 OCILobLocatorAssign
209 OCILobLocatorIsInit
210 OCILobOpen
211 OCILobRead
212 OCILobTrim
213 OCILobWrite
214 OCILobWriteAppend
215 OCIServerVersion
216 OCIServerRelease
217 OCIAttrGet
218 OCIAttrSet
219 OCIUserCallbackRegister
220 OCIUserCallbackGet
221 OCISharedLibInit
222 OCIFileExists
223 OCIFileGetLength
224 OCIFileOpen
225 OCIFileRead
226 OCIFileSeek
227 OCIFileWrite
228 OCILobCopy2
229 OCILobErase2
230 OCILobGetLength2
231 OCILobLoadFromFile2
232 OCILobRead2
233 OCILobArrayRead
234 OCILobTrim2
235 OCILobWrite2
236 OCILobArrayWrite
237 OCILobWriteAppend2
238 OCILobGetStorageLimit
239 OCISecurityOpenWallet
240 OCISecurityCloseWallet
241 OCISecurityCreateWallet
242 OCISecurityDestroyWallet
243 OCISecurityStorePersona
244 OCISecurityOpenPersona
245 OCISecurityClosePersona
246 OCISecurityRemovePersona
247 OCISecurityCreatePersona
248 OCISecuritySetProtection
249 OCISecurityGetProtection
250 OCISecurityRemoveIdentity
251 OCISecurityCreateIdentity
252 OCISecurityAbortIdentity
253 OCISecurityFreeIdentity
254 OCISecurityStoreTrustedIdentity
255 OCISecuritySign
256 OCISecuritySignExpansion
257 OCISecurityVerify
258 OCISecurityValidate
259 OCISecuritySignDetached
260 OCISecuritySignDetExpansion
261 OCISecurityVerifyDetached
262 OCISecurity_PKEncrypt
263 OCISecurityPKEncryptExpansion
264 OCISecurityPKDecrypt
265 OCISecurityEncrypt
266 OCISecurityEncryptExpansion
267 OCISecurityDecrypt
268 OCISecurityEnvelope
269 OCISecurityDeEnvelope
270 OCISecurityKeyedHash
271 OCISecurityKeyedHashExpansion
272 OCISecurityHash
273 OCISecurityHashExpansion
274 OCISecuritySeedRandom
275 OCISecurityRandomBytes
276 OCISecurityRandomNumber
277 OCISecurityInitBlock
278 OCISecurityReuseBlock
279 OCISecurityPurgeBlock
280 OCISecuritySetBlock
281 OCISecurityGetIdentity
282 OCIAQEnq
283 OCIAQDeq
284 OCIAQEnqArray
285 OCIAQEnqStreaming
286 OCIAQDeqArray
287 OCIAQListen
288 OCIAQListen2
289 OCIExtractSetKey
290 OCIExtractFromFile
291 OCIExtractToInt
292 OCIExtractToBool
293 OCIExtractToStr
294 OCIExtractToOCINum
295 OCIExtractFromList
296 OCIMemoryAlloc
297 OCIMemoryResize
298 OCIContextSetValue
299 OCIContextGetValue
300 OCIContextClearValue
301 OCIMemorySetCurrentIDs
302 OCIPicklerTdsCtxInit
303 OCIPicklerTdsInit
304 OCIPicklerTdsCreateElementNumber
305 OCIPicklerTdsCreateElementChar
306 OCIPicklerTdsCreateElementVarchar
307 OCIPicklerTdsCreateElementRaw
308 OCIPicklerTdsCreateElement
309 OCIPicklerTdsAddAttr
310 OCIPicklerTdsGenerate
311 OCIPicklerTdsGetAttr
312 OCIPicklerFdoInit
313 OCIPicklerFdoFree
314 OCIPicklerImageInit
315 OCIPicklerImageFree
316 OCIPicklerImageAddScalar
317 OCIPicklerImageAddNullScalar
318 OCIPicklerImageGenerate
319 OCIPicklerImageGetScalarSize
320 OCIPicklerImageGetScalar
321 OCIPicklerImageCollBegin
322 OCIPicklerImageCollAddScalar
323 OCIPicklerImageCollEnd
324 OCIPicklerImageCollBeginScan
325 OCIPicklerImageCollGetScalarSize
326 OCIPicklerImageCollGetScalar
327 OCIAnyDataGetType
328 OCIAnyDataIsNull
329 OCIAnyDataConvert
330 OCIAnyDataBeginCreate
331 OCIAnyDataAttrSet
332 OCIAnyDataCollAddElem
333 OCIAnyDataEndCreate
334 OCIAnyDataAccess
335 OCIAnyDataGetCurrAttrNum
336 OCIAnyDataAttrGet
337 OCIAnyDataCollGetElem
338 OCIPicklerTdsCtxInit
339 OCIPicklerTdsInit
340 OCIPicklerTdsCreateElementNumber
341 OCIPicklerTdsCreateElementChar
342 OCIPicklerTdsCreateElementVarchar
343 OCIPicklerTdsCreateElementRaw
344 OCIPicklerTdsCreateElement
345 OCIPicklerTdsAddAttr
346 OCIPicklerTdsGenerate
347 OCIPicklerTdsGetAttr
348 OCIPicklerFdoInit
349 OCIPicklerFdoFree
350 OCIPicklerImageInit
351 OCIPicklerImageFree
352 OCIPicklerImageAddScalar
353 OCIPicklerImageAddNullScalar
354 OCIPicklerImageGenerate
355 OCIPicklerImageGetScalarSize
356 OCIPicklerImageGetScalar
357 OCIPicklerImageCollBegin
358 OCIPicklerImageCollAddScalar
359 OCIPicklerImageCollEnd
360 OCIPicklerImageCollBeginScan
361 OCIPicklerImageCollGetScalarSize
362 OCIPicklerImageCollGetScalar
363 OCIAnyDataGetType
364 OCIAnyDataIsNull
365 OCIAnyDataConvert
366 OCIAnyDataBeginCreate
367 OCIAnyDataAttrSet
368 OCIAnyDataCollAddElem
369 OCIAnyDataEndCreate
370 OCIAnyDataAccess
371 OCIAnyDataGetCurrAttrNum
372 OCIAnyDataAttrGet
373 OCIAnyDataCollGetElem
374 OCIPicklerTdsCtxInit
375 OCIPicklerTdsInit
376 OCIPicklerTdsCreateElementNumber
377 OCIPicklerTdsCreateElementChar
378 OCIPicklerTdsCreateElementVarchar
379 OCIPicklerTdsCreateElementRaw
380 OCIPicklerTdsCreateElement
381 OCIPicklerTdsAddAttr
382 OCIPicklerTdsGenerate
383 OCIPicklerTdsGetAttr
384 OCIPicklerFdoInit
385 OCIPicklerFdoFree
386 OCIPicklerImageInit
387 OCIPicklerImageFree
388 OCIPicklerImageAddScalar
389 OCIPicklerImageAddNullScalar
390 OCIPicklerImageGenerate
391 OCIPicklerImageGetScalarSize
392 OCIPicklerImageGetScalar
393 OCIPicklerImageCollBegin
394 OCIPicklerImageCollAddScalar
395 OCIPicklerImageCollEnd
396 OCIPicklerImageCollBeginScan
397 OCIPicklerImageCollGetScalarSize
398 OCIPicklerImageCollGetScalar
399 OCIAnyDataGetType
400 OCIAnyDataIsNull
401 OCIAnyDataConvert
402 OCIAnyDataBeginCreate
403 OCIAnyDataAttrSet
404 OCIAnyDataCollAddElem
405 OCIAnyDataEndCreate
406 OCIAnyDataAccess
407 OCIAnyDataGetCurrAttrNum
408 OCIAnyDataAttrGet
409 OCIAnyDataCollGetElem
410 OCIAnyDataSetBeginCreate
411 OCIAnyDataSetDestroy
412 OCIAnyDataSetAddInstance
413 OCIAnyDataSetEndCreate
414 OCIAnyDataSetGetType
415 OCIAnyDataSetGetCount
416 OCIAnyDataSetGetInstance
417 OCIFormatString
418 OCINlsGetInfo
419 OCINlsNameMap
420 OCIMultiByteToWideChar
421 OCIMultiByteInSizeToWideChar
422 OCIWideCharToMultiByte
423 OCIWideCharInSizeToMultiByte
424 OCIWideCharStrcmp
425 OCIWideCharStrncmp
426 OCIWideCharStrcat
427 *OCIWideCharStrchr
428 OCIWideCharStrcpy
429 OCIWideCharStrncat
430 OCIWideCharStrncpy
431 *OCIWideCharStrrchr
432 OCIWideCharStrCaseConversion
433 OCIMultiByteStrcmp
434 OCIMultiByteStrncmp
435 OCIMultiByteStrcat
436 OCIMultiByteStrcpy
437 OCIMultiByteStrncat
438 OCIMultiByteStrncpy
439 OCIMultiByteStrnDisplayLength
440 OCIMultiByteStrCaseConversion
441 OCICharSetToUnicode
442 OCIUnicodeToCharSet
443 OCINlsCharSetConvert
444 OCINlsEnvironmentVariableGet
445 OCIMessageOpen
446 OCIMessageGet
447 OCIThreadMutexInit
448 OCIThreadMutexDestroy
449 OCIThreadMutexAcquire
450 OCIThreadMutexRelease
451 OCIThreadKeyInit
452 OCIThreadKeyDestroy
453 OCIThreadKeyGet
454 OCIThreadKeySet
455 OCIThreadIdSet
456 OCIThreadIdSetNull
457 OCIThreadIdGet
458 OCIThreadIdSame
459 OCIThreadIdNull
460 OCIThreadHndInit
461 OCIThreadHndDestroy
462 OCIThreadCreate
463 OCIThreadHandleGet
464 OCIThreadMutexInit
465 OCIThreadMutexDestroy
466 OCIThreadMutexAcquire
467 OCIThreadMutexRelease
468 OCIThreadKeyInit
469 OCIThreadKeyDestroy
470 OCIThreadKeyGet
471 OCIThreadKeySet
472 OCIThreadIdSet
473 OCIThreadIdSame
474 OCIThreadIdNull
475 OCIThreadCreate
476 OCISubscriptionRegister
477 OCISubscriptionPost
478 OCISubscriptionUnRegister
479 OCISubscriptionDisable
480 OCISubscriptionEnable
481 OCIDateTimeGetTime
482 OCIDateTimeGetDate
483 OCIDateTimeGetTimeZoneOffset
484 OCIDateTimeConstruct
485 OCIDateTimeSysTimeStamp
486 OCIDateTimeAssign
487 OCIDateTimeToText
488 OCIDateTimeFromText
489 OCIDateTimeCompare
490 OCIDateTimeCheck
491 OCIDateTimeConvert
492 OCIDateTimeSubtract
493 OCIDateTimeIntervalAdd
494 OCIDateTimeIntervalSub
495 OCIIntervalSubtract
496 OCIIntervalAdd
497 OCIIntervalMultiply
498 OCIIntervalDivide
499 OCIIntervalCompare
500 OCIIntervalFromNumber
501 OCIIntervalFromText
502 OCIIntervalToText
503 OCIIntervalToNumber
504 OCIIntervalCheck
505 OCIIntervalAssign
506 OCIIntervalSetYearMonth
507 OCIIntervalGetYearMonth
508 OCIIntervalSetDaySecond
509 OCIIntervalGetDaySecond
510 OCIDateTimeToArray
511 OCIDateTimeFromArray
512 OCIDateTimeGetTimeZoneName
513 OCIIntervalFromTZ
514 OCIConnectionPoolCreate
515 OCIConnectionPoolDestroy
516 OCISessionPoolCreate
517 OCISessionPoolDestroy
518 OCISessionGet
519 OCISessionRelease
520 OCIAppCtxSet
521 OCIAppCtxClearAll
522 OCIMemStats
523 OCIKerbAttrSet
524 OCIDBStartup
525 OCIDBShutdown
526 OCIClientVersion
527 OCIInitEventHandle
528 OCIStmtBindByPos
529 OCIStmtBindByName
530
531 PRIVATE FUNCTION(S)
532
533 EXAMPLES
534
535 NOTES
536
537 MODIFIED (MM/DD/YY)
538 slari 03/24/11 - OCIRoundTripCallback
539 slynn 03/18/08 - OCILobSet/SetContenttype->OCILobGet/SetContentType
540 amullick 02/11/08 - add OCILobGet/SetContenttype APIs
541 schoi 02/27/07 - OCILobGet/SetOptions API change
542 slynn 07/28/06 - Migrate to new 11g LOB terminology
543 hqian 05/22/06 - add OCI_SYSASM
544 slynn 06/21/06 - Add Lob Get Shared Regions Functionality
545 slynn 05/25/06 - New NG Lob Functionality.
546 jawilson 05/22/06 - add TDO out parameter for streaming enq callback
547 aramappa 01/19/06 - Added OCIArrayDescriptorAlloc,
548 OCIArrayDescriptorFree
549 jawilson 02/09/06 - add OCIAQEnqStreaming
550 mxu 03/08/06 - Fix bug 5037807
551 srseshad 09/12/05 - stmtcache: callback
552 mbastawa 09/16/05 - dbhygiene
553 dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
554 nbhatt 06/17/04 - merge conflicts
555 nbhatt 05/24/04 - merge conflicts
556 weiwang 05/06/04 - add OCIAQListen2
557 rvissapr 06/21/04 - add OCIAppCtx API
558 debanerj 05/17/04 - 13064: LOB array Read and Write
559 aahluwal 06/02/04 - [OCI Events]: add OCIInitEventHandle
560 nikeda 05/28/04 - grabtrans 'nikeda_oci_events_copy'
561 nikeda 05/13/04 - [OCI Events] Rename HACBK->EVTCBK, HACTX->EVTCTX
562 nikeda 05/10/04 - [OCI Events] code review changes
563 aahluwal 04/09/04 - [OCI Events]: add OCIHAServerHandleGet
564 nikeda 03/18/04 - [OCI Events] New Server Handle Callback
565 dfrumkin 12/04/03 - Add OCIDBStartup, OCIDBShutdown
566 jciminsk 12/12/03 - merge from RDBMS_MAIN_SOLARIS_031209
567 sgollapu 06/26/03 - Change OCIPing prototype
568 sgollapu 05/05/03 - Add OCIPing
569 debanerj 01/16/03 - Bug 2753018: Lob Locator parameter for
570 OCILobGetStorageLimit
571 rpingte 05/06/04 - add OCIClientVersion
572 debanerj 08/26/03 - 6003: Lob interface changes
573 sgollapu 06/23/03 - Add OCIPing
574 debanerj 01/16/03 - Bug 2753018: Lob Locator parameter for
575 OCILobGetStorageLimit
576 tkeefe 02/17/03 - bug-2773794: Add new interface for setting Kerb attrs
577 ataracha 01/03/03 - Move OCIXMLType functions to ocixml.h
578 akatti 11/28/02 - [2521361]:add OCIRowidToChar prototype
579 chliang 10/23/02 - add OCIFetchRowCallback
580 cparampa 10/13/02 - Fix the prototype of OCIAQListen(ansi prototype)
581 chliang 10/12/02 - add OCIBindRowCallback
582 debanerj 09/30/02 - Unlimited size LOB 6003
583 thoang 09/25/02 - Add csid to XMLType create functions
584 thoang 04/19/02 - Add OCIXMLTypeGetNS
585 aahluwal 08/09/02 - adding OCIAQDeqArray
586 aahluwal 06/03/02 - bug 2360115
587 skabraha 04/16/02 - fix compiler warnings
588 sichandr 02/12/02 - fix OCIXMLTypeExists
589 gayyappa 02/01/02 - fix 2210776 : change Dom to DOM
590 sichandr 10/24/01 - OCISvcCtx for XMLType create routines
591 schandir 09/14/01 - Add prototypes for Stmt Caching
592 abande 09/04/01 - Add Prototypes for Session Pooling Methods
593 stakeda 09/12/01 - add OCINlsCharSetConvert
594 whe 08/28/01 - add OCIEnvNlsCreate
595 wzhang 08/22/01 - Add OCINlsCharSetNameToId.
596 whe 10/05/01 - add prototype for OCIXMLType functions
597 mdmehta 04/06/01 - Bug 1683763, OCIDateTimeToText: buf_size to ub4*
598 schandir 12/12/00 - modify the ociconnectionpoolcreate() interface.
599 porangas 12/04/00 - Forward merge bug#974710 to 9i
600 rpingte 11/29/00 - Fix bug# 1485795.
601 gtarora 11/30/00 - fix comment for OCILobIsTemporary
602 akatti 11/07/00 - [1198379]:add OCIRowidToChar
603 bpalaval 10/15/00 - Forward merge 892654.
604 kmohan 09/18/00 - add OCILogon2
605 etucker 07/28/00 - add OCIIntervalFromTZ
606 vjayaram 07/18/00 - add connection pooling changes
607 etucker 07/13/00 - add dls apis for oci
608 hmasaki 07/05/00 - fix 1230846: forward merge into 8.2
609 mbastawa 06/05/00 - add OCIStmtFetch2
610 rxgovind 06/07/00 - update OCIAnyData interfaces
611 rxgovind 05/04/00 - add OCIAnyDataSet interfaces
612 rkasamse 05/01/00 - remove attrno from OCIAnyDataAttrGet
613 rkasamse 03/13/00 - add prototype s for OCCIAnyData
614 slari 09/01/99 - remove OCIEnvCallback
615 slari 08/23/99 - add OCIUcb in user callback functions
616 dsaha 07/07/99 - Add OCIFEnvCreate for forms
617 vyanaman 06/21/99 - Change OCI DateTime/Interval APIs.
618 esoyleme 07/01/99 - expose MTS performance enhancements
619 whe 06/14/99 - bug727872:add CONST to match definitions
620 kkarun 02/23/99 - Fix OCIDateTime APIs
621 jiyang 12/07/98 - Add comments for OCI_NLS_DUAL_CURRENCY
622 aroy 12/01/98 - add OCIEnvCreate
623 slari 11/23/98 - use ORASTDARG
624 slari 11/21/98 - replace ellipsis by arglist in OCIUserCallback
625 thchang 10/20/98 - correct comment on OCILobCreateTemporary
626 slari 09/08/98 - allow envh to receive error info also in CallbackReg/
627 kkarun 09/02/98 - Change const to CONST
628 aroy 08/04/98 - add OCITerminate calls
629 nramakri 06/25/98 - remove CONST from some OCIPickler APIs
630 jiyang 06/22/98 - Fix a lint error
631 nmallava 06/08/98 - ociistemporary -> envhp
632 jhasenbe 05/27/98 - Remove definitions for U-Calls (Unicode)
633 nmallava 05/18/98 - add comments
634 sgollapu 05/19/98 - Change text to OraText
635 aroy 04/20/98 - merge forward 8.0.5 -> 8.1.3
636 nbhatt 05/14/98 - aq listen call
637 lchidamb 03/02/98 - Client Notification prototypes
638 vyanaman 04/19/98 - System Timestamp
639 kkarun 04/17/98 - Add more Interval functions
640 vyanaman 04/17/98 - Fix min (proc error)
641 vyanaman 04/16/98 - Add get/set TZ
642 kkarun 04/13/98 - Add Datetime prototypes
643 rkasamse 04/13/98 - change OCIEnv* to dvoid* for context/memory cart serv
644 rkasamse 04/15/98 - chage pickler cart interface
645 slari 03/20/98 - change proto of OCIUserCallback
646 slari 02/17/98 - add OCIUserCallback
647 jiyang 04/02/98 - Accept both env and user handles for NLS
648 rkasamse 03/20/98 - remove prototypes for OCIMemoryDuration* functions.
649 tsaulys 03/20/98 - use environment or session handle
650 nmallava 04/09/98 - OCILobLocatorAssign
651 nmallava 04/07/98 - lobgetchunksize and writeappend apis
652 jhasenbe 04/06/98 - Add new interfaces for Unicode support
653 nmallava 03/17/98 - add interfaces
654 nmallava 03/16/98 - add open/close apis
655 nmallava 03/10/98 - add temporary lobs apis
656 sgollapu 07/10/97 - Add OCIReset
657 sgollapu 02/09/98 - OCI non-blocking
658 nramakri 01/16/98 - remove #ifdef NEVER clause for OCIExtract
659 rmurthy 01/08/98 - OCIContextGenerateKey: change ub1 to ub4
660 ewaugh 12/18/97 - Turn type wrappers into functions.
661 skabraha 12/02/97 - adding OCIFile functions
662 rhwu 12/02/97 - add OCI Thread
663 nramakri 12/15/97 - move to core4
664 nramakri 12/11/97 - modify OCIExtract prototype
665 ewaugh 12/10/97 - add OCIFormat prototypes
666 nmallava 12/17/97 - Add ilob open and close apis
667 rkasamse 12/03/97 - Change some of the function names for pickler cartrid
668 nramakri 11/12/97 - add OCIExtract prototypes
669 rkasamse 11/21/97 - add prototypes for memory cartridge services and cont
670 rkasamse 11/03/97 - Add pickler cartridge interfaces.
671 jiyang 11/11/97 - Add NLS service for cartridge
672 tanguyen 08/19/97 -
673 cxcheng 07/30/97 - replace OCISvcCtx with OCISvcCtx
674 schandra 06/25/97 - AQ OCI interface
675 bnainani 07/21/97 - add prototypes for Oracle XA extensions
676 esoyleme 05/13/97 - move failover callback prototype
677 skmishra 05/06/97 - stdc compiler fixes
678 skmishra 04/24/97 - C++ Compatibility changes
679 skotsovo 04/21/97 - make lob parameter names consistent
680 rwhitman 04/16/97 - Fix LOB prototypes - Olint OCI 8.0.3
681 ramkrish 04/15/97 - Add free flag to OCILobFlushBuffer
682 dchatter 04/10/97 - add nzt.h inclusion
683 cxcheng 04/09/97 - change objnamp from CONST text* to dvoid*
684 cxcheng 04/08/97 - fix prototype of OCIDescribeAny()
685 skotsovo 03/31/97 - remove OCILobLocatorSize
686 skotsovo 03/27/97 - add OCILobLoadFromFile
687 bcchang 02/18/97 - Fix syntax error
688 dchatter 01/13/97 - fix comments on LOB calls
689 aroy 01/10/97 - remove ocilobfilecreate delete
690 sgollapu 12/27/96 - Correct OCILogon prototype
691 dchatter 01/04/97 - comments to describe the functions
692 sgollapu 11/25/96 - Change OCILobFileIsExistent
693 schandra 11/18/96 - Remove xa.h include
694 sgollapu 11/09/96 - Change prototype of OCIDescribeAny
695 dchatter 10/31/96 - delete CONST from lob write cb fn
696 dchatter 10/30/96 - more changes
697 dchatter 10/26/96 - lob/file long name corrections
698 slari 10/16/96 - delete unused calls
699 rwessman 10/29/96 - Fixed OCISecurityGetIdentity prototype
700 bcchang 10/25/96 - Fix syntax error
701 sgollapu 10/22/96 - Add OCILogon and OCILogoff
702 rwessman 10/16/96 - Added cryptographic and digital signature functions
703 sgollapu 10/10/96 - Add ocibdp and ocibdn
704 rxgovind 10/07/96 - add oci file calls
705 skotsovo 10/01/96 - move orl lob fnts to oci
706 skotsovo 09/20/96 - in OCILobGetLength(), remove the 'isnull' parameter.
707 aroy 08/29/96 - change prototype for Nchar Lob support
708 dchatter 08/21/96 - OCIResultSetToStmt prototype change
709 sthakur 08/14/96 - add OCIParamSet
710 schandra 07/26/96 - TX OCI return values - sb4->sword
711 aroy 07/17/96 - terminology change: OCILobLocator => OCILobLocator
712 dchatter 07/01/96 - create ANSI prototypes
713 dchatter 07/01/96 - Creation
714
715*/
716
717
718#ifndef OCIAP_ORACLE
719# define OCIAP_ORACLE
720
721# ifndef ORATYPES
722# include <oratypes.h>
723# endif
724
725#ifndef ORASTDARG
726#include <stdarg.h>
727#define ORASTDARG
728#endif
729
730#ifndef OCIDFN
731#include <ocidfn.h>
732#endif
733
734#ifndef NZT_ORACLE
735#include <nzt.h>
736#endif /* NZT_ORACLE */
737
738#ifndef OCI_ORACLE
739#include <oci.h>
740#endif
741
742#ifndef ORT_ORACLE
743#include <ort.h>
744#endif
745
746
747
748/*---------------------------------------------------------------------------
749 PUBLIC TYPES AND CONSTANTS
750 ---------------------------------------------------------------------------*/
751
752
753/*---------------------------------------------------------------------------
754 PRIVATE TYPES AND CONSTANTS
755 ---------------------------------------------------------------------------*/
756
757
758/*---------------------------------------------------------------------------
759 PUBLIC FUNCTIONS
760 ---------------------------------------------------------------------------*/
761
762/*****************************************************************************
763 DESCRIPTION
764******************************************************************************
765Note: the descriptions of the functions are alphabetically arranged. Please
766maintain the arrangement when adding a new function description. The actual
767prototypes are below this comment section and donot follow any alphabetical
768ordering.
769
770
771--------------------------------OCIAttrGet------------------------------------
772
773OCIAttrGet()
774Name
775OCI Attribute Get
776Purpose
777This call is used to get a particular attribute of a handle.
778Syntax
779sword OCIAttrGet ( const void *trgthndlp,
780 ub4 trghndltyp,
781 void *attributep,
782 ub4 *sizep,
783 ub4 attrtype,
784 OCIError *errhp );
785Comments
786This call is used to get a particular attribute of a handle.
787See Appendix B, "Handle Attributes", for a list of handle types and their
788readable attributes.
789Parameters
790trgthndlp (IN) - is the pointer to a handle type.
791trghndltyp (IN) - is the handle type.
792attributep (OUT) - is a pointer to the storage for an attribute value. The
793attribute value is filled in.
794sizep (OUT) - is the size of the attribute value.
795This can be passed in as NULL for most parameters as the size is well known.
796For text* parameters, a pointer to a ub4 must be passed in to get the length
797of the string.
798attrtype (IN) - is the type of attribute.
799errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
800diagnostic information in the event of an error.
801Related Functions
802OCIAttrSet()
803
804--------------------------------OCIAttrSet------------------------------------
805
806
807OCIAttrSet()
808Name
809OCI Attribute Set
810Purpose
811This call is used to set a particular attribute of a handle or a descriptor.
812Syntax
813sword OCIAttrSet ( void *trgthndlp,
814 ub4 trghndltyp,
815 void *attributep,
816 ub4 size,
817 ub4 attrtype,
818 OCIError *errhp );
819Comments
820This call is used to set a particular attribute of a handle or a descriptor.
821See Appendix B for a list of handle types and their writeable attributes.
822Parameters
823trghndlp (IN/OUT) - the pointer to a handle type whose attribute gets
824modified.
825trghndltyp (IN/OUT) - is the handle type.
826attributep (IN) - a pointer to an attribute value.
827The attribute value is copied into the target handle. If the attribute value
828is a pointer, then only the pointer is copied, not the contents of the pointer.
829size (IN) - is the size of an attribute value. This can be passed in as 0 for
830most attributes as the size is already known by the OCI library. For text*
831attributes, a ub4 must be passed in set to the length of the string.
832attrtype (IN) - the type of attribute being set.
833errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
834diagnostic information in the event of an error.
835Related Functions
836OCIAttrGet()
837
838
839
840--------------------------------OCIBindArrayOfStruct--------------------------
841
842
843
844OCIBindArrayOfStruct()
845Name
846OCI Bind for Array of Structures
847Purpose
848This call sets up the skip parameters for a static array bind.
849Syntax
850sword OCIBindArrayOfStruct ( OCIBind *bindp,
851 OCIError *errhp,
852 ub4 pvskip,
853 ub4 indskip,
854 ub4 alskip,
855 ub4 rcskip );
856Comments
857This call sets up the skip parameters necessary for a static array bind.
858This call follows a call to OCIBindByName() or OCIBindByPos(). The bind
859handle returned by that initial bind call is used as a parameter for the
860OCIBindArrayOfStruct() call.
861For information about skip parameters, see the section "Arrays of Structures"
862on page 4-16.
863Parameters
864bindp (IN) - the handle to a bind structure.
865errhp (IN) - an error handle which can be passed to OCIErrorGet() for
866diagnostic information in the event of an error.
867pvskip (IN) - skip parameter for the next data value.
868indskip (IN) - skip parameter for the next indicator value or structure.
869alskip (IN) - skip parameter for the next actual length value.
870rcskip (IN) - skip parameter for the next column-level return code value.
871Related Functions
872OCIAttrGet()
873
874
875--------------------------------OCIBindByName---------------------------------
876
877OCIBindByName()
878Name
879OCI Bind by Name
880Purpose
881Creates an association between a program variable and a placeholder in a SQL
882statement or PL/SQL block.
883Syntax
884sword OCIBindByName (
885 OCIStmt *stmtp,
886 OCIBind **bindp,
887 OCIError *errhp,
888 const OraText *placeholder,
889 sb4 placeh_len,
890 void *valuep,
891 sb4 value_sz,
892 ub2 dty,
893 void *indp,
894 ub2 *alenp,
895 ub2 *rcodep,
896 ub4 maxarr_len,
897 ub4 *curelep,
898 ub4 mode );
899Description
900This call is used to perform a basic bind operation. The bind creates an
901association between the address of a program variable and a placeholder in a
902SQL statement or PL/SQL block. The bind call also specifies the type of data
903which is being bound, and may also indicate the method by which data will be
904provided at runtime.
905This function also implicitly allocates the bind handle indicated by the bindp
906parameter.
907Data in an OCI application can be bound to placeholders statically or
908dynamically. Binding is static when all the IN bind data and the OUT bind
909buffers are well-defined just before the execute. Binding is dynamic when the
910IN bind data and the OUT bind buffers are provided by the application on
911demand at execute time to the client library. Dynamic binding is indicated by
912setting the mode parameter of this call to OCI_DATA_AT_EXEC.
913Related Functions: For more information about dynamic binding, see
914the section "Runtime Data Allocation and Piecewise Operations" on
915page 5-16.
916Both OCIBindByName() and OCIBindByPos() take as a parameter a bind handle,
917which is implicitly allocated by the bind call A separate bind handle is
918allocated for each placeholder the application is binding.
919Additional bind calls may be required to specify particular attributes
920necessary when binding certain data types or handling input data in certain
921ways:
922If arrays of structures are being utilized, OCIBindArrayOfStruct() must
923be called to set up the necessary skip parameters.
924If data is being provided dynamically at runtime, and the application
925will be using user-defined callback functions, OCIBindDynamic() must
926be called to register the callbacks.
927If a named data type is being bound, OCIBindObject() must be called to
928specify additional necessary information.
929Parameters
930stmth (IN/OUT) - the statement handle to the SQL or PL/SQL statement
931being processed.
932bindp (IN/OUT) - a pointer to a pointer to a bind handle which is implicitly
933allocated by this call. The bind handle maintains all the bind information
934for this particular input value. The handle is feed implicitly when the
935statement handle is deallocated.
936errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
937diagnostic information in the event of an error.
938placeholder (IN) - the placeholder attributes are specified by name if
939ocibindn() is being called.
940placeh_len (IN) - the length of the placeholder name specified in placeholder.
941valuep (IN/OUT) - a pointer to a data value or an array of data values of the
942type specified in the dty parameter. An array of data values can be specified
943for mapping into a PL/SQL table or for providing data for SQL multiple-row
944operations. When an array of bind values is provided, this is called an array
945bind in OCI terms. Additional attributes of the array bind (not bind to a
946column of ARRAY type) are set up in OCIBindArrayOfStruct() call.
947For a REF, named data type bind, the valuep parameter is used only for IN
948bind data. The pointers to OUT buffers are set in the pgvpp parameter
949initialized by OCIBindObject(). For named data type and REF binds, the bind
950values are unpickled into the Object Cache. The OCI object navigational calls
951can then be used to navigate the objects and the refs in the Object Cache.
952If the OCI_DATA_AT_EXEC mode is specified in the mode parameter, valuep
953is ignored for all data types. OCIBindArrayOfStruct() cannot be used and
954OCIBindDynamic() must be invoked to provide callback functions if desired.
955value_sz (IN) - the size of a data value. In the case of an array bind, this is
956the maximum size of any element possible with the actual sizes being specified
957in the alenp parameter.
958If the OCI_DATA_AT_EXEC mode is specified, valuesz defines the maximum
959size of the data that can be ever provided at runtime for data types other than
960named data types or REFs.
961dty (IN) - the data type of the value(s) being bound. Named data types
962(SQLT_NTY) and REFs (SQLT_REF) are valid only if the application has been
963initialized in object mode. For named data types, or REFs, additional calls
964must be made with the bind handle to set up the datatype-specific attributes.
965indp (IN/OUT) - pointer to an indicator variable or array. For scalar data
966types, this is a pointer to sb2 or an array of sb2s. For named data types,
967this pointer is ignored and the actual pointer to the indicator structure or
968an array of indicator structures is initialized by OCIBindObject().
969Ignored for dynamic binds.
970See the section "Indicator Variables" on page 2-43 for more information about
971indicator variables.
972alenp (IN/OUT) - pointer to array of actual lengths of array elements. Each
973element in alenp is the length of the data in the corresponding element in the
974bind value array before and after the execute. This parameter is ignored for
975dynamic binds.
976rcodep (OUT) - pointer to array of column level return codes. This parameter
977is ignored for dynamic binds.
978maxarr_len (IN) - the maximum possible number of elements of type dty in a
979PL/SQL binds. This parameter is not required for non-PL/SQL binds. If
980maxarr_len is non-zero, then either OCIBindDynamic() or
981OCIBindArrayOfStruct() can be invoked to set up additional bind attributes.
982curelep(IN/OUT) - a pointer to the actual number of elements. This parameter
983is only required for PL/SQL binds.
984mode (IN) - the valid modes for this parameter are:
985OCI_DEFAULT. This is default mode.
986OCI_DATA_AT_EXEC. When this mode is selected, the value_sz
987parameter defines the maximum size of the data that can be ever
988provided at runtime. The application must be ready to provide the OCI
989library runtime IN data buffers at any time and any number of times.
990Runtime data is provided in one of the two ways:
991callbacks using a user-defined function which must be registered
992with a subsequent call to OCIBindDynamic().
993a polling mechanism using calls supplied by the OCI. This mode
994is assumed if no callbacks are defined.
995For more information about using the OCI_DATA_AT_EXEC mode, see
996the section "Runtime Data Allocation and Piecewise Operations" on
997page 5-16.
998When the allocated buffers are not required any more, they should be
999freed by the client.
1000Related Functions
1001OCIBindDynamic(), OCIBindObject(), OCIBindArrayOfStruct(), OCIAttrGet()
1002
1003
1004
1005-------------------------------OCIBindByPos-----------------------------------
1006
1007
1008OCIBindByPos()
1009Name
1010OCI Bind by Position
1011Purpose
1012Creates an association between a program variable and a placeholder in a SQL
1013statement or PL/SQL block.
1014Syntax
1015sword OCIBindByPos (
1016 OCIStmt *stmtp,
1017 OCIBind **bindp,
1018 OCIError *errhp,
1019 ub4 position,
1020 void *valuep,
1021 sb4 value_sz,
1022 ub2 dty,
1023 void *indp,
1024 ub2 *alenp,
1025 ub2 *rcodep,
1026 ub4 maxarr_len,
1027 ub4 *curelep,
1028 ub4 mode);
1029
1030Description
1031This call is used to perform a basic bind operation. The bind creates an
1032association between the address of a program variable and a placeholder in a
1033SQL statement or PL/SQL block. The bind call also specifies the type of data
1034which is being bound, and may also indicate the method by which data will be
1035provided at runtime.
1036This function also implicitly allocates the bind handle indicated by the bindp
1037parameter.
1038Data in an OCI application can be bound to placeholders statically or
1039dynamically. Binding is static when all the IN bind data and the OUT bind
1040buffers are well-defined just before the execute. Binding is dynamic when the
1041IN bind data and the OUT bind buffers are provided by the application on
1042demand at execute time to the client library. Dynamic binding is indicated by
1043setting the mode parameter of this call to OCI_DATA_AT_EXEC.
1044Related Functions: For more information about dynamic binding, see
1045the section "Runtime Data Allocation and Piecewise Operations" on
1046page 5-16
1047Both OCIBindByName() and OCIBindByPos() take as a parameter a bind handle,
1048which is implicitly allocated by the bind call A separate bind handle is
1049allocated for each placeholder the application is binding.
1050Additional bind calls may be required to specify particular attributes
1051necessary when binding certain data types or handling input data in certain
1052ways:
1053If arrays of structures are being utilized, OCIBindArrayOfStruct() must
1054be called to set up the necessary skip parameters.
1055If data is being provided dynamically at runtime, and the application
1056will be using user-defined callback functions, OCIBindDynamic() must
1057be called to register the callbacks.
1058If a named data type is being bound, OCIBindObject() must be called to
1059specify additional necessary information.
1060Parameters
1061stmth (IN/OUT) - the statement handle to the SQL or PL/SQL statement
1062being processed.
1063bindp (IN/OUT) - a pointer to a pointer to a bind handle which is implicitly
1064allocated by this call. The bind handle maintains all the bind information
1065for this particular input value. The handle is feed implicitly when the
1066statement handle is deallocated.
1067errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
1068diagnostic information in the event of an error.
1069position (IN) - the placeholder attributes are specified by position if
1070ocibindp() is being called.
1071valuep (IN/OUT) - a pointer to a data value or an array of data values of the
1072type specified in the dty parameter. An array of data values can be specified
1073for mapping into a PL/SQL table or for providing data for SQL multiple-row
1074operations. When an array of bind values is provided, this is called an array
1075bind in OCI terms. Additional attributes of the array bind (not bind to a
1076column of ARRAY type) are set up in OCIBindArrayOfStruct() call.
1077For a REF, named data type bind, the valuep parameter is used only for IN
1078bind data. The pointers to OUT buffers are set in the pgvpp parameter
1079initialized by OCIBindObject(). For named data type and REF binds, the bind
1080values are unpickled into the Object Cache. The OCI object navigational calls
1081can then be used to navigate the objects and the refs in the Object Cache.
1082If the OCI_DATA_AT_EXEC mode is specified in the mode parameter, valuep
1083is ignored for all data types. OCIBindArrayOfStruct() cannot be used and
1084OCIBindDynamic() must be invoked to provide callback functions if desired.
1085value_sz (IN) - the size of a data value. In the case of an array bind, this is
1086the maximum size of any element possible with the actual sizes being specified
1087in the alenp parameter.
1088If the OCI_DATA_AT_EXEC mode is specified, valuesz defines the maximum
1089size of the data that can be ever provided at runtime for data types other than
1090named data types or REFs.
1091dty (IN) - the data type of the value(s) being bound. Named data types
1092(SQLT_NTY) and REFs (SQLT_REF) are valid only if the application has been
1093initialized in object mode. For named data types, or REFs, additional calls
1094must be made with the bind handle to set up the datatype-specific attributes.
1095indp (IN/OUT) - pointer to an indicator variable or array. For scalar data
1096types, this is a pointer to sb2 or an array of sb2s. For named data types,
1097this pointer is ignored and the actual pointer to the indicator structure or
1098an array of indicator structures is initialized by OCIBindObject(). Ignored
1099for dynamic binds.
1100See the section "Indicator Variables" on page 2-43 for more information about
1101indicator variables.
1102alenp (IN/OUT) - pointer to array of actual lengths of array elements. Each
1103element in alenp is the length of the data in the corresponding element in the
1104bind value array before and after the execute. This parameter is ignored for
1105dynamic binds.
1106rcodep (OUT) - pointer to array of column level return codes. This parameter
1107is ignored for dynamic binds.
1108maxarr_len (IN) - the maximum possible number of elements of type dty in a
1109PL/SQL binds. This parameter is not required for non-PL/SQL binds. If
1110maxarr_len is non-zero, then either OCIBindDynamic() or
1111OCIBindArrayOfStruct() can be invoked to set up additional bind attributes.
1112curelep(IN/OUT) - a pointer to the actual number of elements. This parameter
1113is only required for PL/SQL binds.
1114mode (IN) - the valid modes for this parameter are:
1115OCI_DEFAULT. This is default mode.
1116OCI_DATA_AT_EXEC. When this mode is selected, the value_sz
1117parameter defines the maximum size of the data that can be ever
1118provided at runtime. The application must be ready to provide the OCI
1119library runtime IN data buffers at any time and any number of times.
1120Runtime data is provided in one of the two ways:
1121callbacks using a user-defined function which must be registered
1122with a subsequent call to OCIBindDynamic() .
1123a polling mechanism using calls supplied by the OCI. This mode
1124is assumed if no callbacks are defined.
1125For more information about using the OCI_DATA_AT_EXEC mode, see
1126the section "Runtime Data Allocation and Piecewise Operations" on
1127page 5-16.
1128When the allocated buffers are not required any more, they should be
1129freed by the client.
1130Related Functions
1131OCIBindDynamic(), OCIBindObject(), OCIBindArrayOfStruct(), OCIAttrGet()
1132
1133
1134
1135-------------------------------OCIBindDynamic---------------------------------
1136
1137OCIBindDynamic()
1138Name
1139OCI Bind Dynamic Attributes
1140Purpose
1141This call is used to register user callbacks for dynamic data allocation.
1142Syntax
1143sword OCIBindDynamic( OCIBind *bindp,
1144 OCIError *errhp,
1145 void *ictxp,
1146 OCICallbackInBind (icbfp)(
1147 void *ictxp,
1148 OCIBind *bindp,
1149 ub4 iter,
1150 ub4 index,
1151 void **bufpp,
1152 ub4 *alenp,
1153 ub1 *piecep,
1154 void **indp ),
1155 void *octxp,
1156 OCICallbackOutBind (ocbfp)(
1157 void *octxp,
1158 OCIBind *bindp,
1159 ub4 iter,
1160 ub4 index,
1161 void **bufp,
1162 ub4 **alenpp,
1163 ub1 *piecep,
1164 void **indpp,
1165 ub2 **rcodepp) );
1166Comments
1167This call is used to register user-defined callback functions for providing
1168data for an UPDATE or INSERT if OCI_DATA_AT_EXEC mode was specified in a
1169previous call to OCIBindByName() or OCIBindByPos().
1170The callback function pointers must return OCI_CONTINUE if it the call is
1171successful. Any return code other than OCI_CONTINUE signals that the client
1172wishes to abort processing immediately.
1173For more information about the OCI_DATA_AT_EXEC mode, see the section
1174"Runtime Data Allocation and Piecewise Operations" on page 5-16.
1175Parameters
1176bindp (IN/OUT) - a bind handle returned by a call to OCIBindByName() or
1177OCIBindByPos().
1178errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
1179diagnostic information in the event of an error.
1180ictxp (IN) - the context pointer required by the call back function icbfp.
1181icbfp (IN) - the callback function which returns a pointer to the IN bind
1182value or piece at run time. The callback takes in the following parameters.
1183ictxp (IN/OUT) - the context pointer for this callback function.
1184bindp (IN) - the bind handle passed in to uniquely identify this bind
1185variable.
1186iter (IN) - 1-based execute iteration value.
1187index (IN) - index of the current array, for an array bind. 1 based not
1188greater than curele parameter of the bind call.
1189index (IN) - index of the current array, for an array bind. This parameter
1190is 1-based, and may not be greater than curele parameter of the bind call.
1191bufpp (OUT) - the pointer to the buffer.
1192piecep (OUT) - which piece of the bind value. This can be one of the
1193following values - OCI_ONE_PIECE, OCI_FIRST_PIECE,
1194OCI_NEXT_PIECE and OCI_LAST_PIECE.
1195indp (OUT) - contains the indicator value. This is apointer to either an
1196sb2 value or a pointer to an indicator structure for binding named data
1197types.
1198indszp (OUT) - contains the indicator value size. A pointer containing
1199the size of either an sb2 or an indicator structure pointer.
1200octxp (IN) - the context pointer required by the callback function ocbfp.
1201ocbfp (IN) - the callback function which returns a pointer to the OUT bind
1202value or piece at run time. The callback takes in the following parameters.
1203octxp (IN/OUT) - the context pointer for this call back function.
1204bindp (IN) - the bind handle passed in to uniquely identify this bind
1205variable.
1206iter (IN) - 1-based execute iteration value.
1207index (IN) - index of the current array, for an array bind. This parameter
1208is 1-based, and must not be greater than curele parameter of the bind call.
1209bufpp (OUT) - a pointer to a buffer to write the bind value/piece.
1210buflp (OUT) - returns the buffer size.
1211alenpp (OUT) - a pointer to a storage for OCI to fill in the size of the bind
1212value/piece after it has been read.
1213piecep (IN/OUT) - which piece of the bind value. It will be set by the
1214library to be one of the following values - OCI_ONE_PIECE or
1215OCI_NEXT_PIECE. The callback function can leave it unchanged or set
1216it to OCI_FIRST_PIECE or OCI_LAST_PIECE. By default -
1217OCI_ONE_PIECE.
1218indpp (OUT) - returns a pointer to contain the indicator value which
1219either an sb2 value or a pointer to an indicator structure for named data
1220types.
1221indszpp (OUT) - returns a pointer to return the size of the indicator
1222value which is either size of an sb2 or size of an indicator structure.
1223rcodepp (OUT) - returns a pointer to contains the return code.
1224Related Functions
1225OCIAttrGet()
1226
1227
1228---------------------------------OCIBindObject--------------------------------
1229
1230
1231OCIBindObject()
1232Name
1233OCI Bind Object
1234Purpose
1235This function sets up additional attributes which are required for a named
1236data type (object) bind.
1237Syntax
1238sword OCIBindObject ( OCIBind *bindp,
1239 OCIError *errhp,
1240 const OCIType *type,
1241 void **pgvpp,
1242 ub4 *pvszsp,
1243 void **indpp,
1244 ub4 *indszp, );
1245Comments
1246This function sets up additional attributes which binding a named data type
1247or a REF. An error will be returned if this function is called when the OCI
1248environment has been initialized in non-object mode.
1249This call takes as a paramter a type descriptor object (TDO) of datatype
1250OCIType for the named data type being defined. The TDO can be retrieved
1251with a call to OCITypeByName().
1252If the OCI_DATA_AT_EXEC mode was specified in ocibindn() or ocibindp(), the
1253pointers to the IN buffers are obtained either using the callback icbfp
1254registered in the OCIBindDynamic() call or by the OCIStmtSetPieceInfo() call.
1255The buffers are dynamically allocated for the OUT data and the pointers to
1256these buffers are returned either by calling ocbfp() registered by the
1257OCIBindDynamic() or by setting the pointer to the buffer in the buffer passed
1258in by OCIStmtSetPieceInfo() called when OCIStmtExecute() returned
1259OCI_NEED_DATA. The memory of these client library- allocated buffers must be
1260freed when not in use anymore by using the OCIObjectFreee() call.
1261Parameters
1262bindp ( IN/OUT) - the bind handle returned by the call to OCIBindByName()
1263or OCIBindByPos().
1264errhp ( IN/OUT) - an error handle which can be passed to OCIErrorGet() for
1265diagnostic information in the event of an error.
1266type ( IN) - points to the TDO which describes the type of the program
1267variable being bound. Retrieved by calling OCITypeByName().
1268pgvpp ( IN/OUT) - points to a pointer to the program variable buffer. For an
1269array, pgvpp points to an array of pointers. When the bind variable is also an
1270OUT variable, the OUT Named Data Type value or REF is allocated
1271(unpickled) in the Object Cache, and a pointer to the value or REF is returned,
1272At the end of execute, when all OUT values have been received, pgvpp points
1273to an array of pointer(s) to these newly allocated named data types in the
1274object cache.
1275pgvpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the Named
1276Data Type buffers are requested at runtime. For static array binds, skip
1277factors may be specified using the OCIBindArrayOfStruct() call. The skip
1278factors are used to compute the address of the next pointer to the value, the
1279indicator structure and their sizes.
1280pvszsp ( IN/OUT) - points to the size of the program variable. The size of the
1281named data type is not required on input. For an array, pvszsp is an array of
1282ub4s. On return, for OUT bind variables, this points to size(s) of the Named
1283Data Types and REFs received. pvszsp is ignored if the OCI_DATA_AT_EXEC
1284mode is set. Then the size of the buffer is taken at runtime.
1285indpp ( IN/OUT) - points to a pointer to the program variable buffer
1286containing the parallel indicator structure. For an array, points to an array
1287of pointers. When the bind variable is also an OUT bind variable, memory is
1288allocated in the object cache, to store the unpickled OUT indicator values. At
1289the end of the execute when all OUT values have been received, indpp points
1290to the pointer(s) to these newly allocated indicator structure(s).
1291indpp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator
1292is requested at runtime.
1293indszp ( IN/OUT) - points to the size of the IN indicator structure program
1294variable. For an array, it is an array of sb2s. On return for OUT bind
1295variables, this points to size(s) of the received OUT indicator structures.
1296indszp is ignored if the OCI_DATA_AT_EXEC mode is set. Then the indicator
1297size is requested at runtime.
1298Related Functions
1299OCIAttrGet()
1300
1301
1302
1303----------------------------------OCIBreak------------------------------------
1304
1305
1306OCIBreak()
1307Name
1308OCI Break
1309Purpose
1310This call performs an immediate (asynchronous) abort of any currently
1311executing OCI function that is associated with a server .
1312Syntax
1313sword OCIBreak ( void *hndlp,
1314 OCIError *errhp);
1315Comments
1316This call performs an immediate (asynchronous) abort of any currently
1317executing OCI function that is associated with a server. It is normally used
1318to stop a long-running OCI call being processed on the server.
1319This call can take either the service context handle or the server context
1320handle as a parameter to identify the function to be aborted.
1321Parameters
1322hndlp (IN) - the service context handle or the server context handle.
1323errhp (IN) - an error handle which can be passed to OCIErrorGet() for
1324diagnostic information in the event of an error.
1325Related Functions
1326
1327-----------------------------OCIConnectionPoolCreate --------------------------
1328Name:
1329OCIConnectionPoolCreate
1330
1331Purpose:
1332Creates the connections in the pool
1333
1334Syntax:
1335OCIConnectionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCICPool *poolhp,
1336 OraText **poolName, sb4 *poolNameLen,
1337 const Oratext *dblink, sb4 dblinkLen,
1338 ub4 connMin, ub4 connMax, ub4 connIncr,
1339 const OraText *poolUsername, sb4 poolUserLen,
1340 const OraText *poolPassword, sb4 poolPassLen,
1341 ub4 mode)
1342Comments:
1343This call is used to create a connection pool. conn_min connections
1344to the database are started on calling OCIConnectionPoolCreate.
1345
1346Parameters:
1347envhp (IN/OUT) - A pointer to the environment where the Conencton Pool
1348 is to be created
1349errhp (IN/OUT) - An error handle which can be passed to OCIErrorGet().
1350poolhp (IN/OUT) - An uninitialiazed pool handle.
1351poolName (OUT) - The connection pool name.
1352poolNameLen (OUT) - The length of the connection pool name
1353dblink (IN/OUT) - Specifies the database(server) to connect. This will also
1354 be used as the default pool name.
1355dblinkLen (IN) - The length of the string pointed to by dblink.
1356connMin (IN) - Specifies the minimum number of connections in the
1357 Connection Pool at any instant.
1358 connMin number of connections are started when
1359 OCIConnectionPoolCreate() is called.
1360connMax (IN) - Specifies the maximum number of connections that can be
1361 opened to the database. Once this value is reached, no
1362 more connections are opened.
1363connIncr (IN) - Allows application to set the next increment for
1364 connections to be opened to the database if the current
1365 number of connections are less than conn_max.
1366poolUsername (IN/OUT) - Connection pooling requires an implicit proxy
1367 session and this attribute provides a username
1368 for that session.
1369poolUserLen (IN) - This represents the length of pool_username.
1370poolPassword (IN/OUT) - The password for the parameter pool_username passed
1371 above.
1372poolPassLen (IN) - This represents the length of pool_password.
1373
1374mode (IN) - The modes supported are OCI_DEFAULT and
1375OCI_CPOOL_REINITIALIZE
1376
1377Related Functions
1378OCIConnectionPoolDestroy()
1379
1380---------------------------------------------------------------------------
1381
1382----------------------------OCIConnectionPoolDestroy-------------------------
1383Name:
1384OCIConnectionPoolDestroy
1385
1386Purpose:
1387Terminates the connections in the pool
1388
1389Syntax:
1390OCIConnectionPoolDestroy (OCICPool *poolhp, OCIError *errhp, ub4 mode)
1391
1392Comments:
1393On calling OCIConnectionPoolDestroy, all the open connections in the pool
1394are closed and the pool is destroyed.
1395
1396Parameters:
1397poolhp (IN/OUT) - An initialiazed pool handle.
1398errhp (IN/OUT) - An error handle which can be passed to OCIErrorGet().
1399mode (IN) - Currently, OCIConnectionPoolDestroy() will support only
1400 the OCI_DEFAULT mode.
1401
1402Related Functions:
1403OCIConnectionPoolCreate()
1404
1405-----------------------------------------------------------------------------
1406----------------------------OCISessionPoolCreate-----------------------------
1407Name:
1408OCISessionPoolCreate
1409
1410Purpose:
1411Creates the sessions in the session pool.
1412
1413Syntax:
1414sword OCISessionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCISpool *spoolhp,
1415 OraText **poolName, ub4 *poolNameLen,
1416 const OraText *connStr, ub4 connStrLen,
1417 ub4 sessMin, ub4 sessMax, ub4 sessIncr,
1418 OraText *userid, ub4 useridLen,
1419 OraText *password, ub4 passwordLen,
1420 ub4 mode)
1421
1422Comments:
1423When OCISessionPoolCreate is called, a session pool is initialized for
1424the associated environment and the database specified by the
1425connStr parameter. This pool is named uniquely and the name
1426is returned to the user in the poolname parameter.
1427
1428Parameters:
1429envhp (IN/OUT) - A pointer to the environment handle in which the session
1430 pool needs to be created.
1431errhp (IN/OUT) - An error handle which can be passed to OCIErrorGet().
1432spoolhp (IN/OUT) - A pointer to the session pool handle that is created.
1433poolName (OUT) - Session pool name returned to the user.
1434poolNameLen (OUT) - Length of the PoolName
1435connStr (IN) - The TNS alias of the database to connect to.
1436connStrLen (IN) - Length of the connStr.
1437sessMin (IN) - Specifies the minimum number of sessions in the Session Pool.
1438 These are the number of sessions opened in the beginning, if
1439 in Homogeneous mode. Else, the parameter is ignored.
1440sessMax (IN) - Specifies the maximum number of sessions in the Session Pool.
1441 Once this value is reached, no more sessions are opened,
1442 unless the OCI_ATTR_SPOOL_FORCEGET is set.
1443userid (IN) - Specifies the userid with which to start up the sessions.
1444useridLen (IN) - Length of userid.
1445password (IN) - Specifies the password for the corresponding userid.
1446passwordLen (IN) - Specifies the length of the password
1447mode(IN) - May be OCI_DEFAULT, OCI_SPC_SPOOL_REINITIALIZE, or
1448 OCI_SPC_SPOOL_HOMOGENEOUS.
1449
1450Returns:
1451SUCCESS - If pool could be allocated and created successfully.
1452ERROR - If above conditions could not be met.
1453
1454Related Functions:
1455OCISessionPoolDestroy()
1456-----------------------------------------------------------------------------
1457-----------------------------OCISessionPoolDestroy---------------------------
1458Name:
1459OCISessionPoolDestroy
1460
1461Purpose:
1462Terminates all the sessions in the session pool.
1463
1464Syntax:
1465sword OCISessionPoolDestroy (OCISPool *spoolhp, OCIError *errhp, ub4 mode)
1466
1467Comments:
1468spoolhp (IN/OUT) - The pool handle of the session pool to be destroyed.
1469errhp (IN/OUT) - An error handle which can be passed to OCIErrorGet().
1470mode (IN) - Currently only OCI_DEFAULT mode is supported.
1471
1472Returns:
1473SUCCESS - All the sessions could be closed.
1474ERROR - If the above condition is not met.
1475
1476Related Functions:
1477OCISessionPoolCreate()
1478-----------------------------------------------------------------------------
1479-------------------------------OCISessionGet---------------------------------
1480Name:
1481OCISessionGet
1482
1483Purpose:
1484Get a session. This could be from a session pool, connection pool or
1485a new standalone session.
1486
1487Syntax:
1488sword OCISessionGet(OCIenv *envhp, OCIError *errhp, OCISvcCtx **svchp,
1489 OCIAuthInfo *authhp,
1490 OraText *poolName, ub4 poolName_len,
1491 const OraText *tagInfo, ub4 tagInfo_len,
1492 OraText **retTagInfo, ub4 *retTagInfo_len,
1493 boolean *found,
1494 ub4 mode)
1495
1496Comments:
1497envhp (IN/OUT) - OCI environment handle.
1498errhp (IN/OUT) - OCI error handle to be passed to OCIErrorGet().
1499svchp (IN/OUT) - Address of an OCI service context pointer. This will be
1500 filled with a server and session handle, attached to the
1501 pool.
1502authhp (IN/OUT) - OCI Authentication Information handle.
1503poolName (IN) - This indicates the session/connection pool to get the
1504 session/connection from in the OCI_SPOOL/OCI_CPOOL mode.
1505 In the OCI_DEFAULT mode it refers to the connect string.
1506poolName_len (IN) - length of poolName.
1507tagInfo (IN) - indicates the tag of the session that the user wants. If the
1508 user wants a default session, he must specify a NULL here.
1509 Only used for Session Pooling.
1510tagInfo_len (IN) - the length of tagInfo.
1511retTagInfo (OUT) - This indicates the type of session that is returned to
1512 the user. Only used for Session Pooling.
1513retTagInfo_len (OUT) - the length of retTagInfo.
1514found (OUT) - set to true if the user gets a session he had requested, else
1515 set to false. Only used for Session Pooling.
1516mode (IN) - The supported modes are OCI_DEFAULT, OCI_CRED_PROXY and
1517 OCI_GET_SPOOL_MATCHANY, OCI_SPOOL and OCI_CPOOL. OCI_SPOOL and
1518 OCI_CPOOL are mutually exclusive.
1519
1520Returns:
1521SUCCESS - if a session was successfully returned into svchp.
1522SUCCESS_WITH_INFO - if a session was successfully returned into svchp and the
1523 total number of sessions > maxsessions. Only valid for
1524 Session Pooling.
1525ERROR - If a session could not be retrieved.
1526
1527Related Functions:
1528OCISessionRelease()
1529-----------------------------------------------------------------------------
1530---------------------------OCISessionRelease---------------------------------
1531Name:
1532OCISessionRelease
1533
1534Purpose:
1535Release the session.
1536
1537Syntax:
1538sword OCISessionRelease ( OCISvcCtx *svchp, OCIError *errhp,
1539 OraText *tag, ub4 tag_len,
1540 ub4 mode);
1541
1542Comments:
1543svchp (IN/OUT) - The service context associated with the session/connection.
1544errhp (IN/OUT) - OCI error handle to be passed to OCIErrorGet().
1545tag (IN) - Only used for Session Pooling.
1546 This parameter will be ignored unless mode OCI_RLS_SPOOL_RETAG is
1547 specified. In this case, the session is labelled with this tag and
1548 returned to the pool. If this is NULL, then the session is untagged.
1549tag_len (IN) - Length of the tag. This is ignored unless mode
1550 OCI_RLS_SPOOL_RETAG is set.
1551mode (IN) - The supported modes are OCI_DEFAULT, OCI_RLS_SPOOL_DROPSESS,
1552 OCI_RLS_SPOOL_RETAG. The last 2 are only valid for Session Pooling.
1553 When OCI_RLS_SPOOL_DROPSESS is specified, the session
1554 will be removed from the session pool. If OCI_RLS_SPOOL_RETAG
1555 is set, the tag on the session will be altered. If this mode is
1556 not set, the tag and tag_len parameters will be ignored.
1557
1558Returns:
1559ERROR - If the session could not be released successfully.
1560SUCCESS - In all other cases.
1561
1562Related Functions:
1563OCISessionGet().
1564-----------------------------------------------------------------------------
1565------------------------------OCIDateTimeAssign --------------------------
1566sword OCIDateTimeAssign(void *hndl, OCIError *err, const OCIDateTime *from,
1567 OCIDateTime *to);
1568NAME: OCIDateTimeAssign - OCIDateTime Assignment
1569PARAMETERS:
1570hndl (IN) - Session/Env handle.
1571err (IN/OUT) - error handle. If there is an error, it is
1572 recorded in 'err' and this function returns OCI_ERROR.
1573 The error recorded in 'err' can be retrieved by calling
1574 OCIErrorGet().
1575from (IN) - datetime to be assigned
1576to (OUT) - lhs of assignment
1577DESCRIPTION:
1578 Performs date assignment. The type of the output will be same as that
1579 of input
1580
1581------------------------------OCIDateTimeCheck----------------------------
1582sword OCIDateTimeCheck(void *hndl, OCIError *err, const OCIDateTime *date,
1583 ub4 *valid );
1584NAME: OCIDateTimeCheck - OCIDateTime CHecK if the given date is valid
1585PARAMETERS:
1586hndl (IN) - Session/Env handle.
1587err (IN/OUT) - error handle. If there is an error, it is
1588 recorded in 'err' and this function returns OCI_ERROR.
1589 The error recorded in 'err' can be retrieved by calling
1590 OCIErrorGet().
1591date (IN) - date to be checked
1592valid (OUT) - returns zero for a valid date, otherwise
1593 the ORed combination of all error bits specified below:
1594 Macro name Bit number Error
1595 ---------- ---------- -----
1596 OCI_DATE_INVALID_DAY 0x1 Bad day
1597 OCI_DATE_DAY_BELOW_VALID 0x2 Bad DAy Low/high bit (1=low)
1598 OCI_DATE_INVALID_MONTH 0x4 Bad MOnth
1599 OCI_DATE_MONTH_BELOW_VALID 0x8 Bad MOnth Low/high bit (1=low)
1600 OCI_DATE_INVALID_YEAR 0x10 Bad YeaR
1601 OCI_DATE_YEAR_BELOW_VALID 0x20 Bad YeaR Low/high bit (1=low)
1602 OCI_DATE_INVALID_HOUR 0x40 Bad HouR
1603 OCI_DATE_HOUR_BELOW_VALID 0x80 Bad HouR Low/high bit (1=low)
1604 OCI_DATE_INVALID_MINUTE 0x100 Bad MiNute
1605 OCI_DATE_MINUTE_BELOW_VALID 0x200 Bad MiNute Low/high bit (1=low)
1606 OCI_DATE_INVALID_SECOND 0x400 Bad SeCond
1607 OCI_DATE_SECOND_BELOW_VALID 0x800 bad second Low/high bit (1=low)
1608 OCI_DATE_DAY_MISSING_FROM_1582 0x1000 Day is one of those "missing"
1609 from 1582
1610 OCI_DATE_YEAR_ZERO 0x2000 Year may not equal zero
1611 OCI_DATE_INVALID_TIMEZONE 0x4000 Bad Timezone
1612 OCI_DATE_INVALID_FORMAT 0x8000 Bad date format input
1613
1614 So, for example, if the date passed in was 2/0/1990 25:61:10 in
1615 (month/day/year hours:minutes:seconds format), the error returned
1616 would be OCI_DATE_INVALID_DAY | OCI_DATE_DAY_BELOW_VALID |
1617 OCI_DATE_INVALID_HOUR | OCI_DATE_INVALID_MINUTE
1618
1619DESCRIPTION:
1620 Check if the given date is valid.
1621RETURNS:
1622 OCI_SUCCESS if the function completes successfully.
1623 OCI_INVALID_HANDLE if 'err' is NULL.
1624 OCI_ERROR if
1625 'date' and 'valid' pointers are NULL pointers
1626
1627------------------------------- OCIDateTimeCompare----------------------------
1628sword OCIDateTimeCompare(void *hndl, OCIError *err, const OCIDateTime *date1,
1629 const OCIDateTime *date2, sword *result );
1630NAME: OCIDateTimeCompare - OCIDateTime CoMPare dates
1631PARAMETERS:
1632hndl (IN) - Session/Env handle.
1633err (IN/OUT) - error handle. If there is an error, it is
1634 recorded in 'err' and this function returns OCI_ERROR.
1635 The error recorded in 'err' can be retrieved by calling
1636 OCIErrorGet().
1637date1, date2 (IN) - dates to be compared
1638result (OUT) - comparison result, 0 if equal, -1 if date1 < date2,
1639 1 if date1 > date2
1640DESCRIPTION:
1641The function OCIDateCompare compares two dates. It returns -1 if
1642date1 is smaller than date2, 0 if they are equal, and 1 if date1 is
1643greater than date2.
1644RETURNS:
1645 OCI_SUCCESS if the function completes successfully.
1646 OCI_INVALID_HANDLE if 'err' is NULL.
1647 OCI_ERROR if
1648 invalid date
1649 input dates are not mutually comparable
1650
1651------------------------------OCIDateTimeConvert----------------------
1652sword OCIDateTimeConvert(void *hndl, OCIError *err, OCIDateTime *indate,
1653 OCIDateTime *outdate);
1654NAME: OCIDateTimeConvert - Conversion between different DATETIME types
1655PARAMETERS:
1656hndl (IN) - Session/Env handle.
1657err (IN/OUT) - error handle. If there is an error, it is
1658 recorded in 'err' and this function returns OCI_ERROR.
1659 The error recorded in 'err' can be retrieved by calling
1660 OCIErrorGet().
1661indate (IN) - pointer to input date
1662outdate (OUT) - pointer to output datetime
1663DESCRIPTION: Converts one datetime type to another. The result type is
1664 the type of the 'outdate' descriptor.
1665RETURNS:
1666 OCI_SUCCESS if the function completes successfully.
1667 OCI_INVALID_HANDLE if 'err' is NULL.
1668 OCI_ERROR if
1669 conversion not possible.
1670
1671---------------------------- OCIDateTimeFromText-----------------------
1672sword OCIDateTimeFromText(void *hndl, OCIError *err, const OraText *date_str,
1673 size_t d_str_length, const OraText *fmt, ub1 fmt_length,
1674 const OraText *lang_name, size_t lang_length, OCIDateTime *date );
1675NAME: OCIDateTimeFromText - OCIDateTime convert String FROM Date
1676PARAMETERS:
1677hndl (IN) - Session/Env handle. If Session Handle is passed, the
1678 conversion takes place in session NLS_LANGUAGE and
1679 session NLS_CALENDAR, otherwise the default is used.
1680err (IN/OUT) - error handle. If there is an error, it is
1681 recorded in 'err' and this function returns OCI_ERROR.
1682 The error recorded in 'err' can be retrieved by calling
1683 OCIErrorGet().
1684date_str (IN) - input string to be converted to Oracle date
1685d_str_length (IN) - size of the input string, if the length is -1
1686 then 'date_str' is treated as a null terminated string
1687fmt (IN) - conversion format; if 'fmt' is a null pointer, then
1688 the string is expected to be in the default format for
1689 the datetime type.
1690fmt_length (IN) - length of the 'fmt' parameter
1691lang_name (IN) - language in which the names and abbreviations of
1692 days and months are specified, if null i.e. (OraText *)0,
1693 the default language of session is used,
1694lang_length (IN) - length of the 'lang_name' parameter
1695date (OUT) - given string converted to date
1696DESCRIPTION:
1697 Converts the given string to Oracle datetime type set in the
1698 OCIDateTime descriptor according to the specified format. Refer to
1699 "TO_DATE" conversion function described in "Oracle SQL Language
1700 Reference Manual" for a description of format.
1701RETURNS:
1702 OCI_SUCCESS if the function completes successfully.
1703 OCI_INVALID_HANDLE if 'err' is NULL.
1704 OCI_ERROR if
1705 invalid format
1706 unknown language
1707 invalid input string
1708
1709--------------------------- OCIDateTimeGetDate-------------------------
1710sword OCIDateTimeGetDate(void *hndl, OCIError *err, const OCIDateTime *date,
1711 sb2 *year, ub1 *month, ub1 *day );
1712NAME: OCIDateTimeGetDate - OCIDateTime Get Date (year, month, day)
1713 portion of DATETIME.
1714PARAMETERS:
1715hndl (IN) - Session/Env handle.
1716err (IN/OUT) - error handle. If there is an error, it is
1717 recorded in 'err' and this function returns OCI_ERROR.
1718 The error recorded in 'err' can be retrieved by calling
1719 OCIErrorGet().
1720datetime (IN) - Pointer to OCIDateTime
1721year (OUT) - year value
1722month (OUT) - month value
1723day (OUT) - day value
1724
1725--------------------------- OCIDateTimeGetTime ------------------------
1726sword OCIDateTimeGetTime(void *hndl, OCIError *err, OCIDateTime *datetime,
1727 ub1 *hour, ub1 *minute, ub1 *sec, ub4 *fsec);
1728NAME: OCIDateTimeGetTime - OCIDateTime Get Time (hour, min, second,
1729 fractional second) of DATETIME.
1730PARAMETERS:
1731hndl (IN) - Session/Env handle.
1732err (IN/OUT) - error handle. If there is an error, it is
1733 recorded in 'err' and this function returns OCI_ERROR.
1734 The error recorded in 'err' can be retrieved by calling
1735 OCIErrorGet().
1736datetime (IN) - Pointer to OCIDateTime
1737hour (OUT) - hour value
1738minute (OUT) - minute value
1739sec (OUT) - second value
1740fsec (OUT) - Fractional Second value
1741
1742--------------------------- OCIDateTimeGetTimeZoneOffset ----------------------
1743sword OCIDateTimeGetTimeZoneOffset(void *hndl,OCIError *err,const
1744 OCIDateTime *datetime,sb1 *hour,sb1 *minute);
1745
1746NAME: OCIDateTimeGetTimeZoneOffset - OCIDateTime Get TimeZone (hour, minute)
1747 portion of DATETIME.
1748PARAMETERS:
1749hndl (IN) - Session/Env handle.
1750err (IN/OUT) - error handle. If there is an error, it is
1751 recorded in 'err' and this function returns OCI_ERROR.
1752 The error recorded in 'err' can be retrieved by calling
1753 OCIErrorGet().
1754datetime (IN) - Pointer to OCIDateTime
1755hour (OUT) - TimeZone Hour value
1756minute (OUT) - TimeZone Minute value
1757
1758--------------------------- OCIDateTimeSysTimeStamp---------------------
1759sword OCIDateTimeSysTimeStamp(void *hndl, OCIError *err,
1760 OCIDateTime *sys_date );
1761
1762NAME: OCIDateTimeSysTimeStamp - Returns system date/time as a TimeStamp with
1763 timezone
1764PARAMETERS:
1765hndl (IN) - Session/Env handle.
1766err (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
1769 OCIErrorGet().
1770sys_date (OUT) - Pointer to output timestamp
1771
1772DESCRIPTION:
1773 Gets the system current date and time as a timestamp with timezone
1774RETURNS:
1775 OCI_SUCCESS if the function completes successfully.
1776 OCI_INVALID_HANDLE if 'err' is NULL.
1777
1778
1779------------------------------OCIDateTimeIntervalAdd----------------------
1780sword OCIDateTimeIntervalAdd(void *hndl, OCIError *err, OCIDateTime *datetime,
1781 OCIInterval *inter, OCIDateTime *outdatetime);
1782NAME: OCIDateTimeIntervalAdd - Adds an interval to datetime
1783PARAMETERS:
1784hndl (IN) - Session/Env handle.
1785err (IN/OUT) - error handle. If there is an error, it is
1786 recorded in 'err' and this function returns OCI_ERROR.
1787 The error recorded in 'err' can be retrieved by calling
1788 OCIErrorGet().
1789datetime (IN) - pointer to input datetime
1790inter (IN) - pointer to interval
1791outdatetime (IN) - pointer to output datetime. The output datetime
1792 will be of same type as input datetime
1793DESCRIPTION:
1794 Adds an interval to a datetime to produce a resulting datetime
1795RETURNS:
1796 OCI_SUCCESS if the function completes successfully.
1797 OCI_INVALID_HANDLE if 'err' is NULL.
1798 OCI_ERROR if:
1799 resulting date is before Jan 1, -4713
1800 resulting date is after Dec 31, 9999
1801
1802------------------------------OCIDateTimeIntervalSub----------------------
1803sword OCIDateTimeIntervalSub(void *hndl, OCIError *err, OCIDateTime *datetime,
1804 OCIInterval *inter, OCIDateTime *outdatetime);
1805NAME: OCIDateTimeIntervalSub - Subtracts an interval from a datetime
1806PARAMETERS:
1807hndl (IN) - Session/Env handle.
1808err (IN/OUT) - error handle. If there is an error, it is
1809 recorded in 'err' and this function returns OCI_ERROR.
1810 The error recorded in 'err' can be retrieved by calling
1811 OCIErrorGet().
1812datetime (IN) - pointer to input datetime
1813inter (IN) - pointer to interval
1814outdatetime (IN) - pointer to output datetime. The output datetime
1815 will be of same type as input datetime
1816DESCRIPTION:
1817 Subtracts an interval from a datetime and stores the result in a
1818 datetime
1819RETURNS:
1820 OCI_SUCCESS if the function completes successfully.
1821 OCI_INVALID_HANDLE if 'err' is NULL.
1822 OCI_ERROR if:
1823 resulting date is before Jan 1, -4713
1824 resulting date is after Dec 31, 9999
1825
1826--------------------------- OCIDateTimeConstruct-------------------------
1827sword OCIDateTimeConstruct(void *hndl,OCIError *err,OCIDateTime *datetime,
1828 sb2 year,ub1 month,ub1 day,ub1 hour,ub1 min,ub1 sec,ub4 fsec,
1829 OraText *timezone,size_t timezone_length);
1830
1831NAME: OCIDateTimeConstruct - Construct an OCIDateTime. Only the relevant
1832 fields for the OCIDateTime descriptor types are used.
1833PARAMETERS:
1834 hndl (IN) - Session/Env handle.
1835 err (IN/OUT) - error handle. If there is an error, it is
1836 recorded in 'err' and this function returns OCI_ERROR.
1837 The error recorded in 'err' can be retrieved by calling
1838 OCIErrorGet().
1839 datetime (IN) - Pointer to OCIDateTime
1840 year (IN) - year value
1841 month (IN) - month value
1842 day (IN) - day value
1843 hour (IN) - hour value
1844 min (IN) - minute value
1845 sec (IN) - second value
1846 fsec (IN) - Fractional Second value
1847 timezone (IN) - Timezone string
1848 timezone_length(IN) - Length of timezone string
1849
1850DESCRIPTION:
1851 Constructs a DateTime descriptor. The type of the datetime is the
1852 type of the OCIDateTime descriptor. Only the relevant fields based
1853 on the type are used. For Types with timezone, the date and time
1854 fields are assumed to be in the local time of the specified timezone.
1855 If timezone is not specified, then session default timezone is
1856 assumed.
1857RETURNS:
1858 OCI_SUCCESS if the function completes successfully.
1859 OCI_ERROR if datetime is not valid.
1860
1861------------------------------OCIDateTimeSubtract-----------------------
1862sword OCIDateTimeSubtract(void *hndl, OCIError *err, OCIDateTime *indate1,
1863 OCIDateTime *indate2, OCIInterval *inter);
1864NAME: OCIDateTimeSubtract - subtracts two datetimes to return an interval
1865PARAMETERS:
1866hndl (IN) - Session/Env handle.
1867err (IN/OUT) - error handle. If there is an error, it is
1868 recorded in 'err' and this function returns OCI_ERROR.
1869 The error recorded in 'err' can be retrieved by calling
1870 OCIErrorGet().
1871indate1(IN) - pointer to subtrahend
1872indate2(IN) - pointer to minuend
1873inter (OUT) - pointer to output interval
1874DESCRIPTION:
1875 Takes two datetimes as input and stores their difference in an
1876 interval. The type of the interval is the type of the 'inter'
1877 descriptor.
1878RETURNS:
1879 OCI_SUCCESS if the function completes successfully.
1880 OCI_INVALID_HANDLE if 'err' is NULL.
1881 OCI_ERROR if
1882 datetimes are not comparable.
1883
1884--------------------------- OCIDateTimeToText--------------------------
1885sword OCIDateTimeToText(void *hndl, OCIError *err, const OCIDateTime *date,
1886 const OraText *fmt, ub1 fmt_length, ub1 fsprec,
1887 const OraText *lang_name, size_t lang_length,
1888 ub4 *buf_size, OraText *buf );
1889NAME: OCIDateTimeToText - OCIDateTime convert date TO String
1890PARAMETERS:
1891hndl (IN) - Session/Env handle. If Session Handle is passed, the
1892 conversion takes place in session NLS_LANGUAGE and
1893 session NLS_CALENDAR, otherwise the default is used.
1894err (IN/OUT) - error handle. If there is an error, it is
1895 recorded in 'err' and this function returns OCI_ERROR.
1896 The error recorded in 'err' can be retrieved by calling
1897 OCIErrorGet().
1898date (IN) - Oracle datetime to be converted
1899fmt (IN) - conversion format, if null string pointer (OraText*)0, then
1900 the date is converted to a character string in the
1901 default format for that type.
1902fmt_length (IN) - length of the 'fmt' parameter
1903fsprec (IN) - specifies the fractional second precision in which the
1904 fractional seconds is returned.
1905lang_name (IN) - specifies the language in which the names and
1906 abbreviations of months and days are returned;
1907 default language of session is used if 'lang_name'
1908 is null i.e. (OraText *)0
1909lang_length (IN) - length of the 'nls_params' parameter
1910buf_size (IN/OUT) - size of the buffer; size of the resulting string
1911 is returned via this parameter
1912buf (OUT) - buffer into which the converted string is placed
1913DESCRIPTION:
1914 Converts the given date to a string according to the specified format.
1915 Refer to "TO_DATE" conversion function described in
1916 "Oracle SQL Language Reference Manual" for a description of format
1917 and NLS arguments. The converted null-terminated date string is
1918 stored in the buffer 'buf'.
1919RETURNS:
1920 OCI_SUCCESS if the function completes successfully.
1921 OCI_INVALID_HANDLE if 'err' is NULL.
1922 OCI_ERROR if
1923 buffer too small
1924 invalid format
1925 unknown language
1926 overflow error
1927
1928----------------------------OCIDateTimeGetTimeZoneName------------------------
1929sword OCIDateTimeGetTimeZoneName(void *hndl,
1930 OCIError *err,
1931 const OCIDateTime *datetime,
1932 ub1 *buf,
1933 ub4 *buflen);
1934NAME OCIDateTimeGetTimeZoneName - OCI DateTime Get the Time Zone Name
1935PARAMETERS:
1936hndl (IN) - Session/Env handle.
1937err (IN/OUT) - error handle. If there is an error, it is
1938 recorded in 'err' and this function returns OCI_ERROR.
1939 The error recorded in 'err' can be retrieved by calling
1940 OCIErrorGet().
1941datetime (IN) - Pointer to an OCIDateTime.
1942buf (OUT) - User allocated storage for name string.
1943buflen (IN/OUT) - length of buf on input, length of name on out
1944DESCRIPTION:
1945 Returns either the timezone region name or the absolute hour and minute
1946 offset. If the DateTime was created with a region id then the region
1947 name will be returned in the buf. If the region id is zero, then the
1948 hour and minute offset is returned as "[-]HH:MM".
1949RETURNS:
1950 OCI_SUCCESS if the function completes successfully.
1951 OCI_INVALID_HANDLE if 'err' is NULL.
1952 OCI_ERROR if
1953 buffer too small
1954 error retrieving timezone data
1955 invalid region
1956 invalid LdiDateTime type
1957
1958---------------------------------OCIDateTimeToArray----------------------------
1959sword OCIDateTimeToArray(void *hndl,
1960 OCIError *err,
1961 const OCIDateTime *datetime,
1962 const OCIInterval *reftz,
1963 ub1 *outarray,
1964 ub4 *len
1965 ub1 *fsprec);
1966NAME OCIDateTimeToArray - OCI DateTime convert To Array format
1967PARAMETERS:
1968hndl (IN) - Session/Env handle.
1969err (IN/OUT) - error handle. If there is an error, it is
1970 recorded in 'err' and this function returns OCI_ERROR.
1971 The error recorded in 'err' can be retrieved by calling
1972 OCIErrorGet().
1973datetime (IN) - Pointer to OCIDateTime to be converted.
1974outarray (OUT) - Result array storage
1975len (OUT) - pointer to length of outarray.
1976fsprec (IN) - Number of fractional seconds digits.
1977DESCRIPTION:
1978 Returns an array representing the input DateTime descriptor.
1979RETURNS:
1980 OCI_SUCCESS if the function completes successfully.
1981 OCI_INVALID_HANDLE if 'err' is NULL.
1982 OCI_ERROR if
1983 buffer too small
1984 error retrieving timezone data
1985 invalid region
1986 invalid LdiDateTime type
1987
1988--------------------------------OCIDateTimeFromArray---------------------------
1989sword OCIDateTimeFromArray(void *hndl,
1990 OCIError *err,
1991 ub1 *inarray,
1992 ub4 len
1993 ub1 type
1994 OCIDateTime *datetime,
1995 OCIInterval *reftz,
1996 ub1 fsprec);
1997NAME OCIDateTimeFromArray - OCI DateTime convert From Array format
1998PARAMETERS:
1999hndl (IN) - Session/Env handle.
2000err (IN/OUT) - error handle. If there is an error, it is
2001 recorded in 'err' and this function returns OCI_ERROR.
2002 The error recorded in 'err' can be retrieved by calling
2003 OCIErrorGet().
2004inarray (IN) - Pointer to input array representtion of DateTime
2005len (IN) - len of inarray.
2006type (IN) - One of SQLT_DATE, SQLT_TIME, SQLT_TIME_TZ, SQLT_TIMESTAMP,
2007 SQLT_TIMESTAMP_TZ, or SQLT_TIMESTAMP_LTZ.
2008datetime (OUT) - Pointer to the result OCIDateTime.
2009reftz (IN) - timezone interval used with SQLT_TIMESTAMP_LTZ.
2010fsprec (IN) - fractionl seconds digits of precision (0-9).
2011DESCRIPTION:
2012 Returns a pointer to an OCIDateTime of type type converted from
2013 the inarray.
2014RETURNS:
2015 OCI_SUCCESS if the function completes successfully.
2016 OCI_INVALID_HANDLE if 'err' is NULL.
2017 OCI_ERROR if
2018 buffer too small
2019 error retrieving timezone data
2020 invalid region
2021 invalid LdiDateTime type
2022
2023----------------------------------OCIRowidToChar-----------------------------
2024Name
2025OCIRowidToChar
2026
2027Purpose
2028Converts physical/logical (universal) ROWID to chracter extended (Base 64)
2029representation into user provided buffer outbfp of length outbflp. After
2030execution outbflp contains amount of bytes converted.In case of truncation
2031error, outbflp contains required size to make this conversion successful
2032and returns ORA-1405.
2033
2034Syntax
2035sword OCIRowidToChar( OCIRowid *rowidDesc,
2036 OraText *outbfp,
2037 ub2 *outbflp,
2038 OCIError *errhp)
2039
2040Comments
2041After this conversion, ROWID in character format can be bound using
2042OCIBindByPos or OCIBindByName call and used to query a row at a
2043desired ROWID.
2044
2045Parameters
2046rowidDesc (IN) - rowid DESCriptor which is allocated from OCIDescritorAlloc
2047 and populated by a prior SQL statement execution
2048outbfp (OUT) - pointer to the buffer where converted rowid in character
2049 representation is stored after successful execution.
2050outbflp (IN/OUT) - pointer to output buffer length variable.
2051 Before execution (IN mode) *outbflp contains the size of
2052 outbfp, after execution (OUT mode) *outbflp contains amount
2053 of bytes converted. In an event of truncation during
2054 conversion *outbflp contains the required length to make
2055 conversion successful.
2056errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
2057 diagnostic information in the event of an error.
2058
2059------------------------------OCIDefineArrayOfStruct--------------------------
2060
2061
2062OCIDefineArrayOfStruct()
2063Name
2064OCI Define for Array of Structures
2065Purpose
2066This call specifies additional attributes necessary for a static array define.
2067Syntax
2068sword OCIDefineArrayOfStruct ( OCIDefine *defnp,
2069 OCIError *errhp,
2070 ub4 pvskip,
2071 ub4 indskip,
2072 ub4 rlskip,
2073 ub4 rcskip );
2074Comments
2075This call specifies additional attributes necessary for an array define,
2076used in an array of structures (multi-row, multi-column) fetch.
2077For more information about skip parameters, see the section "Skip Parameters"
2078on page 4-17.
2079Parameters
2080defnp (IN) - the handle to the define structure which was returned by a call
2081to OCIDefineByPos().
2082errhp (IN) - an error handle which can be passed to OCIErrorGet() for
2083diagnostic information in the event of an error.
2084pvskip (IN) - skip parameter for the next data value.
2085indskip (IN) - skip parameter for the next indicator location.
2086rlskip (IN) - skip parameter for the next return length value.
2087rcskip (IN) - skip parameter for the next return code.
2088Related Functions
2089OCIAttrGet()
2090
2091
2092
2093
2094
2095OCIDefineByPos()
2096Name
2097OCI Define By Position
2098Purpose
2099Associates an item in a select-list with the type and output data buffer.
2100Syntax
2101sb4 OCIDefineByPos (
2102 OCIStmt *stmtp,
2103 OCIDefine **defnp,
2104 OCIError *errhp,
2105 ub4 position,
2106 void *valuep,
2107 sb4 value_sz,
2108 ub2 dty,
2109 void *indp,
2110 ub2 *rlenp,
2111 ub2 *rcodep,
2112 ub4 mode );
2113Comments
2114This call defines an output buffer which will receive data retreived from
2115Oracle. The define is a local step which is necessary when a SELECT statement
2116returns data to your OCI application.
2117This call also implicitly allocates the define handle for the select-list item.
2118Defining attributes of a column for a fetch is done in one or more calls. The
2119first call is to OCIDefineByPos(), which defines the minimal attributes
2120required to specify the fetch.
2121This call takes as a parameter a define handle, which must have been
2122previously allocated with a call to OCIHandleAlloc().
2123Following the call to OCIDefineByPos() additional define calls may be
2124necessary for certain data types or fetch modes:
2125A call to OCIDefineArrayOfStruct() is necessary to set up skip parameters
2126for an array fetch of multiple columns.
2127A call to OCIDefineObject() is necessary to set up the appropriate
2128attributes of a named data type fetch. In this case the data buffer pointer
2129in ocidefn() is ignored.
2130Both OCIDefineArrayOfStruct() and OCIDefineObject() must be called
2131after ocidefn() in order to fetch multiple rows with a column of named
2132data types.
2133For a LOB define, the buffer pointer must be a lob locator of type
2134OCILobLocator , allocated by the OCIDescAlloc() call. LOB locators, and not
2135LOB values, are always returned for a LOB column. LOB values can then be
2136fetched using OCI LOB calls on the fetched locator.
2137For NCHAR (fixed and varying length), the buffer pointer must point to an
2138array of bytes sufficient for holding the required NCHAR characters.
2139Nested table columns are defined and fetched like any other named data type.
2140If the mode parameter is this call is set to OCI_DYNAMIC_FETCH, the client
2141application can fetch data dynamically at runtime.
2142Runtime data can be provided in one of two ways:
2143callbacks using a user-defined function which must be registered with a
2144subsequent call to OCIDefineDynamic(). When the client library needs a
2145buffer to return the fetched data, the callback will be invoked and the
2146runtime buffers provided will return a piece or the whole data.
2147a polling mechanism using calls supplied by the OCI. This mode is
2148assumed if no callbacks are defined. In this case, the fetch call returns the
2149OCI_NEED_DATA error code, and a piecewise polling method is used
2150to provide the data.
2151Related Functions: For more information about using the
2152OCI_DYNAMIC_FETCH mode, see the section "Runtime Data
2153Allocation and Piecewise Operations" on page 5-16 of Volume 1..
2154For more information about the define step, see the section "Defining"
2155on page 2-30.
2156Parameters
2157stmtp (IN) - a handle to the requested SQL query operation.
2158defnp (IN/OUT) - a pointer to a pointer to a define handle which is implicitly
2159allocated by this call. This handle is used to store the define information
2160for this column.
2161errhp (IN) - an error handle which can be passed to OCIErrorGet() for
2162diagnostic information in the event of an error.
2163position (IN) - the position of this value in the select list. Positions are
21641-based and are numbered from left to right. For example, in the SELECT
2165statement
2166SELECT empno, ssn, mgrno FROM employees;
2167empno is at position 1, ssn is at position 2, and mgrno is at position 3.
2168valuep (IN/OUT) - a pointer to a buffer or an array of buffers of the type
2169specified in the dty parameter. A number of buffers can be specified when
2170results for more than one row are desired in a single fetch call.
2171value_sz (IN) - the size of each valuep buffer in bytes. If the data is stored
2172internally in VARCHAR2 format, the number of characters desired, if different
2173from the buffer size in bytes, may be additionally specified by the using
2174OCIAttrSet().
2175In an NLS conversion environment, a truncation error will be generated if the
2176number of bytes specified is insufficient to handle the number of characters
2177desired.
2178dty (IN) - the data type. Named data type (SQLT_NTY) and REF (SQLT_REF)
2179are valid only if the environment has been intialized with in object mode.
2180indp - pointer to an indicator variable or array. For scalar data types,
2181pointer to sb2 or an array of sb2s. Ignored for named data types. For named
2182data types, a pointer to a named data type indicator structure or an array of
2183named data type indicator structures is associated by a subsequent
2184OCIDefineObject() call.
2185See the section "Indicator Variables" on page 2-43 for more information about
2186indicator variables.
2187rlenp (IN/OUT) - pointer to array of length of data fetched. Each element in
2188rlenp is the length of the data in the corresponding element in the row after
2189the fetch.
2190rcodep (OUT) - pointer to array of column-level return codes
2191mode (IN) - the valid modes are:
2192OCI_DEFAULT. This is the default mode.
2193OCI_DYNAMIC_FETCH. For applications requiring dynamically
2194allocated data at the time of fetch, this mode must be used. The user may
2195additionally call OCIDefineDynamic() to set up a callback function that
2196will be invoked to receive the dynamically allocated buffers and to set
2197up the memory allocate/free callbacks and the context for the callbacks.
2198valuep and value_sz are ignored in this mode.
2199Related Functions
2200OCIDefineArrayOfStruct(), OCIDefineDynamic(), OCIDefineObject()
2201
2202
2203
2204
2205OCIDefineDynamic()
2206Name
2207OCI Define Dynamic Fetch Attributes
2208Purpose
2209This call is used to set the additional attributes required if the
2210OCI_DYNAMIC_FETCH mode was selected in OCIDefineByPos().
2211Syntax
2212sword OCIDefineDynamic( OCIDefine *defnp,
2213 OCIError *errhp,
2214 void *octxp,
2215 OCICallbackDefine (ocbfp)(
2216 void *octxp,
2217 OCIDefine *defnp,
2218 ub4 iter,
2219 void **bufpp,
2220 ub4 **alenpp,
2221 ub1 *piecep,
2222 void **indpp,
2223 ub2 **rcodep) );
2224Comments
2225This call is used to set the additional attributes required if the
2226OCI_DYNAMIC_FETCH mode has been selected in a call to
2227OCIDefineByPos().
2228When the OCI_DYNAMIC_FETCH mode is selected, buffers will be
2229dynamically allocated for REF, and named data type, values to receive the
2230data. The pointers to these buffers will be returned.
2231If OCI_DYNAMIC_FETCH mode was selected, and the call to
2232OCIDefineDynamic() is skipped, then the application can fetch data piecewise
2233using OCI calls.
2234For more information about OCI_DYNAMIC_FETCH mode, see the section
2235"Runtime Data Allocation and Piecewise Operations" on page 5-16.
2236Parameters
2237defnp (IN/OUT) - the handle to a define structure returned by a call to
2238OCIDefineByPos().
2239errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
2240diagnostic information in the event of an error.
2241octxp (IN) - points to a context for the callback function.
2242ocbfp (IN) - points to a callback function. This is invoked at runtime to get
2243a pointer to the buffer into which the fetched data or a piece of it will be
2244retreived. The callback also specifies the indicator, the return code and the
2245lengths of the data piece and indicator. The callback has the following
2246parameters:
2247octxp (IN) - a context pointer passed as an argument to all the callback
2248functions.
2249defnp (IN) - the define handle.
2250iter (IN) - which row of this current fetch.
2251bufpp (OUT) - returns a pointer to a buffer to store the column value, ie.
2252*bufp points to some appropriate storage for the column value.
2253alenpp (OUT) - returns a pointer to the length of the buffer. *alenpp
2254contains the size of the buffer after return from callback. Gets set to
2255actual data size after fetch.
2256piecep (IN/OUT) - returns a piece value, as follows:
2257The IN value can be OCI_ONE_PIECE, OCI_FIRST_PIECE or
2258OCI_NEXT_PIECE.
2259The OUT value can be OCI_ONE_PIECE if the IN value was
2260OCI_ONE_PIECE.
2261The OUT value can be OCI_ONE_PIECE or OCI_FIRST_PIECE if
2262the IN value was OCI_FIRST_PIECE.
2263The OUT value can only be OCI_NEXT_PIECE or
2264OCI_LAST_PIECE if the IN value was OCI_NEXT_PIECE.
2265indpp (IN) - indicator variable pointer
2266rcodep (IN) - return code variable pointer
2267Related Functions
2268OCIAttrGet()
2269OCIDefineObject()
2270
2271
2272
2273
2274OCIDefineObject()
2275Name
2276OCI Define Named Data Type attributes
2277Purpose
2278Sets up additional attributes necessary for a Named Data Type define.
2279Syntax
2280sword OCIDefineObject ( OCIDefine *defnp,
2281 OCIError *errhp,
2282 const OCIType *type,
2283 void **pgvpp,
2284 ub4 *pvszsp,
2285 void **indpp,
2286 ub4 *indszp );
2287Comments
2288This call sets up additional attributes necessary for a Named Data Type define.
2289An error will be returned if this function is called when the OCI environment
2290has been initialized in non-Object mode.
2291This call takes as a paramter a type descriptor object (TDO) of datatype
2292OCIType for the named data type being defined. The TDO can be retrieved
2293with a call to OCITypeByName().
2294See the description of OCIInitialize() on page 13 - 43 for more information
2295about initializing the OCI process environment.
2296Parameters
2297defnp (IN/OUT) - a define handle previously allocated in a call to
2298OCIDefineByPos().
2299errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
2300diagnostic information in the event of an error.
2301type (IN, optional) - points to the Type Descriptor Object (TDO) which
2302describes the type of the program variable. Only used for program variables
2303of type SQLT_NTY. This parameter is optional, and may be passed as NULL
2304if it is not being used.
2305pgvpp (IN/OUT) - points to a pointer to a program variable buffer. For an
2306array, pgvpp points to an array of pointers. Memory for the fetched named data
2307type instance(s) is dynamically allocated in the object cache. At the end of
2308the fetch when all the values have been received, pgvpp points to the
2309pointer(s) to these newly allocated named data type instance(s). The
2310application must call OCIObjectMarkDel() to deallocate the named data type
2311instance(s) when they are no longer needed.
2312pvszsp (IN/OUT) - points to the size of the program variable. For an array, it
2313is an array of ub4s. On return points to the size(s) of unpickled fetched
2314values.
2315indpp (IN/OUT) - points to a pointer to the program variable buffer
2316containing the parallel indicator structure. For an array, points to an array
2317of pointers. Memory is allocated to store the indicator structures in the
2318object cache. At the end of the fetch when all values have been received,
2319indpp points to the pointer(s) to these newly allocated indicator structure(s).
2320indszp (IN/OUT) - points to the size(s) of the indicator structure program
2321variable. For an array, it is an array of ub4s. On return points to the size(s)
2322of the unpickled fetched indicator values.
2323Related Functions
2324OCIAttrGet()
2325
2326
2327
2328OCIDescAlloc()
2329Name
2330OCI Get DESCriptor or lob locator
2331Purpose
2332Allocates storage to hold certain data types. The descriptors can be used as
2333bind or define variables.
2334Syntax
2335sword OCIDescAlloc ( const void *parenth,
2336 void **descpp,
2337 ub4 type,
2338 size_t xtramem_sz,
2339 void **usrmempp);
2340Comments
2341Returns a pointer to an allocated and initialized structure, corresponding to
2342the type specified in type. A non-NULL descriptor or LOB locator is returned
2343on success. No diagnostics are available on error.
2344This call returns OCI_SUCCESS if successful, or OCI_INVALID_HANDLE if
2345an out-of-memory error occurs.
2346Parameters
2347parenth (IN) - an environment handle.
2348descpp (OUT) - returns a descriptor or LOB locator of desired type.
2349type (IN) - specifies the type of descriptor or LOB locator to be allocated.
2350The specific types are:
2351OCI_DTYPE_SNAP - specifies generation of snapshot descriptor of C
2352type - OCISnapshot
2353OCI_DTYPE_LOB - specifies generation of a LOB data type locator of C
2354type - OCILobLocator
2355OCI_DTYPE_RSET - specifies generation of a descriptor of C type
2356OCIResult that references a result set (a number of rows as a result of a
2357query). This descriptor is bound to a bind variable of data type
2358SQLT_RSET (result set). The descriptor has to be converted into a
2359statement handle using a function - OCIResultSetToStmt() - which can
2360then be passed to OCIDefineByPos() and OCIStmtFetch() to retrieve the
2361rows of the result set.
2362OCI_DTYPE_ROWID - specifies generation of a ROWID descriptor of C
2363type OCIRowid.
2364OCI_DTYPE_COMPLEXOBJECTCOMP - specifies generation of a
2365complex object retrieval descriptor of C type
2366OCIComplexObjectComp.
2367xtramemsz (IN) - specifies an amount of user memory to be allocated for use
2368by the application.
2369usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz
2370allocated by the call for the user.
2371Related Functions
2372OCIDescFree()
2373
2374
2375
2376
2377OCIDescFree()
2378Name
2379OCI Free DESCriptor
2380Purpose
2381Deallocates a previously allocated descriptor.
2382Syntax
2383sword OCIDescFree ( void *descp,
2384 ub4 type);
2385Comments
2386This call frees up storage associated with the descriptor, corresponding to the
2387type specified in type. Returns OCI_SUCCESS or OCI_INVALID_HANDLE.
2388All descriptors must be explicitly deallocated. OCI will not deallocate a
2389descriptor if the environment handle is deallocated.
2390Parameters
2391descp (IN) - an allocated descriptor.
2392type (IN) - specifies the type of storage to be freed. The specific types are:
2393OCI_DTYPE_SNAP - snapshot descriptor
2394OCI_DTYPE_LOB - a LOB data type descriptor
2395OCI_DTYPE_RSET - a descriptor that references a result set (a number
2396of rows as a result of a query).
2397OCI_DTYPE_ROWID - a ROWID descriptor
2398OCI_DTYPE_COMPLEXOBJECTCOMP - a complex object retrieval
2399descriptor
2400Related Functions
2401OCIDescAlloc()
2402
2403
2404
2405OCIDescribeAny()
2406Name
2407OCI DeSCribe Any
2408Purpose
2409Describes existing schema objects.
2410Syntax
2411sword OCIDescribeAny ( OCISvcCtx *svchp,
2412 OCIError *errhp,
2413 void *objptr,
2414 ub4 objnm_len,
2415 ub1 objptr_typ,
2416 ub1 info_level,
2417 ub1 objtype,
2418 OCIDesc *dschp );
2419Comments
2420This is a generic describe call that describes existing schema objects: tables,
2421views, synonyms, procedures, functions, packages, sequences, and types. As a
2422result of this call, the describe handle is populated with the object-specific
2423attributes which can be obtained through an OCIAttrGet() call.
2424An OCIParamGet() on the describe handle returns a parameter descriptor for a
2425specified position. Parameter positions begin with 1. Calling OCIAttrGet() on
2426the parameter descriptor returns the specific attributes of a stored procedure
2427or function parameter or a table column descriptor as the case may be.
2428These subsequent calls do not need an extra round trip to the server because
2429the entire schema object description cached on the client side by
2430OCIDescribeAny(). Calling OCIAttrGet() on the describe handle can also return
2431the total number of positions.
2432See the section "Describing" on page 2-33 for more information about describe
2433operations.
2434Parameters
2435TO BE UPDATED
2436svchp (IN/OUT) - a service context handle.
2437errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
2438diagnostic information in the event of an error.
2439objptr (IN) - the name of the object (a null-terminated string) to be
2440described. Only procedure or function names are valid when connected to an
2441Oracle7 Server.
2442objptr_len (IN) - the length of the string. Must be non-zero.
2443objptr_typ (IN) - Must be OCI_OTYPE_NAME, OCI_OTYPE_REF, or OCI_OTYPE_PTR.
2444info_level (IN) - reserved for future extensions. Pass OCI_DEFAULT.
2445objtype (IN/OUT) - object type.
2446dschp (IN/OUT) - a describe handle that is populated with describe
2447information about the object after the call.
2448Related Functions
2449OCIAttrGet()
2450
2451
2452
2453OCIEnvCreate()
2454Name
2455OCI ENVironment CREATE
2456Purpose
2457This function creates and initializes an environment for the rest of
2458the OCI functions to work under. This call is a replacement for both
2459the OCIInitialize and OCIEnvInit calls.
2460Syntax
2461sword OCIEnvCreate ( OCIEnv **envhpp,
2462 ub4 mode,
2463 const void *ctxp,
2464 const void *(*malocfp)
2465 (void *ctxp,
2466 size_t size),
2467 const void *(*ralocfp)
2468 (void *ctxp,
2469 void *memptr,
2470 size_t newsize),
2471 const void (*mfreefp)
2472 ( void *ctxp,
2473 void *memptr))
2474 size_t xtramemsz,
2475 void **usrmempp );
2476
2477Comments
2478This call creates an environment for all the OCI calls using the modes
2479specified by the user. This call can be used instead of the two calls
2480OCIInitialize and OCIEnvInit. This function returns an environment handle
2481which is then used by the remaining OCI functions. There can be multiple
2482environments in OCI each with its own environment modes. This function
2483also performs any process level initialization if required by any mode.
2484For example if the user wants to initialize an environment as OCI_THREADED,
2485then all libraries that are used by OCI are also initialized in the
2486threaded mode.
2487
2488This call should be invoked before anny other OCI call and should be used
2489instead of the OCIInitialize and OCIEnvInit calls. This is the recommended
2490call, although OCIInitialize and OCIEnvInit calls will still be supported
2491for backward compatibility.
2492
2493envpp (OUT) - a pointer to a handle to the environment.
2494mode (IN) - specifies initialization of the mode. The valid modes are:
2495OCI_DEFAULT - default mode.
2496OCI_THREADED - threaded environment. In this mode, internal data
2497structures are protected from concurrent accesses by multiple threads.
2498OCI_OBJECT - will use navigational object interface.
2499ctxp (IN) - user defined context for the memory call back routines.
2500malocfp (IN) - user-defined memory allocation function. If mode is
2501OCI_THREADED, this memory allocation routine must be thread safe.
2502ctxp - context pointer for the user-defined memory allocation function.
2503size - size of memory to be allocated by the user-defined memory
2504allocation function
2505ralocfp (IN) - user-defined memory re-allocation function. If mode is
2506OCI_THREADED, this memory allocation routine must be thread safe.
2507ctxp - context pointer for the user-defined memory reallocation
2508function.
2509memp - pointer to memory block
2510newsize - new size of memory to be allocated
2511mfreefp (IN) - user-defined memory free function. If mode is
2512OCI_THREADED, this memory free routine must be thread safe.
2513ctxp - context pointer for the user-defined memory free function.
2514memptr - pointer to memory to be freed
2515xtramemsz (IN) - specifies the amount of user memory to be allocated.
2516usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz
2517allocated by the call for the user.
2518
2519Example
2520
2521Related Functions
2522OCIInitialize, OCIEnvInit
2523
2524OCIEnvNlsCreate()
2525Name
2526OCI ENVironment CREATE with NLS info
2527Purpose
2528This function does almost everything OCIEnvCreate does, plus enabling setting
2529of charset and ncharset programmatically, except OCI_UTF16 mode.
2530Syntax
2531sword OCIEnvNlsCreate(OCIEnv **envhpp,
2532 ub4 mode,
2533 void *ctxp,
2534 void *(*malocfp)
2535 (void *ctxp,
2536 size_t size),
2537 void *(*ralocfp)
2538 (void *ctxp,
2539 void *memptr,
2540 size_t newsize),
2541 void (*mfreefp)
2542 (void *ctxp,
2543 void *memptr),
2544 size_t xtramemsz,
2545 void **usrmempp,
2546 ub2 charset,
2547 ub2 ncharset)
2548Comments
2549The charset and ncharset must be both zero or non-zero.
2550The parameters have the same meaning as the ones in OCIEnvCreate().
2551When charset or ncharset is non-zero, the corresponding character set will
2552be used to replace the ones specified in NLS_LANG or NLS_NCHAR. Moreover,
2553OCI_UTF16ID is allowed to be set as charset and ncharset.
2554On the other hand, OCI_UTF16 mode is deprecated with this function.
2555Applications can achieve the same effects by setting
2556both charset and ncharset as OCI_UTF16ID.
2557
2558
2559OCIEnvInit()
2560Name
2561OCI INITialize environment
2562Purpose
2563This call initializes the OCI environment handle.
2564Syntax
2565sword OCIEnvInit ( OCIEnv **envp,
2566 ub4 mode,
2567 size_t xtramemsz,
2568 void **usrmempp );
2569Comments
2570Initializes the OCI environment handle. No changes are done on an initialized
2571handle. If OCI_ERROR or OCI_SUCCESS_WITH_INFO is returned, the
2572environment handle can be used to obtain ORACLE specific errors and
2573diagnostics.
2574This call is processed locally, without a server round-trip.
2575Parameters
2576envpp (OUT) - a pointer to a handle to the environment.
2577mode (IN) - specifies initialization of an environment mode. The only valid
2578mode is OCI_DEFAULT for default mode
2579xtramemsz (IN) - specifies the amount of user memory to be allocated.
2580usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz
2581allocated by the call for the user.
2582Example
2583See the description of OCISessionBegin() on page 13-84 for an example showing
2584the use of OCIEnvInit().
2585Related Functions
2586
2587
2588
2589
2590OCIErrorGet()
2591Name
2592OCI Get Diagnostic Record
2593Purpose
2594Returns an error message in the buffer provided and an ORACLE error.
2595Syntax
2596sword OCIErrorGet ( void *hndlp,
2597 ub4 recordno,
2598 OraText *sqlstate,
2599 ub4 *errcodep,
2600 OraText *bufp,
2601 ub4 bufsiz,
2602 ub4 type );
2603Comments
2604Returns an error message in the buffer provided and an ORACLE error.
2605Currently does not support SQL state. This call can be called a multiple
2606number of times if there are more than one diagnostic record for an error.
2607The error handle is originally allocated with a call to OCIHandleAlloc().
2608Parameters
2609hndlp (IN) - the error handle, in most cases, or the environment handle (for
2610errors on OCIEnvInit(), OCIHandleAlloc()).
2611recordno (IN) - indicates the status record from which the application seeks
2612info. Starts from 1.
2613sqlstate (OUT) - Not supported in Version 8.0.
2614errcodep (OUT) - an ORACLE Error is returned.
2615bufp (OUT) - the error message text is returned.
2616bufsiz (IN) - the size of the buffer provide to get the error message.
2617type (IN) - the type of the handle.
2618Related Functions
2619OCIHandleAlloc()
2620
2621OCIExtractInit
2622Name
2623OCI Extract Initialize
2624Purpose
2625This function initializes the parameter manager.
2626Syntax
2627sword OCIExtractInit(void *hndl, OCIError *err);
2628Comments
2629It must be called before calling any other parameter manager routine. The NLS
2630information is stored inside the parameter manager context and used in
2631subsequent calls to OCIExtract routines.
2632Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
2633Parameters
2634hndl (IN/OUT) - The OCI environment or session handle.
2635err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2636 err and this function returns OCI_ERROR. Diagnostic information
2637 can be obtained by calling OCIErrorGet().
2638Related Functions
2639OCIExtractTerm()
2640
2641OCIExtractTerm
2642Name
2643OCI Extract Terminate
2644Purpose
2645This function releases all dynamically allocated storage and may perform
2646other internal bookkeeping functions.
2647Syntax
2648sword OCIExtractTerm(void *hndl, OCIError *err);
2649Comments
2650It must be called when the parameter manager is no longer being used.
2651Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
2652Parameters
2653hndl (IN/OUT) - The OCI environment or session handle.
2654err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2655 err and this function returns OCI_ERROR. Diagnostic information
2656 can be obtained by calling OCIErrorGet().
2657Related Functions
2658OCIExtractInit()
2659
2660OCIExtractReset
2661Name
2662OCI Extract Reset
2663Purpose
2664The memory currently used for parameter storage, key definition storage, and
2665parameter value lists is freed and the structure is reinitialized.
2666Syntax
2667sword OCIExtractReset(void *hndl, OCIError *err);
2668Comments
2669Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
2670Parameters
2671hndl (IN/OUT) - The OCI environment or session handle.
2672err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2673 err and this function returns OCI_ERROR. Diagnostic information
2674 can be obtained by calling OCIErrorGet().
2675Related Functions
2676
2677OCIExtractSetNumKeys
2678Name
2679OCI Extract Set Number of Keys
2680Purpose
2681Informs the parameter manager of the number of keys that will be registered.
2682Syntax
2683sword OCIExtractSetNumKeys(void *hndl, OCIError *err, uword numkeys);
2684Comments
2685This routine must be called prior to the first call of OCIExtractSetKey().
2686Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
2687Parameters
2688hndl (IN/OUT) - The OCI environment or session handle.
2689err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2690 err and this function returns OCI_ERROR. Diagnostic information
2691 can be obtained by calling OCIErrorGet().
2692numkeys (IN) - The number of keys that will be registered with
2693 OCIExtractSetKey().
2694Related Functions
2695OCIExtractSetKey()
2696
2697OCIExtractSetKey
2698Name
2699OCI Extract Set Key definition
2700Purpose
2701Registers information about a key with the parameter manager.
2702Syntax
2703sword OCIExtractSetKey(void *hndl, OCIError *err, const OraText *name,
2704 ub1 type, ub4 flag, const void *defval,
2705 const sb4 *intrange, const OraText *const *strlist);
2706Comments
2707This routine must be called after calling OCIExtractSetKey() and before
2708calling OCIExtractFromFile() or OCIExtractFromStr().
2709Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
2710Parameters
2711hndl (IN/OUT) - The OCI environment or session handle.
2712err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2713 err and this function returns OCI_ERROR. Diagnostic information
2714 can be obtained by calling OCIErrorGet().
2715name (IN) - The name of the key.
2716type (IN) - The type of the key (OCI_EXTRACT_TYPE_INTEGER,
2717 OCI_EXTRACT_TYPE_OCINUM, OCI_EXTRACT_TYPE_STRING, or
2718 OCI_EXTRACT_TYPE_BOOLEAN).
2719flag (IN) - Set to OCI_EXTRACT_MULTIPLE if the key can take multiple values
2720 or 0 otherwise.
2721defval (IN) - Set to the default value for the key. May be NULL if there is
2722 no default. A string default must be a (text*) type, an
2723 integer default must be an (sb4*) type, and a boolean default
2724 must be a (ub1*) type.
2725intrange (IN) - Starting and ending values for the allowable range of integer
2726 values. May be NULL if the key is not an integer type or if
2727 all integer values are acceptable.
2728strlist (IN) - List of all acceptable text strings for the key. May be NULL
2729 if the key is not a string type or if all text values are
2730 acceptable.
2731Related Functions
2732OCIExtractSetNumKeys()
2733
2734OCIExtractFromFile
2735Name
2736OCI Extract parameters From File
2737Purpose
2738The keys and their values in the given file are processed.
2739Syntax
2740sword OCIExtractFromFile(void *hndl, OCIError *err, ub4 flag,
2741 OraText *filename);
2742Comments
2743Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
2744Parameters
2745hndl (IN/OUT) - The OCI environment or session handle.
2746err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2747 err and this function returns OCI_ERROR. Diagnostic information
2748 can be obtained by calling OCIErrorGet().
2749flag (IN) - Zero or has one or more of the following bits set:
2750 OCI_EXTRACT_CASE_SENSITIVE, OCI_EXTRACT_UNIQUE_ABBREVS, or
2751 OCI_EXTRACT_APPEND_VALUES.
2752filename (IN) - Null-terminated filename string.
2753Related Functions
2754
2755OCIExtractFromStr
2756Name
2757OCI Extract parameters From String
2758Purpose
2759The keys and their values in the given string are processed.
2760Syntax
2761sword OCIExtractFromStr(void *hndl, OCIError *err, ub4 flag, OraText *input);
2762Comments
2763Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
2764Parameters
2765hndl (IN/OUT) - The OCI environment or session handle.
2766err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2767 err and this function returns OCI_ERROR. Diagnostic information
2768 can be obtained by calling OCIErrorGet().
2769flag (IN) - Zero or has one or more of the following bits set:
2770 OCI_EXTRACT_CASE_SENSITIVE, OCI_EXTRACT_UNIQUE_ABBREVS, or
2771 OCI_EXTRACT_APPEND_VALUES.
2772input (IN) - Null-terminated input string.
2773Related Functions
2774
2775OCIExtractToInt
2776Name
2777OCI Extract To Integer
2778Purpose
2779Gets the integer value for the specified key.
2780Syntax
2781sword OCIExtractToInt(void *hndl, OCIError *err, OraText *keyname,
2782 uword valno, sb4 *retval);
2783Comments
2784The valno'th value (starting with 0) is returned.
2785Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR.
2786OCI_NO_DATA means that there is no valno'th value for this key.
2787Parameters
2788hndl (IN) - The OCI environment or session handle.
2789err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2790 err and this function returns OCI_ERROR. Diagnostic information
2791 can be obtained by calling OCIErrorGet().
2792keyname (IN) - Key name.
2793valno (IN) - Which value to get for this key.
2794retval (OUT) - The actual integer value.
2795Related Functions
2796
2797OCIExtractToBool
2798Name
2799OCI Extract To Boolean
2800Purpose
2801Gets the boolean value for the specified key.
2802Syntax
2803sword OCIExtractToBool(void *hndl, OCIError *err, OraText *keyname,
2804 uword valno, ub1 *retval);
2805Comments
2806The valno'th value (starting with 0) is returned.
2807Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR.
2808OCI_NO_DATA means that there is no valno'th value for this key.
2809Parameters
2810hndl (IN) - The OCI environment or session handle.
2811err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2812 err and this function returns OCI_ERROR. Diagnostic information
2813 can be obtained by calling OCIErrorGet().
2814keyname (IN) - Key name.
2815valno (IN) - Which value to get for this key.
2816retval (OUT) - The actual boolean value.
2817Related Functions
2818
2819OCIExtractToStr
2820Name
2821OCI Extract To String
2822Purpose
2823Gets the string value for the specified key.
2824Syntax
2825sword OCIExtractToStr(void *hndl, OCIError *err, OraText *keyname,
2826 uword valno, OraText *retval, uword buflen);
2827Comments
2828The valno'th value (starting with 0) is returned.
2829Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR.
2830OCI_NO_DATA means that there is no valno'th value for this key.
2831Parameters
2832hndl (IN) - The OCI environment or session handle.
2833err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2834 err and this function returns OCI_ERROR. Diagnostic information
2835 can be obtained by calling OCIErrorGet().
2836keyname (IN) - Key name.
2837valno (IN) - Which value to get for this key.
2838retval (OUT) - The actual null-terminated string value.
2839buflen (IN) - The length of the buffer for retval.
2840Related Functions
2841
2842Note: The following OCIExtract functions are unavailable in this release
2843
2844OCIExtractToOCINum
2845Name
2846OCI Extract To OCI Number
2847Purpose
2848Gets the OCINumber value for the specified key.
2849Syntax
2850sword OCIExtractToOCINum(void *hndl, OCIError *err, OraText *keyname,
2851 uword valno, OCINumber *retval);
2852Comments
2853The valno'th value (starting with 0) is returned.
2854Returns OCI_SUCCESS, OCI_INVALID_HANDLE, OCI_NO_DATA, or OCI_ERROR.
2855OCI_NO_DATA means that there is no valno'th value for this key.
2856Parameters
2857hndl (IN) - The OCI environment or session handle.
2858err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2859 err and this function returns OCI_ERROR. Diagnostic information
2860 can be obtained by calling OCIErrorGet().
2861keyname (IN) - Key name.
2862valno (IN) - Which value to get for this key.
2863retval (OUT) - The actual OCINumber value.
2864Related Functions
2865
2866OCIExtractToList
2867Name
2868OCI Extract To parameter List
2869Purpose
2870Generates a list of parameters from the parameter structures that are stored
2871in memory.
2872Syntax
2873sword OCIExtractToList(void *hndl, OCIError *err, uword *numkeys);
2874Comments
2875Must be called before OCIExtractValues() is called.
2876Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
2877Parameters
2878hndl (IN) - The OCI environment or session handle.
2879err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2880 err and this function returns OCI_ERROR. Diagnostic information
2881 can be obtained by calling OCIErrorGet().
2882numkeys (OUT) - Number of distinct keys stored in memory.
2883Related Functions
2884OCIExtractFromList()
2885
2886OCIExtractFromList
2887Name
2888OCI Extract From parameter List
2889Purpose
2890Generates a list of values for the a parameter in the parameter list.
2891Syntax
2892sword OCIExtractFromList(void *hndl, OCIError *err, uword index,
2893 OraText *name, ub1 *type, uword *numvals,
2894 void ***values);
2895Comments
2896Parameters are specified by an index. OCIExtractToList() must be called prior
2897to calling this routine to generate the parameter list from the parameter
2898structures that are stored in memory.
2899Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
2900Parameters
2901hndl (IN) - The OCI environment or session handle.
2902err (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
2903 err and this function returns OCI_ERROR. Diagnostic information
2904 can be obtained by calling OCIErrorGet().
2905name (OUT) - Name of the key for the current parameter.
2906type (OUT) - Type of the current parameter (OCI_EXTRACT_TYPE_STRING,
2907 OCI_EXTRACT_TYPE_INTEGER, OCI_EXTRACT_TYPE_OCINUM, or
2908 OCI_EXTRACT_TYPE_BOOLEAN)
2909numvals (OUT) - Number of values for this parameter.
2910values (OUT) - The values for this parameter.
2911Related Functions
2912OCIExtractToList()
2913
2914
2915************************ OCIFileClose() ***********************************
2916
2917Name
2918 OCIFileClose - Oracle Call Interface FILE i/o CLOSE
2919
2920Purpose
2921 Close a previously opened file.
2922
2923Syntax
2924 sword OCIFileClose ( void *hndl,
2925 OCIError *err,
2926 OCIFileObject *filep )
2927
2928Comments
2929 This function will close a previously opened file. If the function succeeds
2930 then OCI_SUCCESS will be returned, else OCI_ERROR.
2931
2932Parameters
2933 hndl (IN) - the OCI environment or session handle.
2934 err (OUT) - the OCI error handle
2935 filep (IN) - the OCIFile file object
2936
2937Related Functions
2938 OCIFileOpen.
2939
2940
2941
2942********************* OCIFileExists() **************************************
2943
2944Name
2945 OCIFileExists - Oracle Call Interface FILE i/o EXIST
2946
2947Purpose
2948 Check to see if the file exists.
2949
2950Syntax
2951 sword OCIFileExists ( void *hndl,
2952 OCIError *err,
2953 OraText *filename,
2954 OraText *path,
2955 ub1 *flag )
2956
2957Comments
2958 This function will set the flag to TRUE if the file exists else it will
2959 be set to FALSE.
2960 The function will return OCI_ERROR if any error is encountered, else
2961 it will return OCI_ERROR.
2962
2963Parameters
2964 hndl(IN) - OCI environment or session handle
2965 err(OUT) - OCI error handle
2966 filename(IN) - filename
2967 path(IN) - path of the file
2968 flag(OUT) - whether the file exists or not
2969
2970Related Functions.
2971 None.
2972
2973
2974 **************************** OCIFileFlush() ******************************
2975
2976
2977Name
2978 OCIFileFlush - Oracle Call Interface File i/o FLUSH
2979
2980Purpose
2981 Flush the buffers associated with the file to the disk.
2982
2983Syntax
2984 sword OCIFileFlush ( void *hndl,
2985 OCIError *err,
2986 OCIFileObject *filep )
2987
2988Comments
2989 The function will return OCI_ERROR if any error is encountered, else
2990 it will return OCI_ERROR.
2991
2992Parameters
2993 hndl (IN) - the OCI environment or session handle.
2994 err (OUT) - the OCI error handle
2995 filep (IN) - the OCIFile file object
2996
2997Related Functions
2998 OCIFileOpen, OCIFileWrite
2999
3000
3001
3002 *************************** OCIFileGetLength() ****************************
3003
3004Name
3005 OCIFileGetLength - Oracle Call Interface FILE i/o GET file LENGTH
3006
3007Purpose
3008 Get the length of a file.
3009
3010Syntax
3011 OCIFileGetLength(void *hndl,
3012 OCIError *err,
3013 OraText *filename,
3014 OraText *path,
3015 ubig_ora *lenp )
3016
3017Comments
3018 The length of the file will be returned in lenp.
3019 The function will return OCI_ERROR if any error is encountered, else
3020 it will return OCI_ERROR.
3021
3022Parameters
3023 hndl (IN) - the OCI environment or session handle.
3024 err (OUT) - the OCI error handle. If there is an error, it is recorded
3025 in err and this function returns OCI_ERROR. Diagnostic information can be
3026 obtained by calling OCIErrorGet().
3027 filename (IN) - file name.
3028 path (IN) - path of the file.
3029 lenp (OUT) - On output, it is the length of the file in bytes.
3030 is the number of bytes in the file.
3031
3032Related Functions
3033 None.
3034
3035
3036
3037******************************** OCIFileInit() *****************************
3038
3039Name
3040 OCIFileInit - Oracle Call Interface FILE i/o INITialize
3041
3042Purpose
3043 Initialize the OCI File I/O package and create the OCIFile context.
3044
3045Syntax
3046 sword OCIFileInit ( void *hndl,
3047 OCIError *err)
3048
3049Comments
3050 This function should be called before any of the OCIFile functions are
3051 used.
3052 The function will return OCI_ERROR if any error is encountered, else
3053 it will return OCI_ERROR.
3054
3055Parameters
3056 hndl(IN) - OCI environment or session handle.
3057 err(OUT) - OCI error structure.
3058
3059Related Functions
3060 OCIFileTerm
3061
3062
3063
3064********************************* OCIFileOpen() *****************************
3065
3066Name
3067 OCIFileOpen - Oracle Call Interface File i/o OPEN
3068
3069Purpose
3070 Open a file.
3071
3072Syntax
3073 sword OCIFileOpen ( void *hndl,
3074 OCIError *err,
3075 OCIFileObject **filep,
3076 OraText *filename,
3077 OraText *path,
3078 ub4 mode,
3079 ub4 create,
3080 ub4 type )
3081
3082Comments
3083 OCIFileOpen returns a handle to the open file in filep if the file is
3084 successfully opened.
3085 If one wants to use the standard file objects (stdin, stdout & stderr)
3086 then OCIFileOpen whould be called with the type filed containing the
3087 appropriate type (see the parameter type). If any of the standard files
3088 are specified then filename, path, mode and create are ignored.
3089 The function will return OCI_ERROR if any error is encountered, else
3090 it will return OCI_ERROR.
3091
3092Parameters
3093 hndl (OUT) - the OCI environment or session handle.
3094 err (OUT) - the OCI error handle. If there is an error, it is recorded
3095 in err and this function returns OCI_ERROR. Diagnostic information can be
3096 obtained by calling OCIErrorGet().
3097 filep (OUT) - the file object to be returned.
3098 filename (IN) - file name (NULL terminated string).
3099 path (IN) - path of the file (NULL terminated string).
3100 mode - mode in which to open the file (valid modes are OCI_FILE_READONLY,
3101 OCI_FILE_WRITEONLY, OCI_FILE_READ_WRITE).
3102 create - should the file be created if it does not exist. Valid values
3103 are:
3104 OCI_FILE_TRUNCATE - create a file regardless of whether or not it exists.
3105 If the file already exists overwrite it.
3106 OCI_FILE_EXIST - open it if it exists, else fail.
3107 OCI_FILE_EXCL - fail if the file exists, else create.
3108 OCI_FILE_CREATE - open the file if it exists, and create it if it doesn't.
3109 OCI_FILE_APPEND - set the file pointer to the end of the file prior to
3110 writing(this flag can be OR'ed with OCI_FILE_EXIST or
3111 OCI_FILE_CREATE).
3112type - file type. Valid values are OCI_FILE_TEXT, OCI_FILE_BIN,
3113 OCI_FILE_STDIN, OCI_FILE_STDOUT and OCI_FILE_STDERR.
3114 If any of the standard files are specified then filename, path, mode
3115 and create are ignored.
3116
3117Related Functions.
3118 OCIFileClose
3119
3120
3121
3122************************** OCIFileRead() ************************************
3123
3124Name
3125 OCIFileRead - Oracle Call Interface FILE i/o READ
3126
3127Purpose
3128 Read from a file into a buffer.
3129
3130Syntax
3131 sword OCIFileRead ( void *hndl,
3132 OCIError *err,
3133 OCIFileObject *filep,
3134 void *bufp,
3135 ub4 bufl,
3136 ub4 *bytesread )
3137
3138Comments
3139 Upto bufl bytes from the file will be read into bufp. The user should
3140 allocate memory for the buffer.
3141 The number of bytes read would be in bytesread.
3142 The function will return OCI_ERROR if any error is encountered, else
3143 it will return OCI_ERROR.
3144
3145Parameters
3146 hndl (IN) - the OCI environment or session handle.
3147 err (OUT) - the OCI error handle. If there is an error, it is recorded
3148 in err and this function returns OCI_ERROR. Diagnostic information can be
3149 obtained by calling OCIErrorGet().
3150 filep (IN/OUT) - a File Object that uniquely references the file.
3151 bufp (IN) - the pointer to a buffer into which the data will be read. The
3152 length of the allocated memory is assumed to be bufl.
3153 bufl - the length of the buffer in bytes.
3154 bytesread (OUT) - the number of bytes read.
3155
3156Related Functions
3157 OCIFileOpen, OCIFileSeek, OCIFileWrite
3158
3159
3160
3161****************************** OCIFileSeek() ******************************
3162
3163Name
3164 OCIFileSeek - Oracle Call Interface FILE i/o SEEK
3165
3166Purpose
3167 Perfom a seek to a byte position.
3168
3169Syntax
3170 sword OCIFileSeek ( void *hndl,
3171 OCIError *err,
3172 OCIFileObject *filep,
3173 uword origin,
3174 ubig_ora offset,
3175 sb1 dir)
3176
3177Comments
3178 The function will return OCI_ERROR if any error is encountered, else
3179 it will return OCI_ERROR.
3180
3181Parameters
3182 hndl (IN) - the OCI environment or session handle.
3183 err (OUT) - the OCI error handle. If there is an error, it is recorded
3184 in err and this function returns OCI_ERROR. Diagnostic information can be
3185 obtained by calling OCIErrorGet().
3186 filep (IN/OUT) - a file handle that uniquely references the file.
3187 origin - The starting point we want to seek from. NOTE: The starting
3188 point may be OCI_FILE_SEEK_BEGINNING (beginning), OCI_FILE_SEEK_CURRENT
3189 (current position), or OCI_FILE_SEEK_END (end of file).
3190 offset - The number of bytes from the origin we want to start reading from.
3191 dir - The direction we want to go from the origin. NOTE: The direction
3192 can be either OCI_FILE_FORWARD or OCI_FILE_BACKWARD.
3193
3194Related Function
3195 OCIFileOpen, OCIFileRead, OCIFileWrite
3196
3197
3198
3199*************************** OCIFileTerm() **********************************
3200
3201Name
3202 OCIFileTerm - Oracle Call Interface FILE i/o TERMinate
3203
3204Purpose
3205 Terminate the OCI File I/O package and destroy the OCI File context.
3206
3207Syntax
3208 sword OCIFileTerm ( void *hndl,
3209 OCIError *err )
3210
3211Comments
3212 After this function has been called no OCIFile function should be used.
3213 The function will return OCI_ERROR if any error is encountered, else
3214 it will return OCI_ERROR.
3215
3216Parameters
3217 hndl(IN) - OCI environment or session handle.
3218 err(OUT) - OCI error structure.
3219
3220Related Functions
3221 OCIFileInit
3222
3223
3224********************************* OCIFileWrite() ****************************
3225
3226Name
3227 OCIFileWrite - Oracle Call Interface FILE i/o WRITE
3228
3229Purpose
3230 Write data from buffer into a file.
3231
3232Syntax
3233 sword OCIFileWrite ( void *hndl,
3234 OCIError *err,
3235 OCIFileObject *filep,
3236 void *bufp,
3237 ub4 buflen
3238 ub4 *byteswritten )
3239
3240Comments
3241 The number of bytes written will be in *byteswritten.
3242 The function will return OCI_ERROR if any error is encountered, else
3243 it will return OCI_ERROR.
3244
3245Parameters
3246 hndl (IN) - the OCI environment or session handle.
3247 err (OUT) - the OCI error handle. If there is an error, it is recorded
3248 in err and this function returns OCI_ERROR. Diagnostic information can be
3249 obtained by calling OCIErrorGet().
3250 filep (IN/OUT) - a file handle that uniquely references the file.
3251 bufp (IN) - the pointer to a buffer from which the data will be written.
3252 The length of the allocated memory is assumed to be the value passed
3253 in bufl.
3254 bufl - the length of the buffer in bytes.
3255 byteswritten (OUT) - the number of bytes written.
3256
3257Related Functions
3258 OCIFileOpen, OCIFileSeek, OCIFileRead
3259
3260
3261
3262
3263
3264OCIHandleAlloc()
3265Name
3266OCI Get HaNDLe
3267Purpose
3268This call returns a pointer to an allocated and initialized handle.
3269Syntax
3270sword OCIHandleAlloc ( const void *parenth,
3271 void **hndlpp,
3272 ub4 type,
3273 size_t xtramem_sz,
3274 void **usrmempp);
3275Comments
3276Returns a pointer to an allocated and initialized structure, corresponding to
3277the type specified in type. A non-NULL handle is returned on success. Bind
3278handle and define handles are allocated with respect to a statement handle. All
3279other handles are allocated with respect to an environment handle which is
3280passed in as a parent handle.
3281No diagnostics are available on error. This call returns OCI_SUCCESS if
3282successful, or OCI_INVALID_HANDLE if an out-of-memory error occurs.
3283Handles must be allocated using OCIHandleAlloc() before they can be passed
3284into an OCI call.
3285Parameters
3286parenth (IN) - an environment or a statement handle.
3287hndlpp (OUT) - returns a handle to a handle type.
3288type (IN) - specifies the type of handle to be allocated. The specific types
3289are:
3290OCI_HTYPE_ERROR - specifies generation of an error report handle of
3291C type OCIError
3292OCI_HTYPE_SVCCTX - specifies generation of a service context handle
3293of C type OCISvcCtx
3294OCI_HTYPE_STMT - specifies generation of a statement (application
3295request) handle of C type OCIStmt
3296OCI_HTYPE_BIND - specifies generation of a bind information handle
3297of C type OCIBind
3298OCI_HTYPE_DEFINE - specifies generation of a column definition
3299handle of C type OCIDefine
3300OCI_HTYPE_DESCRIBE - specifies generation of a select list
3301description handle of C type OCIDesc
3302OCI_HTYPE_SERVER - specifies generation of a server context handle
3303of C type OCIServer
3304OCI_HTYPE_SESSION - specifies generation of an authentication
3305context handle of C type OCISession
3306OCI_HTYPE_TRANS - specifies generation of a transaction context
3307handle of C type OCITrans
3308OCI_HTYPE_COMPLEXOBJECT - specifies generation of a complex
3309object retrieval handle of C type OCIComplexObject
3310OCI_HTYPE_SECURITY - specifies generation of a security handle of C
3311type OCISecurity
3312xtramem_sz (IN) - specifies an amount of user memory to be allocated.
3313usrmempp (OUT) - returns a pointer to the user memory of size xtramemsz
3314allocated by the call for the user.
3315Related Functions
3316OCIHandleFree()
3317
3318
3319
3320OCIHandleFree()
3321Name
3322OCI Free HaNDLe
3323Purpose
3324This call explicitly deallocates a handle.
3325Syntax
3326sword OCIHandleFree ( void *hndlp,
3327 ub4 type);
3328Comments
3329This call frees up storage associated with a handle, corresponding to the type
3330specified in the type parameter.
3331This call returns either OCI_SUCCESS or OCI_INVALID_HANDLE.
3332All handles must be explicitly deallocated. OCI will not deallocate a child
3333handle if the parent is deallocated.
3334Parameters
3335hndlp (IN) - an opaque pointer to some storage.
3336type (IN) - specifies the type of storage to be allocated. The specific types
3337are:
3338OCI_HTYPE_ENV - an environment handle
3339OCI_HTYPE_ERROR - an error report handle
3340OCI_HTYPE_SVCCTX - a service context handle
3341OCI_HTYPE_STMT - a statement (application request) handle
3342OCI_HTYPE_BIND - a bind information handle
3343OCI_HTYPE_DEFINE - a column definition handle
3344OCI_HTYPE_DESCRIBE - a select list description handle
3345OCI_HTYPE_SERVER - a server handle
3346OCI_HTYPE_SESSION - a user authentication handle
3347OCI_HTYPE_TRANS - a transaction handle
3348OCI_HTYPE_COMPLEXOBJECT - a complex object retrieval handle
3349OCI_HTYPE_SECURITY - a security handle
3350Related Functions
3351OCIHandleAlloc()
3352
3353
3354
3355
3356OCIInitialize()
3357Name
3358OCI Process Initialize
3359Purpose
3360Initializes the OCI process environment.
3361Syntax
3362sword OCIInitialize ( ub4 mode,
3363 const void *ctxp,
3364 const void *(*malocfp)
3365 ( void *ctxp,
3366 size_t size ),
3367 const void *(*ralocfp)
3368 ( void *ctxp,
3369 void *memp,
3370 size_t newsize ),
3371 const void (*mfreefp)
3372 ( void *ctxp,
3373 void *memptr ));
3374Comments
3375This call initializes the OCI process environment.
3376OCIInitialize() must be invoked before any other OCI call.
3377Parameters
3378mode (IN) - specifies initialization of the mode. The valid modes are:
3379OCI_DEFAULT - default mode.
3380OCI_THREADED - threaded environment. In this mode, internal data
3381structures are protected from concurrent accesses by multiple threads.
3382OCI_OBJECT - will use navigational object interface.
3383ctxp (IN) - user defined context for the memory call back routines.
3384malocfp (IN) - user-defined memory allocation function. If mode is
3385OCI_THREADED, this memory allocation routine must be thread safe.
3386ctxp - context pointer for the user-defined memory allocation function.
3387size - size of memory to be allocated by the user-defined memory
3388allocation function
3389ralocfp (IN) - user-defined memory re-allocation function. If mode is
3390OCI_THREADED, this memory allocation routine must be thread safe.
3391ctxp - context pointer for the user-defined memory reallocation
3392function.
3393memp - pointer to memory block
3394newsize - new size of memory to be allocated
3395mfreefp (IN) - user-defined memory free function. If mode is
3396OCI_THREADED, this memory free routine must be thread safe.
3397ctxp - context pointer for the user-defined memory free function.
3398memptr - pointer to memory to be freed
3399Example
3400See the description of OCIStmtPrepare() on page 13-96 for an example showing
3401the use of OCIInitialize().
3402Related Functions
3403
3404-------------------------------OCITerminate------------------------------------
3405
3406OCITerminate()
3407Name
3408OCI process Terminate
3409Purpose
3410Do cleanup before process termination
3411Syntax
3412sword OCITerminate (ub4 mode);
3413
3414Comments
3415This call performs OCI related clean up before the OCI process terminates.
3416If the process is running in shared mode then the OCI process is disconnected
3417from the shared memory subsystem.
3418
3419OCITerminate() should be the last OCI call in any process.
3420
3421Parameters
3422mode (IN) - specifies different termination modes.
3423
3424OCI_DEFAULT - default mode.
3425
3426Example
3427
3428Related Functions
3429OCIInitialize()
3430
3431------------------------ OCIAppCtxSet--------------------------------------
3432Name
3433OCI Application context Set
3434Purpose
3435Set an attribute and its value for a particular application context
3436 namespace
3437Syntax
3438 (sword) OCIAppCtxSet((void *) sesshndl, (void *)nsptr,(ub4) nsptrlen,
3439 (void *)attrptr, (ub4) attrptrlen, (void *)valueptr,
3440 (ub4) valueptrlen, errhp, (ub4)mode);
3441
3442Comments
3443Please note that the information set on the session handle is sent to the
3444server during the next OCIStatementExecute or OCISessionBegin.
3445
3446This information is cleared from the session handle, once the information
3447 has been sent over to the server,and should be setup again if needed.
3448
3449Parameters
3450 sesshndl (IN/OUT) - Pointer to a session handle
3451 nsptr (IN) - Pointer to namespace string
3452 nsptrlen (IN) - length of the nsptr
3453 attrptr (IN) - Pointer to attribute string
3454 attrptrlen (IN) - length of the attrptr
3455 valueptr (IN) - Pointer to value string
3456 valueptrlen(IN) - length of the valueptr
3457 errhp (OUT) - Error from the API
3458 mode (IN) - mode of operation (OCI_DEFAULT)
3459
3460Returns
3461 error if any
3462Example
3463
3464Related Functions
3465 OCIAppCtxClearAll
3466
3467
3468------------------------ OCIAppCtxClearAll---------------------------------
3469Name
3470 OCI Application Context Clear all attributes in a namespace
3471Purpose
3472 To clear the values all attributes in a namespace
3473Syntax
3474 (sword) OCIAppCtxClearAll((void *) sesshndl, (void *)nsptr, (ub4) nsptrlen,
3475 (OCIError *)errhp, (ub4)mode);
3476
3477Comments
3478This will clean up the context information on the server side during the
3479next piggy-back to the server.
3480
3481Parameters
3482 sesshndl (IN/OUT) - Pointer to a session handle
3483 nsptr (IN) - Pointer to namespace string where the values of all
3484 attributes are cleared
3485 nsptrlen (IN) - length of the nsptr
3486 errhp (OUT) - Error from the API
3487 mode (IN) - mode of operation (OCI_DEFAULT)
3488Example
3489
3490Returns
3491 error if any
3492
3493Related Functions
3494 OCIAppCtxSet
3495---------------------- OCIIntervalAssign ---------------------------------
3496sword OCIIntervalAssign(void *hndl, OCIError *err,
3497 const OCIInterval *inpinter, OCIInterval *outinter );
3498
3499 DESCRIPTION
3500 Copies one interval to another to create a replica
3501 PARAMETERS
3502 hndl (IN) - Session/Env handle.
3503 err (IN/OUT) - error handle. If there is an error, it is
3504 recorded in 'err' and this function returns OCI_ERROR.
3505 The error recorded in 'err' can be retrieved by calling
3506 OCIErrorGet().
3507 (IN) inpinter - Input Interval
3508 (OUT) outinter - Output Interval
3509 RETURNS
3510 OCI_INVALID_HANDLE if 'err' is NULL.
3511 OCI_SUCCESS otherwise
3512
3513 ---------------------- OCIIntervalCheck ------------------------------------
3514sword OCIIntervalCheck(void *hndl, OCIError *err, const OCIInterval *interval,
3515 ub4 *valid );
3516
3517 DESCRIPTION
3518 Checks the validity of an interval
3519 PARAMETERS
3520 hndl (IN) - Session/Env handle.
3521 err (IN/OUT) - error handle. If there is an error, it is
3522 recorded in 'err' and this function returns OCI_ERROR.
3523 The error recorded in 'err' can be retrieved by calling
3524 OCIErrorGet().
3525 (IN) interval - Interval to be checked
3526 (OUT) valid - Zero if the interval is valid, else returns an Ored
3527 combination of the following codes.
3528
3529 Macro name Bit number Error
3530 ---------- ---------- -----
3531 OCI_INTER_INVALID_DAY 0x1 Bad day
3532 OCI_INTER_DAY_BELOW_VALID 0x2 Bad DAy Low/high bit (1=low)
3533 OCI_INTER_INVALID_MONTH 0x4 Bad MOnth
3534 OCI_INTER_MONTH_BELOW_VALID 0x8 Bad MOnth Low/high bit (1=low)
3535 OCI_INTER_INVALID_YEAR 0x10 Bad YeaR
3536 OCI_INTER_YEAR_BELOW_VALID 0x20 Bad YeaR Low/high bit (1=low)
3537 OCI_INTER_INVALID_HOUR 0x40 Bad HouR
3538 OCI_INTER_HOUR_BELOW_VALID 0x80 Bad HouR Low/high bit (1=low)
3539 OCI_INTER_INVALID_MINUTE 0x100 Bad MiNute
3540 OCI_INTER_MINUTE_BELOW_VALID 0x200 Bad MiNute Low/high bit(1=low)
3541 OCI_INTER_INVALID_SECOND 0x400 Bad SeCond
3542 OCI_INTER_SECOND_BELOW_VALID 0x800 bad second Low/high bit(1=low)
3543 OCI_INTER_INVALID_FRACSEC 0x1000 Bad Fractional second
3544 OCI_INTER_FRACSEC_BELOW_VALID 0x2000 Bad fractional second Low/High
3545
3546
3547 RETURNS
3548 OCI_SUCCESS if interval is okay
3549 OCI_INVALID_HANDLE if 'err' is NULL.
3550
3551 ---------------------- OCIIntervalCompare -----------------------------------
3552sword OCIIntervalCompare(void *hndl, OCIError *err, OCIInterval *inter1,
3553 OCIInterval *inter2, sword *result );
3554
3555 DESCRIPTION
3556 Compares two intervals, returns 0 if equal, -1 if inter1 < inter2,
3557 1 if inter1 > inter2
3558 PARAMETERS
3559 hndl (IN) - Session/Env handle.
3560 err (IN/OUT) - error handle. If there is an error, it is
3561 recorded in 'err' and this function returns OCI_ERROR.
3562 The error recorded in 'err' can be retrieved by calling
3563 OCIErrorGet().
3564 inter1 (IN) - Interval to be compared
3565 inter2 (IN) - Interval to be compared
3566 result (OUT) - comparison result, 0 if equal, -1 if inter1 < inter2,
3567 1 if inter1 > inter2
3568
3569 RETURNS
3570 OCI_SUCCESS on success
3571 OCI_INVALID_HANDLE if 'err' is NULL.
3572 OCI_ERROR if
3573 the two input datetimes are not mutually comparable.
3574
3575---------------------- OCIIntervalDivide ------------------------------------
3576sword OCIIntervalDivide(void *hndl, OCIError *err, OCIInterval *dividend,
3577 OCINumber *divisor, OCIInterval *result );
3578
3579 DESCRIPTION
3580 Divides an interval by an Oracle Number to produce an interval
3581 PARAMETERS
3582 hndl (IN) - Session/Env handle.
3583 err (IN/OUT) - error handle. If there is an error, it is
3584 recorded in 'err' and this function returns OCI_ERROR.
3585 The error recorded in 'err' can be retrieved by calling
3586 OCIErrorGet().
3587 dividend (IN) - Interval to be divided
3588 divisor (IN) - Oracle Number dividing `dividend'
3589 result (OUT) - resulting interval (dividend / divisor)
3590 RETURNS
3591 OCI_SUCCESS on success
3592 OCI_INVALID_HANDLE if 'err' is NULL.
3593
3594 ---------------------- OCIIntervalFromNumber --------------------
3595sword OCIIntervalFromNumber(void *hndl, OCIError *err,
3596 OCIInterval *inter, OCINumber *number);
3597 DESCRIPTION
3598 Converts an interval to an Oracle Number
3599 PARAMETERS
3600 hndl (IN) - Session/Env handle.
3601 err (IN/OUT) - error handle. If there is an error, it is
3602 recorded in 'err' and this function returns OCI_ERROR.
3603 The error recorded in 'err' can be retrieved by calling
3604 OCIErrorGet().
3605 (OUT) interval - Interval to be converted
3606 (IN) number - Oracle number result (in years for YEARMONTH interval
3607 and in days for DAYSECOND)
3608 RETURNS
3609 OCI_SUCCESS on success
3610 OCI_INVALID_HANDLE if 'err' is NULL.
3611 OCI_ERROR on error.
3612 NOTES
3613 Fractional portions of the date (for instance, minutes and seconds if
3614 the unit chosen is hours) will be included in the Oracle number produced.
3615 Excess precision will be truncated.
3616
3617 ---------------------- OCIIntervalFromText ---------------------------------
3618sword OCIIntervalFromText( void *hndl, OCIError *err, const OraText *inpstr,
3619 size_t str_len, OCIInterval *result );
3620
3621 DESCRIPTION
3622 Given an interval string produce the interval represented by the string.
3623 The type of the interval is the type of the 'result' descriptor.
3624 PARAMETERS
3625
3626 hndl (IN) - Session/Env handle.
3627 err (IN/OUT) - error handle. If there is an error, it is
3628 recorded in 'err' and this function returns OCI_ERROR.
3629 The error recorded in 'err' can be retrieved by calling
3630 OCIErrorGet().
3631 (IN) inpstr - Input string
3632 (IN) str_len - Length of input string
3633 (OUT) result - Resultant interval
3634 RETURNS
3635 OCI_SUCCESS on success
3636 OCI_INVALID_HANDLE if 'err' is NULL.
3637 OCI_ERROR if
3638 there are too many fields in the literal string
3639 the year is out of range (-4713 to 9999)
3640 if the month is out of range (1 to 12)
3641 if the day of month is out of range (1 to 28...31)
3642 if hour is not in range (0 to 23)
3643 if hour is not in range (0 to 11)
3644 if minute is not in range (0 to 59)
3645 if seconds in minute not in range (0 to 59)
3646 if seconds in day not in range (0 to 86399)
3647 if the interval is invalid
3648
3649
3650 ---------------------- OCIIntervalGetDaySecond --------------------
3651
3652 DESCRIPTION
3653 Gets values of day second interval
3654 PARAMETERS
3655 hndl (IN) - Session/Env handle.
3656 err (IN/OUT) - error handle. If there is an error, it is
3657 recorded in 'err' and this function returns OCI_ERROR.
3658 The error recorded in 'err' can be retrieved by calling
3659 OCIErrorGet().
3660 day (OUT) - number of days
3661 hour (OUT) - number of hours
3662 min (OUT) - number of mins
3663 sec (OUT) - number of secs
3664 fsec (OUT) - number of fractional seconds
3665 result (IN) - resulting interval
3666 RETURNS
3667 OCI_SUCCESS on success
3668 OCI_INVALID_HANDLE if 'err' is NULL.
3669
3670
3671 ---------------------- OCIIntervalGetYearMonth --------------------
3672
3673 DESCRIPTION
3674 Gets year month from an interval
3675 PARAMETERS
3676 hndl (IN) - Session/Env handle.
3677 err (IN/OUT) - error handle. If there is an error, it is
3678 recorded in 'err' and this function returns OCI_ERROR.
3679 The error recorded in 'err' can be retrieved by calling
3680 OCIErrorGet().
3681 year (OUT) - year value
3682 month (OUT) - month value
3683 result (IN) - resulting interval
3684 RETURNS
3685 OCI_SUCCESS on success
3686 OCI_INVALID_HANDLE if 'err' is NULL.
3687
3688
3689
3690-------------------------- OCIIntervalAdd ------------------------------
3691sword OCIIntervalAdd(void *hndl, OCIError *err, OCIInterval *addend1,
3692 OCIInterval *addend2, OCIInterval *result );
3693NAME OCIIntervalAdd - Adds two intervals
3694PARAMETERS
3695hndl (IN) - Session/Env handle.
3696err (IN/OUT) - error handle. If there is an error, it is
3697 recorded in 'err' and this function returns OCI_ERROR.
3698 The error recorded in 'err' can be retrieved by calling
3699 OCIErrorGet().
3700addend1 (IN) - Interval to be added
3701addend2 (IN) - Interval to be added
3702result (OUT) - resulting interval (addend1 + addend2)
3703DESCRIPTION
3704 Adds two intervals to produce a resulting interval
3705RETURNS
3706 OCI_SUCCESS on success
3707 OCI_ERROR if:
3708 the two input intervals are not mutually comparable.
3709 the resulting year would go above SB4MAXVAL
3710 the resulting year would go below SB4MINVAL
3711 OCI_INVALID_HANDLE if 'err' is NULL.
3712NOTES
3713 The two input intervals must be mutually comparable
3714
3715 ---------------------- OCIIntervalSubtract -------------------------------
3716sword OCIIntervalSubtract(void *hndl, OCIError *err, OCIInterval *minuend,
3717 OCIInterval *subtrahend, OCIInterval *result );
3718NAME - OCIIntervalSubtract - subtracts two intervals
3719PARAMETERS
3720hndl (IN) - Session/Env handle.
3721err (IN/OUT) - error handle. If there is an error, it is
3722 recorded in 'err' and this function returns OCI_ERROR.
3723 The error recorded in 'err' can be retrieved by calling
3724 OCIErrorGet().
3725minuend (IN) - interval to be subtracted from
3726subtrahend (IN) - interval subtracted from minuend
3727result (OUT) - resulting interval (minuend - subtrahend)
3728DESCRIPTION
3729 Subtracts two intervals and stores the result in an interval
3730RETURNS
3731 OCI_SUCCESS on success
3732 OCI_INVALID_HANDLE if 'err' is NULL.
3733 OCI_ERROR if:
3734 the two input intervals are not mutually comparable.
3735 the resulting leading field would go below SB4MINVAL
3736 the resulting leading field would go above SB4MAXVAL
3737
3738---------------------- OCIIntervalMultiply ---------------------------------
3739sword OCIIntervalMultiply(void *hndl, OCIError *err, const OCIInterval *inter,
3740 OCINumber *nfactor, OCIInterval *result );
3741
3742 DESCRIPTION
3743 Multiplies an interval by an Oracle Number to produce an interval
3744 PARAMETERS
3745 hndl (IN) - Session/Env handle.
3746 err (IN/OUT) - error handle. If there is an error, it is
3747 recorded in 'err' and this function returns OCI_ERROR.
3748 The error recorded in 'err' can be retrieved by calling
3749 OCIErrorGet().
3750 inter (IN) - Interval to be multiplied
3751 nfactor (IN) - Oracle Number to be multiplied
3752 result (OUT) - resulting interval (ifactor * nfactor)
3753 RETURNS
3754 OCI_SUCCESS on success
3755 OCI_INVALID_HANDLE if 'err' is NULL.
3756 OCI_ERROR if:
3757 the resulting year would go above SB4MAXVAL
3758 the resulting year would go below SB4MINVAL
3759
3760
3761 ---------------------- OCIIntervalSetDaySecond --------------------
3762
3763 DESCRIPTION
3764 Sets day second interval
3765 PARAMETERS
3766 hndl (IN) - Session/Env handle.
3767 err (IN/OUT) - error handle. If there is an error, it is
3768 recorded in 'err' and this function returns OCI_ERROR.
3769 The error recorded in 'err' can be retrieved by calling
3770 OCIErrorGet().
3771 day (IN) - number of days
3772 hour (IN) - number of hours
3773 min (IN) - number of mins
3774 sec (IN) - number of secs
3775 fsec (IN) - number of fractional seconds
3776 result (OUT) - resulting interval
3777 RETURNS
3778 OCI_SUCCESS on success
3779 OCI_INVALID_HANDLE if 'err' is NULL.
3780
3781
3782 ---------------------- OCIIntervalSetYearMonth --------------------
3783
3784 DESCRIPTION
3785 Sets year month interval
3786 PARAMETERS
3787 hndl (IN) - Session/Env handle.
3788 err (IN/OUT) - error handle. If there is an error, it is
3789 recorded in 'err' and this function returns OCI_ERROR.
3790 The error recorded in 'err' can be retrieved by calling
3791 OCIErrorGet().
3792 year (IN) - year value
3793 month (IN) - month value
3794 result (OUT) - resulting interval
3795 RETURNS
3796 OCI_SUCCESS on success
3797 OCI_INVALID_HANDLE if 'err' is NULL.
3798
3799
3800----------------------- OCIIntervalToNumber ---------------------------------
3801sword OCIIntervalToNumber(void *hndl, OCIError *err, const OCIInterval *inter,
3802 OCINumber *number);
3803
3804 DESCRIPTION
3805 Converts an interval to an Oracle Number
3806 PARAMETERS
3807 hndl (IN) - Session/Env handle.
3808 err (IN/OUT) - error handle. If there is an error, it is
3809 recorded in 'err' and this function returns OCI_ERROR.
3810 The error recorded in 'err' can be retrieved by calling
3811 OCIErrorGet().
3812 (IN) inter - Interval to be converted
3813 (OUT) number - Oracle number result (in years for YEARMONTH interval
3814 and in days for DAYSECOND)
3815 RETURNS
3816 OCI_INVALID_HANDLE if 'err' is NULL.
3817 OCI_SUCCESS on success
3818 NOTES
3819 Fractional portions of the date (for instance, minutes and seconds if
3820 the unit chosen is hours) will be included in the Oracle number produced.
3821 Excess precision will be truncated.
3822
3823------------------------------- OCIIntervalToText -------------------------
3824sword OCIIntervalToText( void *hndl, OCIError *err, const OCIInterval *inter,
3825 ub1 lfprec, ub1 fsprec, OraText *buffer,
3826 size_t buflen, size_t *resultlen );
3827
3828 DESCRIPTION
3829 Given an interval, produces a string representing the interval.
3830 PARAMETERS
3831 hndl (IN) - Session/Env handle.
3832 err (IN/OUT) - error handle. If there is an error, it is
3833 recorded in 'err' and this function returns OCI_ERROR.
3834 The error recorded in 'err' can be retrieved by calling
3835 OCIErrorGet().
3836 (IN) inter - Interval to be converted
3837 (IN) lfprec - Leading field precision. Number of digits used to
3838 represent the leading field.
3839 (IN) fsprec - Fractional second precision of the interval. Number of
3840 digits used to represent the fractional seconds.
3841 (OUT) buffer - buffer to hold result
3842 (IN) buflen - length of above buffer
3843 (OUT) resultlen - length of result placed into buffer
3844
3845 RETURNS
3846 OCI_SUCCESS on success
3847 OCI_INVALID_HANDLE if 'err' is NULL.
3848 OCI_ERROR
3849 if the buffer is not large enough to hold the result
3850 NOTES
3851 The interval literal will be output as `year' or `[year-]month' for
3852 YEAR-MONTH intervals and as `seconds' or `minutes[:seconds]' or
3853 `hours[:minutes[:seconds]]' or `days[ hours[:minutes[:seconds]]]' for
3854 DAY-TIME intervals (where optional fields are surrounded by brackets).
3855
3856 ---------------------- OCIIntervalFromTZ --------------------
3857sword OCIIntervalFromTZ(void *hndl, OCIError *err, const oratext *inpstring,
3858 size_t str_len, OCIInterval *result);
3859
3860 DESCRIPTION
3861 Retuns an OCI_DTYPE_INTERVAL_DS OCIInterval with the region id (if
3862 the region is specified in the input string) set and the current
3863 absolute offset or an absolut offset with the region id set to 0.
3864 PARAMETERS
3865 hndl (IN) - Session/Env handle.
3866 err (IN/OUT) - error handle. If there is an error, it is
3867 recorded in 'err' and this function returns OCI_ERROR.
3868 The error recorded in 'err' can be retrieved by calling
3869 OCIErrorGet().
3870 inpstring (IN) - pointer to the input string
3871 str_len (IN) - inpstring length
3872 result - Output Interval
3873 RETURNS
3874 OCI_SUCCESS on success
3875 OCI_INVALID_HANDLE if 'err' is NULL.
3876 OCI_ERROR on error
3877 Bad interval type
3878 Timezone errors
3879 NOTES
3880 The input string must be of the form [+/-]TZH:TZM or 'TZR [TZD]'
3881
3882 ----------------------- OCIKerbAttrSet ---------------------
3883sword OCIKerbAttrSet(OCISession *trgthndlp, ub4 auth_mode,
3884 ub1 *ftgt_ticket, ub4 ftgt_ticket_len,
3885 ub1 *ftgt_sesskey, ub4 ftgt_sesskey_len,
3886 ub2 ftgt_keytype, ub4 ftgt_ticket_flags,
3887 sb4 ftgt_auth_time, sb4 ftgt_start_time,
3888 sb4 ftgt_end_time, sb4 ftgt_renew_time,
3889 oratext *ftgt_principal, ub4 ftgt_principal_len,
3890 oratext *ftgt_realm, ub4 ftgt_realm_len,
3891 OCIError *errhp);
3892
3893 DESCRIPTION
3894 This call sets the attributes required for Kerberos authentication
3895 on the user handle.
3896
3897 PARAMETERS
3898 trgthndlp (IN) - The pointer to a user handle.
3899 auth_mode (IN) - Indicates what type of Kerberos credentials should
3900 be set. Options are:
3901
3902 OCI_KERBCRED_PROXY
3903 - Set Kerberos credentials for use with
3904 proxy authentication.
3905 OCI_KERBCRED_CLIENT_IDENTIFIER
3906 - Set Kerberos credentials for use
3907 with secure client identifier.
3908
3909 ftgt_ticket (IN) - Forwardable Ticket Granting Ticket (FTGT).
3910 ftgt_ticket_len (IN) - Length of FTGT.
3911 ftgt_sesskey(IN) - Session Key associated with FTGT.
3912 ftgt_sesskey_len (IN) - Length of session key.
3913 ftgt_keytype (IN) - Type of encryption key used to encrypt FTGT.
3914 ftgt_ticket_flags (IN) - Flags associated with encryption of FTGT.
3915 ftgt_auth_time (IN) - Authentication time compatible with that in FTGT.
3916 ftgt_start_time (IN) - Start time compatible with that indicated in FTGT.
3917 ftgt_end_time (IN) - End time compatible with that indicated in FTGT.
3918 ftgt_renew_time (IN) - Renew time compatible with that indicated in FTGT.
3919 ftgt_principal (IN) - Client principal name from FTGT.
3920 ftgt_principal_len (IN) - Length of client principal name.
3921 ftgt_realm (IN) - Client realm name from FTGT.
3922 ftgt_realm_len (IN) - Client realm name length.
3923 errhp (IN/OUT) - error handle. If there is an error, it is
3924 recorded in 'err' and this function returns OCI_ERROR.
3925 The error recorded in 'err' can be retrieved by calling
3926 OCIErrorGet().
3927 RETURNS
3928 OCI_SUCCESS on success
3929 OCI_ERROR on error
3930 NOTES
3931
3932OCILdaToSvcCtx()
3933Name
3934OCI toggle version 7 Lda_Def to SerVice context handle
3935Purpose
3936Converts a V7 Lda_Def to a V8 service context handle.
3937Syntax
3938sword OCILdaToSvcCtx ( OCISvcCtx **svchpp,
3939 OCIError *errhp,
3940 Lda_Def *ldap );
3941Comments
3942Converts a V7 Lda_Def to a V8 service context handle. The action of this call
3943can be reversed by passing the resulting service context handle to the
3944OCISvcCtxToLda() function.
3945Parameters
3946svchpp (IN/OUT) - the service context handle.
3947errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
3948diagnostic information in the event of an error.
3949ldap (IN/OUT) - the V7 logon data area returned by OCISvcCtxToLda() from
3950this service context.
3951Related Functions
3952OCISvcCtxToLda()
3953
3954
3955
3956
3957OCILobAppend()
3958
3959Name
3960OCI Lob APpend
3961
3962Purpose
3963Appends a LOB value at the end of another LOB.
3964
3965Syntax
3966sword OCILobAppend ( OCISvcCtx *svchp,
3967 OCIError *errhp,
3968 OCILobLocator *dst_locp,
3969 OCILobLocator *src_locp );
3970Comments
3971Appends a LOB value at the end of LOB. The data is
3972copied from the source to the destination at the end of the destination. The
3973source and the destination must already exist. The destination LOB is
3974extended to accommodate the newly written data.
3975
3976It is an error to extend the destination LOB beyond the maximum length
3977allowed or to try to copy from a NULL LOB.
3978
3979Parameters
3980svchp (IN) - the service context handle.
3981errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
3982diagnostic information in the event of an error.
3983dst_locp (IN/OUT) - a locator uniquely referencing the destination LOB.
3984src_locp (IN/OUT) - a locator uniquely referencing the source LOB.
3985
3986Related Functions
3987OCILobTrim()
3988OCIErrorGet()
3989OCILobWrite()
3990OCILobCopy()
3991
3992
3993
3994OCILobAssign()
3995
3996Name
3997OCI Lob ASsiGn
3998
3999Purpose
4000Assigns one LOB/FILE locator to another.
4001
4002Syntax
4003sword OCILobAssign ( OCIEnv *envhp,
4004 OCIError *errhp,
4005 const OCILobLocator *src_locp,
4006 OCILobLocator **dst_locpp );
4007
4008Comments
4009Assign source locator to destination locator. After the assignment, both
4010locators refer to the same LOB data. For internal LOBs, the source locator's
4011LOB data gets copied to the destination locator's LOB data only when the
4012destination locator gets stored in the table. Therefore, issuing a flush of
4013the object containing the destination locator will copy the LOB data. For
4014FILEs only the locator that refers to the OS file is copied to the table. The
4015OS file is not copied.
4016Note: The only difference between this and OCILobLocatorAssign is that this
4017takes an environment handle whereas OCILobLocatorAssign takes an OCI service
4018handle
4019
4020Parameters
4021envhp (IN/OUT) - OCI environment handle initialized in object mode.
4022errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded
4023in errhp and this function returns OCI_ERROR. Diagnostic information can be
4024obtained by calling OCIErrorGet().
4025src_locp (IN) - LOB locator to copy from.
4026dst_locpp (IN/OUT) - LOB locator to copy to. The caller must allocate space
4027for the OCILobLocator by calling OCIDescriptorAlloc().
4028
4029See also
4030OCIErrorGet()
4031OCILobIsEqual()
4032OCILobLocatorIsInit()
4033OCILobLocatorAssign()
4034
4035
4036OCILobCharSetForm()
4037
4038Name
4039OCI Lob Get Character Set Form
4040
4041Purpose
4042Gets the LOB locator's character set fpr,, if any.
4043
4044Syntax
4045sword OCILobCharSetForm ( OCIEnv *envhp,
4046 OCIError *errhp,
4047 const OCILobLocator *locp,
4048 ub1 *csfrm );
4049
4050Comments
4051Returns the character set form of the input LOB locator in the csfrm output
4052parameter.
4053
4054Parameters
4055envhp (IN/OUT) - OCI environment handle initialized in object mode.
4056errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it
4057is recorded in err and this function returns OCI_ERROR. Diagnostic
4058information can be obtained by calling OCIErrorGet().
4059locp (IN) - LOB locator for which to get the character set form.
4060csfrm(OUT) - character set form of the input LOB locator. If the input
4061locator is for a BLOB or a BFILE, csfrm is set to 0 since there is no concept
4062of a character set for binary LOBs/FILEs. The caller must allocate space for
4063the csfrm (ub1) and not write into the space.
4064See also
4065OCIErrorGet(), OCILobCharSetId(), OCILobLocatorIsInit
4066
4067
4068
4069OCILobCharSetId()
4070
4071Name
4072OCI Lob get Character Set IDentifier
4073
4074Purpose
4075Gets the LOB locator's character set ID, if any.
4076
4077Syntax
4078sword OCILobCharSetId ( OCIEnv *envhp,
4079 OCIError *errhp,
4080 const OCILobLocator *locp,
4081 ub2 *csid );
4082
4083Comments
4084Returns the character set ID of the input LOB locator in the cid output
4085parameter.
4086
4087Parameters
4088envhp (IN/OUT) - OCI environment handle initialized in object mode.
4089errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it
4090is recorded in err and this function returns OCI_ERROR. Diagnostic
4091information can be obtained by calling OCIErrorGet().
4092locp (IN) - LOB locator for which to get the character set ID.
4093csid (OUT) - character set ID of the input LOB locator. If the input locator
4094is for a BLOB or a BFILE, csid is set to 0 since there is no concept of a
4095character set for binary LOBs/FILEs. The caller must allocate space for the
4096character set id of type ub2 and not write into the space.
4097
4098See also
4099OCIErrorGet(), OCILobCharSetForm(), OCILobLocatorIsInit()
4100
4101
4102
4103OCILobCopy()
4104
4105Name
4106OCI Lob Copy
4107
4108Purpose
4109Copies a portion of a LOB value into another LOB value.
4110
4111Syntax
4112sword OCILobCopy ( OCISvcCtx *svchp,
4113 OCIError *errhp,
4114 OCILobLocator *dst_locp,
4115 OCILobLocator *src_locp,
4116 ub4 amount,
4117 ub4 dst_offset,
4118 ub4 src_offset );
4119
4120Comments
4121Copies a portion of a LOB value into another LOB as specified. The data
4122is copied from the source to the destination. The source (src_locp) and the
4123destination (dlopb) LOBs must already exist.
4124If the data already exists at the destination's start position, it is
4125overwritten with the source data. If the destination's start position is
4126beyond the end of the current data, a hole is created from the end of the data
4127to the beginning of the newly written data from the source. The destination
4128LOB is extended to accommodate the newly written data if it extends
4129beyond the current length of the destination LOB.
4130It is an error to extend the destination LOB beyond the maximum length
4131allowed or to try to copy from a NULL LOB.
4132Parameters
4133svchp (IN) - the service context handle.
4134errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4135diagnostic information in the event of an error.
4136dst_locp (IN/OUT) - a locator uniquely referencing the destination LOB.
4137src_locp (IN/OUT) - a locator uniquely referencing the source LOB.
4138amount (IN) - the number of character or bytes, as appropriate, to be copied.
4139dst_offset (IN) - this is the absolute offset for the destination LOB.
4140For character LOBs it is the number of characters from the beginning of the
4141LOB at which to begin writing. For binary LOBs it is the number of bytes from
4142the beginning of the lob from which to begin reading. The offset starts at 1.
4143src_offset (IN) - this is the absolute offset for the source LOB.
4144For character LOBs it is the number of characters from the beginning of the
4145LOB, for binary LOBs it is the number of bytes. Starts at 1.
4146
4147See Also
4148OCIErrorGet(), OCILobAppend(), OCILobWrite(), OCILobTrim()
4149
4150OCILobCreateTemporary()
4151
4152Name
4153OCI Lob Create Temporary
4154
4155Purpose
4156Create a Temporary Lob
4157
4158Syntax
4159sword OCILobCreateTemporary(OCISvcCtx *svchp,
4160 OCIError *errhp,
4161 OCILobLocator *locp,
4162 ub2 csid,
4163 ub1 csfrm,
4164 ub1 lobtype,
4165 boolean cache,
4166 OCIDuration duration);
4167
4168
4169Comments
4170svchp (IN) - the service context handle.
4171errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4172diagnostic information in the event of an error.
4173locp (IN/OUT) - a locator which points to the temporary Lob
4174csid (IN) - the character set id
4175csfrm(IN) - the character set form
4176lobtype (IN) - the lob type - one of the three constants OCI_TEMP_BLOB,
4177 OCI_TEMP_CLOB and OCI_TEMP_NCLOB
4178cache(IN)- TRUE if the temporary LOB goes through the cache; FALSE, if not.
4179duration(IN)- duration of the temporary LOB; Can be a valid duration id or one
4180 of the values: OCI_DURATION_SESSION, OCI_DURATION_CALL
4181 Note: OCI_DURATION_TRANSACTION is NOT supported in 8.1
4182Related functions
4183OCILobFreeTemporary()
4184OCILobIsTemporary()
4185
4186OCILobDisableBuffering()
4187
4188Name
4189OCI Lob Disable Buffering
4190
4191Purpose
4192Disable lob buffering for the input locator.
4193
4194
4195Syntax
4196sword OCILobDisableBuffering ( OCISvcCtx *svchp,
4197 OCIError *errhp,
4198 OCILobLocator *locp);
4199
4200Comments
4201
4202Disable lob buffering for the input locator. The next time data is
4203read/written from/to the lob through the input locator, the lob
4204buffering subsystem is *not* used. Note that this call does *not*
4205implicitly flush the changes made in the buffering subsystem. The
4206user must explicitly call OCILobFlushBuffer() to do this.
4207
4208Parameters
4209svchp (IN) - the service context handle.
4210errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4211diagnostic information in the event of an error.
4212locp (IN/OUT) - a locator uniquely referencing the LOB.
4213
4214Related Functions
4215OCILobEnableBuffering()
4216OCIErrorGet()
4217OCILobFlushBuffer()
4218
4219
4220
4221
4222OCILobEnableBuffering()
4223
4224Name
4225OCI Lob Enable Buffering
4226
4227Purpose
4228Enable lob buffering for the input locator.
4229
4230
4231Syntax
4232sword OCILobEnableBuffering ( OCISvcCtx *svchp,
4233 OCIError *errhp,
4234 OCILobLocator *locp);
4235
4236Comments
4237
4238Enable lob buffering for the input locator. The next time data is
4239read/written from/to the lob through the input locator, the lob
4240buffering subsystem is used.
4241
4242Once lob buffering is enabled for a locator, if that locator is passed to
4243one of the following routines, an error is returned:
4244 OCILobCopy, OCILobAppend, OCILobErase, OCILobGetLength, OCILobTrim
4245
4246Parameters
4247svchp (IN) - the service context handle.
4248errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4249diagnostic information in the event of an error.
4250locp (IN/OUT) - a locator uniquely referencing the LOB.
4251
4252Related Functions
4253OCILobDisableBuffering()
4254OCIErrorGet()
4255OCILobWrite()
4256OCILobRead()
4257OCILobFlushBuffer()
4258
4259
4260
4261
4262OCILobErase()
4263
4264Name
4265OCI Lob ERase
4266
4267Purpose
4268Erases a specified portion of the LOB data starting at a specified offset.
4269
4270Syntax
4271sword OCILobErase ( OCISvcCtx *svchp,
4272 OCIError *errhp,
4273 OCILobLocator *locp,
4274 ub4 *amount,
4275 ub4 offset );
4276
4277Comments
4278Erases a specified portion of the LOB data starting at a specified offset.
4279The actual number of characters/bytes erased is returned. The actual number
4280of characters/bytes and the requested number of characters/bytes will differ
4281if the end of the LOB data is reached before erasing the requested number of
4282characters/bytes.
4283If a section of data from the middle of the LOB data is erased, a hole is
4284created. When data from that hole is read, 0's are returned. If the LOB is
4285NULL, this routine will indicate that 0 characters/bytes were erased.
4286
4287Parameters
4288svchp (IN) - the service context handle.
4289errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4290diagnostic information in the event of an error.
4291locp (IN/OUT) - the LOB for which to erase a section of data.
4292amount (IN/OUT) - On IN, the number of characters/bytes to erase. On OUT,
4293the actual number of characters/bytes erased.
4294offset (IN) - absolute offset from the beginning of the LOB data from which
4295to start erasing data. Starts at 1.
4296
4297See Also
4298OCIErrorGet(), OCILobRead(), OCILobWrite()
4299
4300OCILobOpen()
4301
4302Name
4303OCI Lob Open
4304
4305Purpose
4306Opens an internal or external Lob.
4307
4308Syntax
4309sword OCILobOpen( OCISvcCtx *svchp,
4310 OCIError *errhp,
4311 OCILobLocator *locp,
4312 ub1 mode );
4313
4314Comments
4315It is an error if the same lob is opened more than once in
4316the same transaction. Lobs are opened implicitly if they are
4317not opened before using them. A LOB has to be closed before
4318the transaction commits else the transaction is rolled back.
4319Open locators are closed if the transaction aborts. Multiple
4320users can open the same lob on different locators.
4321Parameters
4322svchp (IN) - the service context handle.
4323errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4324diagnostic information in the event of an error.
4325locp (IN/OUT) - locator points to the LOB to be opened
4326mode (IN) - mode in which to open the lob. The valid modes are
4327read-only - OCI_FILE_READONLY, read-write - OCI_FILE_READWRITE
4328
4329OCILobClose()
4330
4331Name
4332OCI Lob Close
4333
4334Purpose
4335Closes an open internal or external Lob.
4336
4337Syntax
4338sword OCILobClose( OCISvcCtx *svchp,
4339 OCIError *errhp,
4340 OCILobLocator *locp );
4341
4342
4343Comments
4344It is an error if the lob is not open at this time. All LOBs
4345that have been opened in a transaction have to be closed
4346before the transaction commits, else the transaction gets
4347rolled back.
4348
4349Parameters
4350svchp (IN) - the service context handle.
4351errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4352diagnostic information in the event of an error.
4353locp (IN) - A locator that was opened using OCILobOpen()
4354
4355
4356OCILobFileClose()
4357
4358Name
4359OCI Lob File CLoSe
4360
4361Purpose
4362Closes a previously opened FILE.
4363
4364Syntax
4365sword OCILobFileClose ( OCISvcCtx *svchp,
4366 OCIError *errhp,
4367 OCILobLocator *filep );
4368
4369Comments
4370Closes a previously opened FILE. It is an error if this function is called for
4371an internal LOB. No error is returned if the FILE exists but is not opened.
4372Parameters
4373svchp (IN) - the service context handle.
4374errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4375diagnostic information in the event of an error.
4376filep (IN/OUT) - a pointer to a FILE locator to be closed.
4377
4378See Also
4379OCIErrorGet(), OCILobFileOpen(), OCILobFileCloseAll(), OCILobFileIsOpen(),
4380OCILobFileExists(), CREATE DIRECTORY DDL
4381
4382
4383
4384
4385OCILobFileCloseAll()
4386
4387Name
4388OCI LOB FILE Close All
4389
4390Purpose
4391Closes all open FILEs on a given service context.
4392
4393Syntax
4394sword OCILobFileCLoseAll ( OCISvcCtx *svchp,
4395 OCIError *errhp );
4396
4397Comments
4398Closes all open FILEs on a given service context.
4399
4400Parameters
4401svchp (IN) - the service context handle.
4402errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4403diagnostic information in the event of an error.
4404
4405See also
4406OCILobFileClose(),
4407OCIErrorGet(), OCILobFileOpen(), OCILobFileIsOpen(),
4408OCILobFileExists(), CREATE DIRECTORY DDL
4409
4410
4411
4412
4413OCILobFileExists()
4414
4415Name
4416OCI LOB FILE exists
4417
4418Purpose
4419Tests to see if the FILE exists on the server
4420
4421Syntax
4422sword OCILobFileExists ( OCISvcCtx *svchp,
4423 OCIError *errhp,
4424 OCILobLocator *filep,
4425 boolean *flag );
4426
4427Comments
4428Checks to see if a FILE exists for on the server.
4429
4430Parameters
4431svchp (IN) - the OCI service context handle.
4432errhp (IN/OUT) - error handle. The OCI error handle. If there is an error,
4433it is recorded in err and this function returns OCI_ERROR. Diagnostic
4434information can be obtained by calling OCIErrorGet().
4435filep (IN) - pointer to the FILE locator that refers to the file.
4436flag (OUT) - returns TRUE if the FILE exists; FALSE if it does not.
4437
4438See also
4439OCIErrorGet, CREATE DIRECTORY (DDL)
4440
4441
4442
4443
4444OCILobFileGetName()
4445
4446Name
4447OCI LOB FILE Get file Name
4448
4449Purpose
4450Gets the FILE locator's directory alias and file name.
4451
4452Syntax
4453sword OCILobFileGetName ( OCIEnv *envhp,
4454 OCIError *errhp,
4455 const OCILobLocator *filep,
4456 OraText *dir_alias,
4457 ub2 *d_length,
4458 OraText *filename,
4459 ub2 *f_length );
4460
4461Comments
4462Returns the directory alias and file name associated with this file locator.
4463
4464Parameters
4465envhp (IN/OUT) - OCI environment handle initialized in object mode.
4466errhp (IN/OUT) -The OCI error handle. If there is an error, it is recorded in
4467errhp and this function returns OCI_ERROR. Diagnostic information can be
4468obtained by calling OCIErrorGet().
4469filep (IN) - FILE locator for which to get the directory alias and file name.
4470dir_alias (OUT) - buffer into which the directory alias name is placed. The
4471caller must allocate enough space for the directory alias name and must not
4472write into the space.
4473d_length (IN/OUT)
4474 - IN: length of the input dir_alias string;
4475 - OUT: length of the returned dir_alias string.
4476filename (OUT) - buffer into which the file name is placed. The caller must
4477allocate enough space for the file name and must not write into the space.
4478f_length (IN/OUT)
4479 - IN: length of the input filename string;
4480 - OUT: lenght of the returned filename string.
4481
4482See also
4483OCILobFileSetName(), OCIErrorGet()
4484
4485
4486
4487
4488OCILobFileIsOpen()
4489
4490Name
4491OCI LOB FILE Is Open?
4492
4493Purpose
4494Tests to see if the FILE is open
4495
4496Syntax
4497sword OCILobFileIsOpen ( OCISvcCtx *svchp,
4498 OCIError *errhp,
4499 OCILobLocator *filep,
4500 boolean *flag );
4501
4502Comments
4503Checks to see if the FILE on the server is open for a given LobLocator.
4504
4505Parameters
4506svchp (IN) - the OCI service context handle.
4507errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it
4508is recorded in err and this function returns OCI_ERROR. Diagnostic
4509information can be obtained by calling OCIErrorGet().
4510filep (IN) - pointer to the FILE locator being examined. If the input file
4511locator was never passed to OCILobFileOpen(), the file is considered not to
4512be opened by this locator. However, a different locator may have opened the
4513file. More than one file opens can be performed on the same file using
4514different locators.
4515flag (OUT) - returns TRUE if the FILE is opened using this locator; FALSE if
4516it is not.
4517
4518See also
4519OCIErrorGet, OCILobFileOpen, OCILobFileClose, OCILobFileCloseAll, CREATE
4520DIRECTORY SQL command
4521
4522
4523OCILobFileOpen()
4524
4525Name
4526OCI LOB FILE open
4527
4528Purpose
4529Opens a FILE for read-only access
4530
4531Syntax
4532sword OCILobFileOpen ( OCISvcCtx *svchp,
4533 OCIError *errhp,
4534 OCILobLocator *filep,
4535 ub1 mode );
4536
4537Comments
4538Opens a FILE. The FILE can be opened for read-only access only. FILEs may not
4539be written to throough ORACLE.
4540
4541Parameters
4542svchp (IN) - the service context handle.
4543errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4544diagnostic information in the event of an error.
4545filep (IN/OUT) - the FILE to open. Error if the locator does not refer to a
4546FILE.
4547mode (IN) - mode in which to open the file. The only valid mode is
4548read-only - OCI_FILE_READONLY.
4549
4550See Also
4551OCILobFileClose, OCIErrorGet, OCILobFileCloseAll, OCILobFileIsOpen,
4552OCILobFileSetName, CREATE DIRECTORY
4553
4554
4555
4556
4557OCILobFileSetName()
4558
4559Name
4560OCI Lob File Set NaMe
4561
4562Purpose
4563Sets directory alias and file name in the FILE locator.
4564
4565Syntax
4566sword OCILobFileSetName ( OCIEnv *envhp,
4567 OCIError *errhp,
4568 OCILobLocator **filepp,
4569 OraText *dir_alias,
4570 ub2 d_length,
4571 OraText *filename,
4572 ub2 f_length );
4573Comments
4574Sets the directory alias and file name in the LOB file locator.
4575Parameters
4576envhp (IN/OUT) - OCI environment handle initialized in object mode.
4577errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded
4578in errhp and this function returns OCI_ERROR. Diagnostic information can be
4579obtained by calling OCIErrorGet().
4580filepp (IN/OUT) - FILE locator for which to set the directory alias name.
4581The caller must have already allocated space for the locator by calling
4582OCIDescriptorAlloc().
4583dir_alias (IN) - buffer that contains the directory alias name to set in the
4584locator.
4585d_length (IN) - length of the input dir_alias parameter.
4586filename (IN) - buffer that contains the file name is placed.
4587f_length (IN) - length of the input filename parameter.
4588See also
4589OCILobFileGetName, OCIErrorGet, CREATE DIRECTORY
4590
4591
4592
4593
4594OCILobFlushBuffer()
4595
4596Name
4597OCI Lob Flush all Buffers for this lob.
4598
4599Purpose
4600Flush/write all buffers for this lob to the server.
4601
4602
4603Syntax
4604sword OCILobFlushBuffer ( OCISvcCtx *svchp,
4605 OCIError *errhp,
4606 OCILobLocator *locp,
4607 ub4 flag);
4608
4609Comments
4610
4611Flushes to the server, changes made to the buffering subsystem that
4612are associated with the lob referenced by the input locator. This
4613routine will actually write the data in the buffer to the lob in
4614the database. Lob buffering must have already been enabled for the
4615input lob locator.
4616
4617This routine, by default, does not free the buffer resources for
4618reallocation to another buffered LOB operation. However, if you
4619want to free the buffer explicitly, you can set the flag parameter
4620to OCI_LOB_BUFFER_FREE.
4621
4622Parameters
4623svchp (IN/OUT) - the service context handle.
4624errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4625diagnostic information in the event of an error.
4626locp (IN/OUT) - a locator uniquely referencing the LOB.
4627flag (IN) - to indicate if the buffer resources need to be freed
4628 after a flush. Default value is OCI_LOB_BUFFER_NOFREE.
4629 Set it to OCI_LOB_BUFFER_FREE if you want the buffer
4630 resources to be freed.
4631Related Functions
4632OCILobEnableBuffering()
4633OCILobDisableBuffering()
4634OCIErrorGet()
4635OCILobWrite()
4636OCILobRead()
4637
4638
4639OCILobFreeTemporary()
4640
4641Name
4642OCI Lob Free Temporary
4643
4644Purpose
4645Free a temporary LOB
4646
4647Syntax
4648sword OCILobFreeTemporary(OCISvcCtx *svchp,
4649 OCIError *errhp,
4650 OCILobLocator *locp);
4651
4652Comments
4653 Frees the contents of the temporary Lob this locator is pointing to. Note
4654 that the locator itself is not freed until a OCIDescriptorFree is done.
4655
4656Parameters
4657svchp (IN/OUT) - the service context handle.
4658errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4659diagnostic information in the event of an error.
4660locp (IN/OUT) - a locator uniquely referencing the LOB
4661
4662Related functions
4663OCILobCreateTemporary()
4664OCILobIsTemporary()
4665
4666
4667Name
4668OCI Lob/File Get Chunk Size
4669
4670Purpose
4671When creating the table, the user can specify the chunking factor, which can
4672be a multiple of Oracle blocks. This corresponds to the chunk size used by the
4673LOB data layer when accessing/modifying the LOB value. Part of the chunk is
4674used to store system-related information and the rest stores the LOB value.
4675This function returns the amount of space used in the LOB chunk to store
4676the LOB value.
4677
4678Syntax
4679sword OCILobGetChunkSize ( OCISvcCtx *svchp,
4680 OCIError *errhp,
4681 OCILobLocator *locp,
4682 ub4 *chunksizep );
4683
4684Comments
4685 Performance will be improved if the user issues read/write
4686requests using a multiple of this chunk size. For writes, there is an added
4687benefit since LOB chunks are versioned and, if all writes are done on chunk
4688basis, no extra/excess versioning is done nor duplicated. Users could batch
4689up the write until they have enough for a chunk instead of issuing several
4690write calls for the same chunk.
4691
4692Parameters
4693svchp (IN) - the service context handle.
4694errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4695diagnostic information in the event of an error.
4696locp (IN/OUT) - a LOB locator that uniquely references the LOB. For internal
4697LOBs, this locator must be a locator that was obtained from the server
4698specified by svchp. For FILEs, this locator can be initialized by a Select or
4699OCILobFileSetName.
4700chunksizep (OUT) - On output, it is the length of the LOB if not NULL - for
4701character LOBs it is the number of characters, for binary LOBs it is the
4702number of bytes in the LOB.
4703
4704Related Functions
4705
4706OCILobGetLength()
4707
4708Name
4709OCI Lob/File Length
4710
4711Purpose
4712Gets the length of a LOB/FILE.
4713
4714Syntax
4715sword OCILobGetLength ( OCISvcCtx *svchp,
4716 OCIError *errhp,
4717 OCILobLocator *locp,
4718 ub4 *lenp );
4719
4720Comments
4721Gets the length of a LOB/FILE. If the LOB/FILE is NULL, the length is
4722undefined.
4723
4724Parameters
4725svchp (IN) - the service context handle.
4726errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4727diagnostic information in the event of an error.
4728locp (IN/OUT) - a LOB locator that uniquely references the LOB. For internal
4729LOBs, this locator must be a locator that was obtained from the server
4730specified by svchp. For FILEs, this locator can be initialized by a Select or
4731OCILobFileSetName.
4732lenp (OUT) - On output, it is the length of the LOB if not NULL - for
4733character LOBs it is the number of characters, for binary LOBs it is the
4734number of bytes in the LOB.
4735
4736Related Functions
4737OCIErrorGet, OCIFileSetName
4738
4739
4740
4741OCILobIsEqual()
4742
4743Name
4744
4745OCI Lob Is Equal
4746
4747Purpose
4748Compares two LOB locators for equality.
4749
4750Syntax
4751sword OCILobIsEqual ( OCIEnv *envhp,
4752 const OCILobLocator *x,
4753 const OCILobLocator *y,
4754 boolean *is_equal );
4755
4756Comments
4757Compares the given LOB locators for equality. Two LOB locators are equal if
4758and only if they both refer to the same LOB data.
4759Two NULL locators are considered not equal by this function.
4760Parameters
4761envhp (IN) - the OCI environment handle.
4762x (IN) - LOB locator to compare.
4763y (IN) - LOB locator to compare.
4764is_equal (OUT) - TRUE, if the LOB locators are equal; FALSE if they are not.
4765
4766See also
4767OCILobAssign, OCILobLocatorIsInit
4768OCILobLocatorAssign,
4769OCILobIsOpen()
4770
4771Name
4772
4773OCI Lob Is Open
4774sword OCILobIsOpen(svchp, errhp, locp, flag)
4775OCISvcCtx *svchp;
4776OCIError *errhp;
4777OCILobLocator *locp;
4778boolean *flag;
4779
4780Comments
4781 Checks if the LOB locator was opened before. flag is set to TRUE
4782 if opened; FALSE otherwise
4783
4784
4785Parameters
4786svchp (IN) - the service context handle.
4787errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4788diagnostic information in the event of an error.
4789locp (IN) - the locator to test for temporary LOB
4790flag(OUT) - TRUE, if the LOB locator points to is open
4791 FALSE, if not.
4792
4793OCILobIsTemporary()
4794
4795Name
4796
4797OCI Lob Is Temporary
4798
4799Purpose
4800 Tests if this locator points to a temporary LOB
4801
4802Syntax
4803sword OCILobIsTemporary(OCIEnv *envhp,
4804 OCIError *errhp,
4805 OCILobLocator *locp,
4806 boolean *is_temporary);
4807
4808Comments
4809Tests the locator to determine if it points to a temporary LOB.
4810If so, is_temporary is set to TRUE. If not, is_temporary is set
4811to FALSE.
4812
4813Parameters
4814envhp (IN) - the environment handle.
4815errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4816diagnostic information in the event of an error.
4817locp (IN) - the locator to test for temporary LOB
4818is_temporary(OUT) - TRUE, if the LOB locator points to a temporary LOB;
4819 FALSE, if not.
4820
4821See Also
4822OCILobCreateTemporary, OCILobFreeTemporary
4823
4824
4825OCILobLoadFromFile()
4826
4827Name
4828OCI Lob Load From File
4829
4830Purpose
4831Load/copy all or a portion of the file into an internal LOB.
4832
4833Syntax
4834sword OCILobLoadFromFile ( OCISvcCtx *svchp,
4835 OCIError *errhp,
4836 OCILobLocator *dst_locp,
4837 OCILobLocator *src_filep,
4838 ub4 amount,
4839 ub4 dst_offset,
4840 ub4 src_offset );
4841
4842Comments
4843Loads/copies a portion or all of a file value into an internal LOB as
4844specified. The data is copied from the source file to the destination
4845internal LOB (BLOB/CLOB). No character set conversions are performed
4846when copying the bfile data to a clob/nclob. The bfile data must already
4847be in the same character set as the clob/nclob in the database. No
4848error checking is performed to verify this.
4849The source (src_filep) and the destination (dst_locp) LOBs must already exist.
4850If the data already exists at the destination's start position, it is
4851overwritten with the source data. If the destination's start position is
4852beyond the end of the current data, a hole is created from the end of the data
4853to the beginning of the newly written data from the source. The destination
4854LOB is extended to accommodate the newly written data if it extends
4855beyond the current length of the destination LOB.
4856It is an error to extend the destination LOB beyond the maximum length
4857allowed or to try to copy from a NULL LOB.
4858Parameters
4859svchp (IN) - the service context handle.
4860errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4861diagnostic information in the event of an error.
4862dst_locp (IN/OUT) - a locator uniquely referencing the destination internal
4863LOB which may be of type blob, clob, or nclob.
4864src_filep (IN/OUT) - a locator uniquely referencing the source BFILE.
4865amount (IN) - the number of bytes to be copied.
4866dst_offset (IN) - this is the absolute offset for the destination LOB.
4867For character LOBs it is the number of characters from the beginning of the
4868LOB at which to begin writing. For binary LOBs it is the number of bytes from
4869the beginning of the lob from which to begin reading. The offset starts at 1.
4870src_offset (IN) - this is the absolute offset for the source BFILE. It is
4871the number of bytes from the beginning of the LOB. The offset starts at 1.
4872
4873See Also
4874OCIErrorGet(), OCILobAppend(), OCILobWrite(), OCILobTrim(), OCILobCopy()
4875
4876OCILobLocatorAssign()
4877
4878Name
4879OCI Lob LOCATOR ASsiGn
4880
4881Purpose
4882Assigns one LOB/FILE locator to another.
4883
4884Syntax
4885sword OCILobLocatorAssign ( OCISvcCtx *svchp,
4886 OCIError *errhp,
4887 const OCILobLocator *src_locp,
4888 OCILobLocator **dst_locpp );
4889
4890Comments
4891Assign source locator to destination locator. After the assignment, both
4892locators refer to the same LOB data. For internal LOBs, the source locator's
4893LOB data gets copied to the destination locator's LOB data only when the
4894destination locator gets stored in the table. Therefore, issuing a flush of
4895the object containing the destination locator will copy the LOB data. For
4896FILEs only the locator that refers to the OS file is copied to the table. The
4897OS file is not copied.
4898Note : the only difference between this and OCILobAssign is that this takes
4899a OCI service handle pointer instead of a OCI environment handle pointer
4900
4901Parameters
4902svchp (IN/OUT) - OCI service handle initialized in object mode.
4903errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded
4904in errhp and this function returns OCI_ERROR. Diagnostic information can be
4905obtained by calling OCIErrorGet().
4906src_locp (IN) - LOB locator to copy from.
4907dst_locpp (IN/OUT) - LOB locator to copy to. The caller must allocate space
4908for the OCILobLocator by calling OCIDescriptorAlloc().
4909
4910See also
4911OCIErrorGet()
4912OCILobIsEqual()
4913OCILobLocatorIsInit()
4914OCILobAssign()
4915
4916
4917
4918
4919OCILobLocatorIsInit()
4920
4921Name
4922OCI LOB locator is initialized?
4923
4924Purpose
4925Tests to see if a given LOB locator is initialized.
4926
4927Syntax
4928sword OCILobLocatorIsInit ( OCIEnv *envhp,
4929 OCIError *errhp,
4930 const OCILobLocator *locp,
4931 boolean *is_initialized );
4932
4933Comments
4934Tests to see if a given LOB locator is initialized.
4935
4936Parameters
4937envhp (IN/OUT) - OCI environment handle initialized in object mode.
4938errhp (IN/OUT) - error handle. The OCI error handle. If there is an error, it
4939is recorded in err and this function returns OCI_ERROR. Diagnostic
4940information can be obtained by calling OCIErrorGet().
4941locp (IN) - the LOB locator being tested
4942is_initialized (OUT) - returns TRUE if the given LOB locator is initialized;
4943FALSE if it is not.
4944
4945See also
4946OCIErrorGet, OCILobIsEqual
4947
4948
4949
4950
4951OCILobRead()
4952
4953Name
4954OCI Lob/File ReaD
4955
4956Purpose
4957Reads a portion of a LOB/FILE as specified by the call into a buffer.
4958
4959Syntax
4960sword OCILobRead ( OCISvcCtx *svchp,
4961 OCIError *errhp,
4962 OCILobLocator *locp,
4963 ub4 offset,
4964 ub4 *amtp,
4965 void *bufp,
4966 ub4 bufl,
4967 void *ctxp,
4968 OCICallbackLobRead cbfp,
4969 ub2 csid,
4970 ub1 csfrm );
4971
4972Comments
4973Reads a portion of a LOB/FILE as specified by the call into a buffer. Data
4974read from a hole is returned as 0s. It is an error to try to read from a NULL
4975LOB/FILE. The OS FILE must already exist on the server and must have been
4976opened using the input locator. Oracle must hav epermission to read the OS
4977file and user must have read permission on the directory object.
4978
4979Parameters
4980svchp (IN/OUT) - the service context handle.
4981errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
4982diagnostic information in the event of an error.
4983locp (IN/OUT) - a LOB locator that uniquely references a LOB.
4984offset (IN) - On input, it is the absolute offset, for character LOBs in the
4985number of characters from the beginning of the LOB, for binary LOBs it is the
4986number of bytes. Starts from 1.
4987amtp (IN/OUT) - On input, the number of character or bytes to be read. On
4988output, the actual number of bytes or characters read.
4989If the amount of bytes to be read is larger than the buffer length it is
4990assumed that the LOB is being read in a streamed mode. On input if this value
4991is 0, then the data shall be read in streamed mode from the LOB until the end
4992of LOB. If the data is read in pieces, *amtp always contains the length of
4993the last piece read. If a callback function is defined, then this callback
4994function will be invoked each time bufl bytes are read off the pipe. Each
4995piece will be written into bufp.
4996If the callback function is not defined, then OCI_NEED_DATA error code will
4997be returned. The application must invoke the LOB read over and over again to
4998read more pieces of the LOB until the OCI_NEED_DATA error code is not
4999returned. The buffer pointer and the length can be different in each call
5000if the pieces are being read into different sizes and location.
5001bufp (IN) - the pointer to a buffer into which the piece will be read. The
5002length of the allocated memory is assumed to be bufl.
5003bufl (IN) - the length of the buffer in octets.
5004ctxp (IN) - the context for the call back function. Can be NULL.
5005cbfp (IN) - a callback that may be registered to be called for each piece. If
5006this is NULL, then OCI_NEED_DATA will be returned for each piece.
5007The callback function must return OCI_CONTINUE for the read to continue.
5008If any other error code is returned, the LOB read is aborted.
5009 ctxp (IN) - the context for the call back function. Can be NULL.
5010 bufp (IN) - a buffer pointer for the piece.
5011 len (IN) - the length of length of current piece in bufp.
5012 piece (IN) - which piece - OCI_FIRST_PIECE, OCI_NEXT_PIECE or
5013 OCI_LAST_PIECE.
5014csid - the character set ID of the buffer data
5015csfrm - the character set form of the buffer data
5016
5017Related Functions
5018OCIErrorGet, OCILobWrite, OCILobFileOpen, OCILobFileSetName, CREATE DIRECTORY
5019
5020
5021
5022
5023OCILobTrim()
5024
5025Name
5026
5027OCI Lob Trim
5028
5029Purpose
5030Trims the lob value to a shorter length
5031
5032Syntax
5033sword OCILobTrim ( OCISvcCtx *svchp,
5034 OCIError *errhp,
5035 OCILobLocator *locp,
5036 ub4 newlen );
5037
5038Comments
5039Truncates LOB data to a specified shorter length.
5040
5041Parameters
5042svchp (IN) - the service context handle.
5043errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5044diagnostic information in the event of an error.
5045locp (IN/OUT) - a LOB locator that uniquely references the LOB. This locator
5046must be a locator that was obtained from the server specified by svchp.
5047newlen (IN) - the new length of the LOB data, which must be less than or equal
5048to the current length.
5049
5050Related Functions
5051OCIErrorGet, OCILobWrite, OCiLobErase, OCILobAppend, OCILobCopy
5052
5053
5054
5055
5056
5057OCILobWrite()
5058
5059Name
5060OCI Lob Write
5061
5062Purpose
5063Writes a buffer into a LOB
5064
5065Syntax
5066sword OCILobWrite ( OCISvcCtx *svchp,
5067 OCIError *errhp,
5068 OCILobLocator *locp,
5069 ub4 offset,
5070 ub4 *amtp,
5071 void *bufp,
5072 ub4 buflen,
5073 ub1 piece,
5074 void *ctxp,
5075 OCICallbackLobWrite (cbfp)
5076 (
5077 void *ctxp,
5078 void *bufp,
5079 ub4 *lenp,
5080 ub1 *piecep )
5081 ub2 csid
5082 ub1 csfrm );
5083
5084
5085Comments
5086Writes a buffer into a LOB as specified. If LOB data already exists
5087it is overwritten with the data stored in the buffer.
5088The buffer can be written to the LOB in a single piece with this call, or
5089it can be provided piecewise using callbacks or a standard polling method.
5090If this value of the piece parameter is OCI_FIRST_PIECE, data must be
5091provided through callbacks or polling.
5092If a callback function is defined in the cbfp parameter, then this callback
5093function will be invoked to get the next piece after a piece is written to
5094the pipe. Each piece will be written from bufp.
5095If no callback function is defined, then OCILobWrite() returns the
5096OCI_NEED_DATA error code. The application must all OCILobWrite() again
5097to write more pieces of the LOB. In this mode, the buffer pointer and the
5098length can be different in each call if the pieces are of different sizes and
5099from different locations. A piece value of OCI_LAST_PIECE terminates the
5100piecewise write.
5101
5102Parameters
5103svchp (IN/OUT) - the service context handle.
5104errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5105diagnostic information in the event of an error.
5106locp (IN/OUT) - a LOB locator that uniquely references a LOB.
5107offset (IN) - On input, it is the absolute offset, for character LOBs in
5108the number of characters from the beginning of the LOB, for binary LOBs it
5109is the number of bytes. Starts at 1.
5110bufp (IN) - the pointer to a buffer from which the piece will be written. The
5111length of the allocated memory is assumed to be the value passed in bufl.
5112Even if the data is being written in pieces, bufp must contain the first
5113piece of the LOB when this call is invoked.
5114bufl (IN) - the length of the buffer in bytes.
5115Note: This parameter assumes an 8-bit byte. If your platform uses a
5116longer byte, the value of bufl must be adjusted accordingly.
5117piece (IN) - which piece of the buffer is being written. The default value for
5118this parameter is OCI_ONE_PIECE, indicating the buffer will be written in a
5119single piece.
5120The following other values are also possible for piecewise or callback mode:
5121OCI_FIRST_PIECE, OCI_NEXT_PIECE and OCI_LAST_PIECE.
5122amtp (IN/OUT) - On input, takes the number of character or bytes to be
5123written. On output, returns the actual number of bytes or characters written.
5124If the data is written in pieces, *amtp will contain the total length of the
5125pieces written at the end of the call (last piece written) and is undefined in
5126between.
5127(Note it is different from the piecewise read case)
5128ctxp (IN) - the context for the call back function. Can be NULL.
5129cbfp (IN) - a callback that may be registered to be called for each piece in
5130a piecewise write. If this is NULL, the standard polling method will be used.
5131The callback function must return OCI_CONTINUE for the write to continue.
5132If any other error code is returned, the LOB write is aborted. The
5133callback takes the following parameters:
5134 ctxp (IN) - the context for the call back function. Can be NULL.
5135 bufp (IN/OUT) - a buffer pointer for the piece.
5136 lenp (IN/OUT) - the length of the buffer (in octets) and the length of
5137 current piece in bufp (out octets).
5138 piecep (OUT) - which piece - OCI_NEXT_PIECE or OCI_LAST_PIECE.
5139csid - the character set ID of the buffer data
5140csfrm - the character set form of the buffer data
5141Related Functions
5142
5143OCILobWriteAppend()
5144
5145Name
5146OCI Lob Write Append
5147
5148Purpose
5149Writes data to the end of a LOB value. This call provides the ability
5150to get the length of the data and append it to the end of the LOB in
5151a single round trip to the server.
5152
5153Syntax
5154sword OCILobWriteAppend ( OCISvcCtx *svchp,
5155 OCIError *errhp,
5156 OCILobLocator *locp,
5157 ub4 *amtp,
5158 void *bufp,
5159 ub4 buflen,
5160 ub1 piece,
5161 void *ctxp,
5162 OCICallbackLobWrite (cbfp)
5163 (
5164 void *ctxp,
5165 void *bufp,
5166 ub4 *lenp,
5167 ub1 *piecep )
5168 ub2 csid
5169 ub1 csfrm );
5170
5171
5172Comments
5173Writes a buffer to the end of a LOB as specified. If LOB data already exists
5174it is overwritten with the data stored in the buffer.
5175The buffer can be written to the LOB in a single piece with this call, or
5176it can be provided piecewise using callbacks or a standard polling method.
5177If this value of the piece parameter is OCI_FIRST_PIECE, data must be
5178provided through callbacks or polling.
5179If a callback function is defined in the cbfp parameter, then this callback
5180function will be invoked to get the next piece after a piece is written to the
5181pipe. Each piece will be written from bufp.
5182If no callback function is defined, then OCILobWriteAppend() returns the
5183OCI_NEED_DATA error code. The application must all OCILobWriteAppend() again
5184to write more pieces of the LOB. In this mode, the buffer pointer and the
5185length can be different in each call if the pieces are of different sizes and
5186from different locations. A piece value of OCI_LAST_PIECE terminates the
5187piecewise write.
5188
5189Parameters
5190svchp (IN/OUT) - the service context handle.
5191errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5192diagnostic information in the event of an error.
5193locp (IN/OUT) - a LOB locator that uniquely references a LOB.
5194bufp (IN) - the pointer to a buffer from which the piece will be written. The
5195length of the allocated memory is assumed to be the value passed in bufl. Even
5196if the data is being written in pieces, bufp must contain the first piece of
5197the LOB when this call is invoked.
5198bufl (IN) - the length of the buffer in bytes.
5199Note: This parameter assumes an 8-bit byte. If your platform uses a
5200longer byte, the value of bufl must be adjusted accordingly.
5201piece (IN) - which piece of the buffer is being written. The default value for
5202this parameter is OCI_ONE_PIECE, indicating the buffer will be written in a
5203single piece.
5204The following other values are also possible for piecewise or callback mode:
5205OCI_FIRST_PIECE, OCI_NEXT_PIECE and OCI_LAST_PIECE.
5206amtp (IN/OUT) - On input, takes the number of character or bytes to be
5207written. On output, returns the actual number of bytes or characters written.
5208If the data is written in pieces, *amtp will contain the total length of the
5209pieces written at the end of the call (last piece written) and is undefined in
5210between.
5211(Note it is different from the piecewise read case)
5212ctxp (IN) - the context for the call back function. Can be NULL.
5213cbfp (IN) - a callback that may be registered to be called for each piece in a
5214piecewise write. If this is NULL, the standard polling method will be used.
5215The callback function must return OCI_CONTINUE for the write to continue.
5216If any other error code is returned, the LOB write is aborted. The
5217callback takes the following parameters:
5218 ctxp (IN) - the context for the call back function. Can be NULL.
5219 bufp (IN/OUT) - a buffer pointer for the piece.
5220 lenp (IN/OUT) - the length of the buffer (in octets) and the length of
5221 current piece in bufp (out octets).
5222 piecep (OUT) - which piece - OCI_NEXT_PIECE or OCI_LAST_PIECE.
5223csid - the character set ID of the buffer data
5224csfrm - the character set form of the buffer data
5225Related Functions
5226
5227
5228
5229
5230OCILobGetStorageLimit()
5231
5232Name
5233OCI Lob Get Storage Limit
5234
5235Purpose
5236To get the maximum Length of a LOB in bytes that can be stored in the database.
5237
5238Syntax
5239sword OCILobGetStorageLimit ( OCISvcCtx *svchp,
5240 OCIError *errhp,
5241 OCILobLocator *locp,
5242 oraub8 *limitp);
5243
5244
5245Comments
5246With unlimited size LOB support the limit for a LOB is no longer restricted
5247to 4GB.
5248This interface should be used to get the actual limit for storing data for
5249a specific
5250LOB locator. Note that if the compatibality is set to 9.2 or older the limit
5251would still be 4GB.
5252
5253Parameters
5254svchp (IN/OUT) - the service context handle.
5255errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5256diagnostic information in the event of an error.
5257locp (IN/OUT) - a LOB locator that uniquely references a LOB.
5258limitp (OUT) - The storage limit for a LOB in bytes.
5259Related Functions
5260
5261
5262
5263
5264OCILobGetOptions()
5265
5266Name
5267OCI Lob Get Options
5268
5269Purpose
5270To get the current options set for the given SecureFile.
5271
5272Syntax
5273sword OCILobGetOptions ( OCISvcCtx *svchp,
5274 OCIError *errhp,
5275 OCILobLocator *locp,
5276 ub4 optypes,
5277 void *optionsp,
5278 ub4 *optionslenp,
5279 ub4 mode);
5280
5281
5282Comments
5283This function only works on SecureFiles. All others will get an error.
5284
5285Parameters
5286svchp (IN/OUT) - the service context handle.
5287errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5288diagnostic information in the event of an error.
5289locp (IN/OUT) - a LOB locator that uniquely references a LOB.
5290optypes (IN) - the types of options flags to be retrieved.
5291optionsp (OUT) - the options flags or value for the given types.
5292optionslenp (IN/OUT) - the length of option_value buffer
5293mode (IN) - for future use (pass 0 for now).
5294Related Functions
5295OCISetOptions()
5296
5297OCILobSetOptions()
5298
5299Name
5300OCI Lob Set Options
5301
5302Purpose
5303To set the options for the given SecureFile Lob.
5304
5305Syntax
5306sword OCILobSetOptions ( OCISvcCtx *svchp,
5307 OCIError *errhp,
5308 OCILobLocator *locp,
5309 ub4 optypes,
5310 void *optionsp,
5311 ub4 optionslen,
5312 ub4 mode);
5313
5314
5315Comments
5316This function only works on SecureFile Lobs. All others will get an error.
5317
5318Parameters
5319svchp (IN/OUT) - the service context handle.
5320errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5321diagnostic information in the event of an error.
5322locp (IN/OUT) - a LOB locator that uniquely references a LOB.
5323optypes (IN) - the types of options flags to be set.
5324optionsp (IN) - the options flags or value to be set for the given types.
5325optionslen (IN) - then length of option_value buffer
5326mode (IN) - for future use (pass 0 for now).
5327Related Functions
5328OCILobGetOptions()
5329
5330OCILobGetContentType()
5331
5332Name
5333OCI Lob Get Content Type
5334
5335Purpose
5336To get the current contenttype set for the given SecureFile.
5337
5338Syntax
5339sword OCILobGetContentType (OCISvcCtx *svchp,
5340 OCIError *errhp,
5341 OCILobLocator *locp,
5342 oratext *contenttypep,
5343 ub4 *contenttypelenp,
5344 ub4 mode);
5345
5346
5347Comments
5348This function only works on SecureFiles. All others will get an error.
5349If the securefile does not have a contenttype associated with it,
5350the contenttype length (= *contenttypelenp) is returned as 0 without
5351modifying the buffer contenttypep.
5352Parameters
5353svchp (IN/OUT) - the service context handle.
5354errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5355 diagnostic information in the event of an error.
5356locp (IN/OUT) - a LOB locator that uniquely references a LOB.
5357contenttypep(IN/OUT)- pointer to the buffer where the contenttype is stored
5358 after successful execution.
5359 The caller needs to allocate the buffer before calling
5360 this function. The size of the allocated buffer should
5361 be >= OCI_LOB_CONTENTTYPE_MAXSIZE bytes
5362contenttypelenp(IN/OUT)- The caller should set this field to the size
5363 of contenttypep buffer.
5364 After the call successfully executes, it will hold the
5365 size of the contenttype returned.
5366mode (IN) - for future use (pass 0 for now).
5367Related Functions
5368OCISetContentType()
5369
5370OCILobSetContentType()
5371
5372Name
5373OCI Lob Set Content Type
5374
5375Purpose
5376To set the contenttype for the given SecureFile Lob.
5377
5378Syntax
5379sword OCILobSetContentType (OCISvcCtx *svchp,
5380 OCIError *errhp,
5381 OCILobLocator *locp,
5382 const oratext *contenttypep,
5383 ub4 contenttypelen,
5384 ub4 mode);
5385
5386
5387Comments
5388This function only works on SecureFiles. All others will get an error.
5389To clear an existing contenttype set on a securefile, the user will
5390invoke OCILobSetContentType API with contenttypep set to (oratext *)0,
5391and contenttypelen set to 0.
5392Parameters
5393svchp (IN/OUT) - the service context handle.
5394errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5395diagnostic information in the event of an error.
5396locp (IN/OUT) - a LOB locator that uniquely references a LOB.
5397contenttypep (IN) - the contenttype to be set for the given LOB.
5398contenttypelen(IN) - the size of contenttype in bytes. The size of the
5399 contenttype should be <= OCI_LOB_CONTENTTYPE_MAXSIZE
5400 bytes.
5401mode (IN) - for future use (pass 0 for now).
5402Related Functions
5403OCILobGetContentType()
5404
5405
5406OCILogoff()
5407Name
5408OCI simplified Logoff
5409Purpose
5410This function is used to terminate a session created with OCILogon() or
5411OCILogon2().
5412Syntax
5413sword OCILogoff ( OCISvcCtx *svchp
5414 OCIError *errhp );
5415Comments
5416This call is used to terminate a session which was created with OCILogon() or
5417OCILogon2().
5418This call implicitly deallocates the server, authentication, and service
5419context handles.
5420Note: For more information on logging on and off in an application,
5421refer to the section "Application Initialization, Connection, and
5422Authorization" on page 2-16.
5423Parameters
5424svchp (IN) - the service context handle which was used in the call to
5425OCILogon() or OCILogon2().
5426errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5427diagnostic information in the event of an error.
5428See Also
5429OCILogon(), OCILogon2().
5430
5431
5432
5433
5434
5435
5436OCILogon()
5437Name
5438OCI Service Context Logon
5439Purpose
5440This function is used to create a simple logon session.
5441Syntax
5442sword OCILogon ( OCIEnv *envhp,
5443 OCIError *errhp,
5444 OCISvcCtx *svchp,
5445 const OraText *username,
5446 ub4 uname_len,
5447 const OraText *password,
5448 ub4 passwd_len,
5449 const OraText *dbname,
5450 ub4 dbname_len );
5451Comments
5452This function is used to create a simple logon session for an application.
5453Note: Users requiring more complex session (e.g., TP monitor
5454applications) should refer to the section "Application Initialization,
5455Connection, and Authorization" on page 2-16.
5456This call allocates the error and service context handles which are passed to
5457it. This call also implicitly allocates server and authentication handles
5458associated with the session. These handles can be retrieved by calling
5459OCIAttrGet() on the service context handle.
5460Parameters
5461envhp (IN) - the OCI environment handle.
5462errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5463diagnostic information in the event of an error.
5464svchp (OUT) - the service context pointer.
5465username (IN) - the username.
5466uname_len (IN) - the length of username.
5467password (IN) - the user's password.
5468passwd_len (IN) - the length of password.
5469dbname (IN) - the name of the database to connect to.
5470dbname_len (IN) - the length of dbname.
5471See Also
5472OCILogoff()
5473
5474
5475
5476
5477
5478OCILogon2()
5479Name
5480OCI Service Context Logon
5481Purpose
5482This function is used to create a logon session in connection pooling mode.
5483Syntax
5484sword OCILogon2 ( OCIEnv *envhp,
5485 OCIError *errhp,
5486 OCISvcCtx **svchp,
5487 const OraText *username,
5488 ub4 uname_len,
5489 const OraText *password,
5490 ub4 passwd_len,
5491 const OraText *dbname,
5492 ub4 dbname_len,
5493 ub4 mode);
5494Comments
5495This function is used to create a simple logon session for an application in
5496Connection Pooling mode. The valid values for mode are currently OCI_POOL and
5497OCI_DEFAULT. Call to this function with OCI_DEFAULT mode is equivalent to
5498OCILogon() call.
5499This call allocates the error and service context handles which are passed to
5500it. This call also implicitly allocates server and authentication handles
5501associated with the session. These handles can be retrieved by calling
5502OCIAttrGet() on the service context handle. This call assumes that
5503OCIConnectionPoolCreate() has already been called for the same dbname.
5504Parameters
5505envhp (IN) - the OCI environment handle.
5506errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5507diagnostic information in the event of an error.
5508svchp (OUT) - the service context pointer.
5509username (IN) - the username.
5510uname_len (IN) - the length of username.
5511password (IN) - the user's password. If this is null, it is assumed that a
5512 proxy session has to be created and the required grants on
5513 the database are already done.
5514passwd_len (IN) - the length of password.
5515dbname (IN) - the name of the database to connect to.
5516dbname_len (IN) - the length of dbname.
5517mode (IN) - the mode for doing the server attach. Should be OCI_POOL for
5518 using Connection Pooling.
5519
5520
5521See Also
5522OCILogoff()
5523
5524
5525
5526
5527
5528OCIMemoryFree()
5529Name
5530OCI FREE Memory
5531Purpose
5532Frees up storage associated with the pointer.
5533Syntax
5534void OCIMemoryFree ( const OCIStmt *stmhp,
5535 void *memptr);
5536Comments
5537Frees up dynamically allocated data pointers associated with the pointer using
5538either the default memory free function or the registered memory free
5539function, as the case may be.
5540A user-defined memory free function can be registered during the initial call
5541to OCIInitialize().
5542This call is always successful.
5543Parameters
5544stmhp (IN) - statement handle which returned this data buffer.
5545memptr (IN) - pointer to data allocated by the client library.
5546Related Functions
5547OCIInitialize()
5548
5549
5550
5551
5552
5553OCIParamGet()
5554Name
5555OCI Get PARaMeter
5556Purpose
5557Returns a descriptor of a parameter specified by position in the describe
5558handle or statement handle.
5559Syntax
5560sword OCIParamGet ( const void *hndlp,
5561 ub4 htype,
5562 OCIError *errhp,
5563 void **parmdpp,
5564 ub4 pos );
5565Comments
5566This call returns a descriptor of a parameter specified by position in the
5567describe handle or statement handle. Parameter descriptors are always
5568allocated internally by the OCI library. They are read-only.
5569OCI_NO_DATA may be returned if there are no parameter descriptors for this
5570position.
5571See Appendix B for more detailed information about parameter descriptor
5572attributes.
5573Parameters
5574hndlp (IN) - a statement handle or describe handle. The OCIParamGet()
5575function will return a parameter descriptor for this handle.
5576htype (IN) - the type of the handle passed in the handle parameter. Valid
5577types are OCI_HTYPE_DESCRIBE, for a describe handle OCI_HTYPE_STMT, for a
5578statement handle
5579errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5580diagnostic information in the event of an error.
5581parmdpp (OUT) - a descriptor of the parameter at the position given in the pos
5582parameter.
5583pos (IN) - position number in the statement handle or describe handle. A
5584parameter descriptor will be returned for this position.
5585Note: OCI_NO_DATA may be returned if there are no parameter
5586descriptors for this position.
5587Related Functions
5588OCIAttrGet(), OCIAttrSet()
5589
5590
5591
5592
5593
5594OCIParamSet()
5595Name
5596OCI Parameter Set in handle
5597Purpose
5598Used to set a complex object retrieval descriptor into a complex object
5599retrieval handle.
5600Syntax
5601sword OCIParamGet ( void *hndlp,
5602 ub4 htyp,
5603 OCIError *errhp,
5604 const void *dscp,
5605 ub4 dtyp,
5606 ub4 pos );
5607Comments
5608This call sets a given complex object retrieval descriptor into a complex
5609object retrieval handle.
5610The handle must have been previously allocated using OCIHandleAlloc(), and
5611the descriptor must have been previously allocated using OCIDescAlloc().
5612Attributes of the descriptor are set using OCIAttrSet().
5613Parameters
5614hndlp (IN/OUT) - handle pointer.
5615htype (IN) - handle type.
5616errhp (IN/OUT) - error handle.
5617dscp (IN) - complex object retrieval descriptor pointer.
5618dtyp (IN) -
5619pos (IN) - position number.
5620See Also
5621
5622
5623
5624
5625
5626OCIPasswordChange()
5627Name
5628OCI Change PassWord
5629Purpose
5630This call allows the password of an account to be changed.
5631Syntax
5632sword OCIPasswordChange ( OCISvcCtx *svchp,
5633 OCIError *errhp,
5634 const OraText *user_name,
5635 ub4 usernm_len,
5636 const OraText *opasswd,
5637 ub4 opasswd_len,
5638 const OraText *npasswd,
5639 sb4 npasswd_len,
5640 ub4 mode);
5641Comments
5642This call allows the password of an account to be changed. This call is
5643similar to OCISessionBegin() with the following differences:
5644If the user authentication is already established, it authenticates
5645the account using the old password and then changes the
5646password to the new password
5647If the user authentication is not established, it establishes a user
5648authentication and authenticates the account using the old
5649password, then changes the password to the new password.
5650This call is useful when the password of an account is expired and
5651OCISessionBegin() returns an error or warning which indicates that the
5652password has expired.
5653Parameters
5654svchp (IN/OUT) - a handle to a service context. The service context handle
5655must be initialized and have a server context handle associated with it.
5656errhp (IN) - an error handle which can be passed to OCIErrorGet() for
5657diagnostic information in the event of an error.
5658user_name (IN) - specifies the user name. It points to a character string,
5659whose length is specified in usernm_len. This parameter must be NULL if the
5660service context has been initialized with an authentication handle.
5661usernm_len (IN) - the length of the user name string specified in user_name.
5662For a valid user name string, usernm_len must be non-zero.
5663opasswd (IN) - specifies the user's old password. It points to a character
5664string, whose length is specified in opasswd_len .
5665opasswd_len (IN) - the length of the old password string specified in opasswd.
5666For a valid password string, opasswd_len must be non-zero.
5667npasswd (IN) - specifies the user's new password. It points to a character
5668string, whose length is specified in npasswd_len which must be non-zero for a
5669valid password string. If the password complexity verification routine is
5670specified in the user's profile to verify the new password's complexity, the
5671new password must meet the complexity requirements of the verification
5672function.
5673npasswd_len (IN) - then length of the new password string specified in
5674npasswd. For a valid password string, npasswd_len must be non-zero.
5675mode - pass as OCI_DEFAULT.
5676Related Functions
5677OCISessionBegin()
5678
5679
5680----------------------------------OCIReset------------------------------------
5681
5682
5683OCIReset()
5684Name
5685OCI Reset
5686Purpose
5687Resets the interrupted asynchronous operation and protocol. Must be called
5688if a OCIBreak call had been issued while a non-blocking operation was in
5689progress.
5690Syntax
5691sword OCIReset ( void *hndlp,
5692 OCIError *errhp);
5693Comments
5694This call is called in non-blocking mode ONLY. Resets the interrupted
5695asynchronous operation and protocol. Must be called if a OCIBreak call
5696had been issued while a non-blocking operation was in progress.
5697Parameters
5698hndlp (IN) - the service context handle or the server context handle.
5699errhp (IN) - an error handle which can be passed to OCIErrorGet() for
5700diagnostic information in the event of an error.
5701Related Functions
5702
5703
5704OCIResultSetToStmt()
5705Name
5706OCI convert Result Set to Statement Handle
5707Purpose
5708Converts a descriptor to statement handle for fetching rows.
5709Syntax
5710sword OCIResultSetToStmt ( OCIResult *rsetdp,
5711 OCIError *errhp );
5712Comments
5713Converts a descriptor to statement handle for fetching rows.
5714A result set descriptor can be allocated with a call to OCIDescAlloc().
5715Parameters
5716rsetdp (IN/OUT) - a result set descriptor pointer.
5717errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5718diagnostic information in the event of an error.
5719Related Functions
5720OCIDescAlloc()
5721
5722
5723
5724
5725OCIServerAttach()
5726Name
5727OCI ATtaCH to server
5728Purpose
5729Creates an access path to a data source for OCI operations.
5730Syntax
5731sword OCIServerAttach ( OCIServer *srvhp,
5732 OCIError *errhp,
5733 const OraText *dblink,
5734 sb4 dblink_len,
5735 ub4 mode);
5736Comments
5737This call is used to create an association between an OCI application and a
5738particular server.
5739This call initializes a server context handle, which must have been previously
5740allocated with a call to OCIHandleAlloc().
5741The server context handle initialized by this call can be associated with a
5742service context through a call to OCIAttrSet(). Once that association has been
5743made, OCI operations can be performed against the server.
5744If an application is operating against multiple servers, multiple server
5745context handles can be maintained. OCI operations are performed against
5746whichever server context is currently associated with the service context.
5747Parameters
5748srvhp (IN/OUT) - an uninitialized server context handle, which gets
5749initialized by this call. Passing in an initialized server handle causes an
5750error.
5751errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5752diagnostic information in the event of an error.
5753dblink (IN) - specifies the database (server) to use. This parameter points to
5754a character string which specifies a connect string or a service point. If the
5755connect string is NULL, then this call attaches to the default host. The length
5756of connstr is specified in connstr_len. The connstr pointer may be freed by the
5757caller on return.
5758dblink_len (IN) - the length of the string pointed to by connstr. For a valid
5759connect string name or alias, connstr_len must be non-zero.
5760mode (IN) - specifies the various modes of operation. For release 8.0, pass as
5761OCI_DEFAULT - in this mode, calls made to the server on this server context
5762are made in blocking mode.
5763Example
5764See the description of OCIStmtPrepare() on page 13-96 for an example showing
5765the use of OCIServerAttach().
5766Related Functions
5767OCIServerDetach()
5768
5769
5770
5771OCIServerDetach()
5772Name
5773OCI DeTaCH server
5774Purpose
5775Deletes an access to a data source for OCI operations.
5776Syntax
5777sword OCIServerDetach ( OCIServer *svrhp,
5778 OCIError *errhp,
5779 ub4 mode);
5780Comments
5781This call deletes an access to data source for OCI operations, which was
5782established by a call to OCIServerAttach().
5783Parameters
5784srvhp (IN) - a handle to an initialized server context, which gets reset to
5785uninitialized state. The handle is not de-allocated.
5786errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5787diagnostic information in the event of an error.
5788mode (IN) - specifies the various modes of operation. The only valid mode is
5789OCI_DEFAULT for the default mode.
5790Related Functions
5791OCIServerAttach()
5792
5793
5794
5795OCIServerVersion()
5796Name
5797OCI VERSion
5798Purpose
5799Returns the version string of the Oracle server.
5800Syntax
5801sword OCIServerVersion ( void *hndlp,
5802 OCIError *errhp,
5803 OraText *bufp,
5804 ub4 bufsz
5805 ub1 hndltype );
5806Comments
5807This call returns the version string of the Oracle server.
5808For example, the following might be returned as the version string if your
5809application is running against a 7.3.2 server:
5810Oracle7 Server Release 7.3.2.0.0 - Production Release
5811PL/SQL Release 2.3.2.0.0 - Production
5812CORE Version 3.5.2.0.0 - Production
5813TNS for SEQUENT DYNIX/ptx: Version 2.3.2.0.0 - Production
5814NLSRTL Version 3.2.2.0.0 - Production
5815
5816Parameters
5817hndlp (IN) - the service context handle or the server context handle.
5818errhp (IN) - an error handle which can be passed to OCIErrorGet() for
5819diagnostic information in the event of an error.
5820bufp (IN) - the buffer in which the version information is returned.
5821bufsz (IN) - the length of the buffer.
5822hndltype (IN) - the type of handle passed to the function.
5823Related Functions
5824
5825
5826
5827
5828
5829OCISessionBegin()
5830Name
5831OCI Session Begin and authenticate user
5832Purpose
5833Creates a user authentication and begins a user session for a given server.
5834Syntax
5835sword OCISessionBegin ( OCISvcCtx *svchp,
5836 OCIError *errhp,
5837 OCISession *usrhp,
5838 ub4 credt,
5839 ub4 mode);
5840
5841Comments
5842For Oracle8, OCISessionBegin() must be called for any given server handle
5843before requests can be made against it. Also, OCISessionBegin() only supports
5844authenticating the user for access to the Oracle server specified by the
5845server handle in the service context. In other words, after OCIServerAttach()
5846is called to initialize a server handle, OCISessionBegin() must be called to
5847authenticate the user for that given server.
5848When OCISessionBegin() is called for the first time for the given server
5849handle, the initialized authentication handle is called a primary
5850authentication context. A primary authentication context may not be created
5851with the OCI_MIGRATE mode. Also, only one primary authentication context can
5852be created for a given server handle and the primary authentication context c
5853an only ever be used with that server handle. If the primary authentication
5854context is set in a service handle with a different server handle, then an
5855error will result.
5856After OCISessionBegin() has been called for the server handle, and the primary
5857authentication context is set in the service handle, OCISessionBegin() may be
5858called again to initialize another authentication handle with different (or
5859the same) credentials. When OCISessionBegin() is called with a service handle
5860set with a primary authentication context, the returned authentication context
5861in authp is called a user authentication context. As many user authentication
5862contexts may be initialized as desired.
5863User authentication contexts may be created with the OCI_MIGRATE mode.
5864If the OCI_MIGRATE mode is not specified, then the user authentication
5865context can only ever be used with the same server handle set in svchp. If
5866OCI_MIGRATE mode is specified, then the user authentication may be set
5867with different server handles. However, the user authentication context is
5868restricted to use with only server handles which resolve to the same database
5869instance and that have equivalent primary authentication contexts. Equivalent
5870authentication contexts are those which were authenticated as the same
5871database user.
5872OCI_SYSDBA, OCI_SYSOPER, OCI_SYSASM, and OCI_PRELIM_AUTH may only be used
5873with a primary authentication context.
5874To provide credentials for a call to OCISessionBegin(), one of two methods are
5875supported. The first is to provide a valid username and password pair for
5876database authentication in the user authentication handle passed to
5877OCISessionBegin(). This involves using OCIAttrSet() to set the
5878OCI_ATTR_USERNAME and OCI_ATTR_PASSWORD attributes on the
5879authentication handle. Then OCISessionBegin() is called with
5880OCI_CRED_RDBMS.
5881Note: When the authentication handle is terminated using
5882OCISessionEnd(), the username and password attributes remain
5883unchanged and thus can be re-used in a future call to OCISessionBegin().
5884Otherwise, they must be reset to new values before the next
5885OCISessionBegin() call.
5886The second type of credentials supported are external credentials. No
5887attributes need to be set on the authentication handle before calling
5888OCISessionBegin(). The credential type is OCI_CRED_EXT. This is equivalent
5889to the Oracle7 `connect /' syntax. If values have been set for
5890OCI_ATTR_USERNAME and OCI_ATTR_PASSWORD, then these are
5891ignored if OCI_CRED_EXT is used.
5892Parameters
5893svchp (IN) - a handle to a service context. There must be a valid server
5894handle set in svchp.
5895errhp (IN) - an error handle to the retrieve diagnostic information.
5896usrhp (IN/OUT) - a handle to an authentication context, which is initialized
5897by this call.
5898credt (IN) - specifies the type of credentials to use for authentication.
5899Valid values for credt are:
5900OCI_CRED_RDBMS - authenticate using a database username and
5901password pair as credentials. The attributes OCI_ATTR_USERNAME
5902and OCI_ATTR_PASSWORD should be set on the authentication
5903context before this call.
5904OCI_CRED_EXT - authenticate using external credentials. No username
5905or password is provided.
5906mode (IN) - specifies the various modes of operation. Valid modes are:
5907OCI_DEFAULT - in this mode, the authentication context returned may
5908only ever be set with the same server context specified in svchp. This
5909establishes the primary authentication context.
5910OCI_MIGRATE - in this mode, the new authentication context may be
5911set in a service handle with a different server handle. This mode
5912establishes the user authentication context.
5913OCI_SYSDBA - in this mode, the user is authenticated for SYSDBA
5914access.
5915OCI_SYSOPER - in this mode, the user is authenticated for SYSOPER
5916access.
5917OCI_SYSASM - in this mode, the user is authenticated for SYSASM
5918access. Note that only an ASM instance can grant SYSASM access.
5919OCI_PRELIM_AUTH - this mode may only be used with OCI_SYSDBA, OCI_SYSASM,
5920or OCI_SYSOPER to authenticate for certain administration tasks.
5921Related Functions
5922OCISessionEnd()
5923
5924
5925
5926
5927
5928
5929OCISessionEnd()
5930Name
5931OCI Terminate user Authentication Context
5932Purpose
5933Terminates a user authentication context created by OCISessionBegin()
5934Syntax
5935sword OCISessionEnd ( OCISvcCtx *svchp,
5936 OCIError *errhp,
5937 OCISession *usrhp,
5938 ub4 mode);
5939
5940Comments
5941The user security context associated with the service context is invalidated
5942by this call. Storage for the authentication context is not freed. The
5943transaction specified by the service context is implicitly committed. The
5944transaction handle, if explicitly allocated, may be freed if not being used.
5945Resources allocated on the server for this user are freed.
5946The authentication handle may be reused in a new call to OCISessionBegin().
5947Parameters
5948svchp (IN/OUT) - the service context handle. There must be a valid server
5949handle and user authentication handle associated with svchp.
5950errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
5951diagnostic information in the event of an error.
5952usrhp (IN) - de-authenticate this user. If this parameter is passed as NULL,
5953the user in the service context handle is de-authenticated.
5954mode (IN) - the only valid mode is OCI_DEFAULT.
5955Example
5956In this example, an authentication context is destroyed.
5957Related Functions
5958OCISessionBegin()
5959
5960
5961
5962
5963OCIStmtExecute()
5964Name
5965OCI EXECute
5966Purpose
5967This call associates an application request with a server.
5968Syntax
5969sword OCIStmtExecute ( OCISvcCtx *svchp,
5970 OCIStmt *stmtp,
5971 OCIError *errhp,
5972 ub4 iters,
5973 ub4 rowoff,
5974 const OCISnapshot *snap_in,
5975 OCISnapshot *snap_out,
5976 ub4 mode );
5977Comments
5978This function is used to execute a prepared SQL statement.
5979Using an execute call, the application associates a request with a server. On
5980success, OCI_SUCCESS is returned.
5981If a SELECT statement is executed, the description of the select list follows
5982implicitly as a response. This description is buffered on the client side for
5983describes, fetches and define type conversions. Hence it is optimal to
5984describe a select list only after an execute.
5985Also for SELECT statements, some results are available implicitly. Rows will
5986be received and buffered at the end of the execute. For queries with small row
5987count, a prefetch causes memory to be released in the server if the end of
5988fetch is reached, an optimization that may result in memory usage reduction.
5989Set attribute call has been defined to set the number of rows to be prefetched
5990per result set.
5991For SELECT statements, at the end of the execute, the statement handle
5992implicitly maintains a reference to the service context on which it is
5993executed. It is the user's responsibility to maintain the integrity of the
5994service context. If the attributes of a service context is changed for
5995executing some operations on this service context, the service context must
5996be restored to have the same attributes, that a statement was executed with,
5997prior to a fetch on the statement handle. The implicit reference is maintained
5998until the statement handle is freed or the fetch is cancelled or an end of
5999fetch condition is reached.
6000Note: If output variables are defined for a SELECT statement before a
6001call to OCIStmtExecute(), the number of rows specified by iters will be
6002fetched directly into the defined output buffers and additional rows
6003equivalent to the prefetch count will be prefetched. If there are no
6004additional rows, then the fetch is complete without calling
6005OCIStmtFetch().
6006The execute call will return errors if the statement has bind data types that
6007are not supported in an Oracle7 server.
6008Parameters
6009svchp (IN/OUT) - service context handle.
6010stmtp (IN/OUT) - an statement handle - defines the statement and the
6011associated data to be executed at the server. It is invalid to pass in a
6012statement handle that has bind of data types only supported in release 8.0
6013when srvchp points to an Oracle7 server.
6014errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
6015diagnostic information in the event of an error. If the statement is being
6016batched and it is successful, then this handle will contain this particular
6017statement execution specific errors returned from the server when the batch is
6018flushed.
6019iters (IN) - the number of times this statement is executed for non-Select
6020statements. For Select statements, if iters is non-zero, then defines must
6021have been done for the statement handle. The execution fetches iters rows into
6022these predefined buffers and prefetches more rows depending upon the prefetch
6023row count. This function returns an error if iters=0 for non-SELECT
6024statements.
6025rowoff (IN) - the index from which the data in an array bind is relevant for
6026this multiple row execution.
6027snap_in (IN) - this parameter is optional. if supplied, must point to a
6028snapshot descriptor of type OCI_DTYPE_SNAP. The contents of this descriptor
6029must be obtained from the snap_out parameter of a previous call. The
6030descriptor is ignored if the SQL is not a SELECT. This facility allows
6031multiple service contexts to ORACLE to see the same consistent snapshot of the
6032database's committed data. However, uncommitted data in one context is not
6033visible to another context even using the same snapshot.
6034snap_out (OUT) - this parameter optional. if supplied, must point to a
6035descriptor of type OCI_DTYPE_SNAP. This descriptor is filled in with an
6036opaque representation which is the current ORACLE "system change
6037number" suitable as a snap_in input to a subsequent call to OCIStmtExecute().
6038This descriptor should not be used any longer than necessary in order to avoid
6039"snapshot too old" errors.
6040mode (IN) - The modes are:
6041If OCI_DEFAULT_MODE, the default mode, is selected, the request is
6042immediately executed. Error handle contains diagnostics on error if any.
6043OCI_EXACT_FETCH - if the statement is a SQL SELECT, this mode is
6044only valid if the application has set the prefetch row count prior to this
6045call. In this mode, the OCI library will get up to the number of rows
6046specified (i.e., prefetch row count plus iters). If the number of rows
6047returned by the query is greater than this value, OCI_ERROR will be
6048returned with ORA-01422 as the implementation specific error in a
6049diagnostic record. If the number of rows returned by the query is
6050smaller than the prefetch row count, OCI_SUCCESS_WITH_INFO will
6051be returned with ORA-01403 as the implementation specific error. The
6052prefetch buffer size is ignored and the OCI library tries to allocate all the
6053space required to contain the prefetched rows. The exact fetch semantics
6054apply to only the top level rows. No more rows can be fetched for this
6055query at the end of the call.
6056OCI_KEEP_FETCH_STATE - the result set rows (not yet fetched) of this
6057statement executed in this transaction will be maintained when the
6058transaction is detached for migration. By default, a query is cancelled
6059when a transaction is detached for migration. This mode is the default
6060mode when connected to a V7 server.
6061Related Functions
6062OCIStmtPrepare()
6063
6064
6065
6066
6067
6068OCIStmtFetch()
6069Name
6070OCI FetCH
6071Purpose
6072Fetches rows from a query.
6073Syntax
6074sword OCIStmtFetch ( OCIStmt *stmtp,
6075 OCIError *errhp,
6076 ub4 nrows,
6077 ub2 orientation,
6078 ub4 mode);
6079Comments
6080The fetch call is a local call, if prefetched rows suffice. However, this is
6081transparent to the application. If LOB columns are being read, LOB locators
6082are fetched for subsequent LOB operations to be performed on these locators.
6083Prefetching is turned off if LONG columns are involved.
6084A fetch with nrows set to 0 rows effectively cancels the fetch for this
6085statement.
6086Parameters
6087stmtp (IN) - a statement (application request) handle.
6088errhp (IN) - an error handle which can be passed to OCIErrorGet() for
6089diagnostic information in the event of an error.
6090nrows (IN) - number of rows to be fetched from the current position.
6091orientation (IN) - for release 8.0, the only acceptable value is
6092OCI_FETCH_NEXT, which is also the default value.
6093mode (IN) - for release 8.0, beta-1, the following mode is defined.
6094OCI_DEFAULT - default mode
6095OCI_EOF_FETCH - indicates that it is the last fetch from the result set.
6096If nrows is non-zero, setting this mode effectively cancels fetching after
6097retrieving nrows, otherwise it cancels fetching immediately.
6098Related Functions
6099OCIAttrGet()
6100
6101OCIStmtFetch2()
6102Name
6103OCI FetCH2
6104Purpose
6105Fetches rows from a query.
6106Syntax
6107sword OCIStmtFetch2 ( OCIStmt *stmtp,
6108 OCIError *errhp,
6109 ub4 nrows,
6110 ub2 orientation,
6111 ub4 scrollOffset,
6112 ub4 mode);
6113Comments
6114The fetch call works similar to the OCIStmtFetch call with the
6115addition of the fetchOffset parameter. It can be used on any
6116statement handle, whether it is scrollable or not. For a
6117non-scrollable statement handle, the only acceptable value
6118will be OCI_FETCH_NEXT, and the fetchOffset parameter will be
6119ignored. Applications are encouraged to use this new call.
6120
6121A fetchOffset with OCI_FETCH_RELATIVE is equivalent to
6122OCI_FETCH_CURRENT with a value of 0, is equivalent to
6123OCI_FETCH_NEXT with a value of 1, and equivalent to
6124OCI_FETCH_PRIOR with a value of -1. Note that the range of
6125accessible rows is [1,OCI_ATTR_ROW_COUNT] beyond which an
6126error could be raised if sufficient rows do not exist in
6127
6128The fetch call is a local call, if prefetched rows suffice. However, this is
6129transparent to the application. If LOB columns are being read, LOB locators
6130are fetched for subsequent LOB operations to be performed on these locators.
6131Prefetching is turned off if LONG columns are involved.
6132A fetch with nrows set to 0 rows effectively cancels the fetch for this
6133statement.
6134Parameters
6135stmtp (IN) - a statement (application request) handle.
6136errhp (IN) - an error handle which can be passed to OCIErrorGet() for
6137diagnostic information in the event of an error.
6138nrows (IN) - number of rows to be fetched from the current position.
6139It defaults to 1 for orientation OCI_FETCH_LAST.
6140orientation (IN) - The acceptable values are as follows, with
6141OCI_FETCH_NEXT being the default value.
6142OCI_FETCH_CURRENT gets the current row,
6143OCI_FETCH_NEXT gets the next row from the current position,
6144OCI_FETCH_FIRST gets the first row in the result set,
6145OCI_FETCH_LAST gets the last row in the result set,
6146OCI_FETCH_PRIOR gets the previous row from the current row in the result set,
6147OCI_FETCH_ABSOLUTE will fetch the row number (specified by fetchOffset
6148parameter) in the result set using absolute positioning,
6149OCI_FETCH_RELATIVE will fetch the row number (specified by fetchOffset
6150parameter) in the result set using relative positioning.
6151scrollOffset(IN) - offset used with the OCI_FETCH_ABSOLUTE and
6152OCI_FETCH_RELATIVE orientation parameters only. It specify
6153the new current position for scrollable result set. It is
6154ignored for non-scrollable result sets.
6155mode (IN) - for release 8.0, beta-1, the following mode is defined.
6156OCI_DEFAULT - default mode
6157OCI_EOF_FETCH - indicates that it is the last fetch from the result set.
6158If nrows is non-zero, setting this mode effectively cancels fetching after
6159retrieving nrows, otherwise it cancels fetching immediately.
6160Related Functions
6161OCIAttrGet()
6162
6163
6164
6165OCIStmtGetPieceInfo()
6166Name
6167OCI Get Piece Information
6168Purpose
6169Returns piece information for a piecewise operation.
6170Syntax
6171sword OCIStmtGetPieceInfo( const OCIStmt *stmtp,
6172 OCIError *errhp,
6173 void **hndlpp,
6174 ub4 *typep,
6175 ub1 *in_outp,
6176 ub4 *iterp,
6177 ub4 *idxp,
6178 ub1 *piecep );
6179
6180Comments
6181When an execute/fetch call returns OCI_NEED_DATA to get/return a
6182dynamic bind/define value or piece, OCIStmtGetPieceInfo() returns the
6183relevant information: bind/define handle, iteration or index number and
6184which piece.
6185See the section "Runtime Data Allocation and Piecewise Operations" on page
61865-16 for more information about using OCIStmtGetPieceInfo().
6187Parameters
6188stmtp (IN) - the statement when executed returned OCI_NEED_DATA.
6189errhp (OUT) - an error handle which can be passed to OCIErrorGet() for
6190diagnostic information in the event of an error.
6191hndlpp (OUT) - returns a pointer to the bind or define handle of the bind or
6192define whose runtime data is required or is being provided.
6193typep (OUT) - the type of the handle pointed to by hndlpp: OCI_HTYPE_BIND
6194(for a bind handle) or OCI_HTYPE_DEFINE (for a define handle).
6195in_outp (OUT) - returns OCI_PARAM_IN if the data is required for an IN bind
6196value. Returns OCI_PARAM_OUT if the data is available as an OUT bind
6197variable or a define position value.
6198iterp (OUT) - returns the row number of a multiple row operation.
6199idxp (OUT) - the index of an array element of a PL/SQL array bind operation.
6200piecep (OUT) - returns one of the following defined values -
6201OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE and
6202OCI_LAST_PIECE. The default value is always OCI_ONE_PIECE.
6203Related Functions
6204OCIAttrGet(), OCIAttrGet(), OCIStmtExecute(), OCIStmtFetch(),
6205OCIStmtSetPieceInfo()
6206
6207
6208
6209
6210OCIStmtPrepare()
6211Name
6212OCI Statement REQuest
6213Purpose
6214This call defines the SQL/PLSQL statement to be executed.
6215Syntax
6216sword OCIStmtPrepare ( OCIStmt *stmtp,
6217 OCIError *errhp,
6218 const OraText *stmt,
6219 ub4 stmt_len,
6220 ub4 language,
6221 ub4 mode);
6222Comments
6223This call is used to prepare a SQL or PL/SQL statement for execution. The
6224OCIStmtPrepare() call defines an application request.
6225This is a purely local call. Data values for this statement initialized in
6226subsequent bind calls will be stored in a bind handle which will hang off this
6227statement handle.
6228This call does not create an association between this statement handle and any
6229particular server.
6230See the section "Preparing Statements" on page 2-21 for more information
6231about using this call.
6232Parameters
6233stmtp (IN) - a statement handle.
6234errhp (IN) - an error handle to retrieve diagnostic information.
6235stmt (IN) - SQL or PL/SQL statement to be executed. Must be a null-terminated
6236string. The pointer to the OraText of the statement must be available as long
6237as the statement is executed.
6238stmt_len (IN) - length of the statement. Must not be zero.
6239language (IN) - V7, V8, or native syntax. Possible values are:
6240OCI_V7_SYNTAX - V7 ORACLE parsing syntax
6241OCI_V8_SYNTAX - V8 ORACLE parsing syntax
6242OCI_NTV_SYNTAX - syntax depending upon the version of the server.
6243mode (IN) - the only defined mode is OCI_DEFAULT for default mode.
6244Example
6245This example demonstrates the use of OCIStmtPrepare(), as well as the OCI
6246application initialization calls.
6247Related Functions
6248OCIAttrGet(), OCIStmtExecute()
6249
6250
6251OCIStmtPrepare2()
6252Name
6253OCI Statement REQuest with (a) early binding to svchp and/or
6254(b) stmt caching
6255Purpose
6256This call defines the SQL/PLSQL statement to be executed.
6257Syntax
6258sword OCIStmtPrepare2 ( OCISvcCtx *svchp,
6259 OCIStmt **stmtp,
6260 OCIError *errhp,
6261 const OraText *stmt,
6262 ub4 stmt_len,
6263 const OraText *key,
6264 ub4 key_len,
6265 ub4 language,
6266 ub4 mode);
6267Comments
6268This call is used to prepare a SQL or PL/SQL statement for execution. The
6269OCIStmtPrepare() call defines an application request.
6270This is a purely local call. Data values for this statement initialized in
6271subsequent bind calls will be stored in a bind handle which will hang off this
6272statement handle.
6273This call creates an association between the statement handle and a service
6274context. It differs from OCIStmtPrepare in that respect.It also supports
6275stmt caching. The stmt will automatically be cached if the authp of the stmt
6276has enabled stmt caching.
6277Parameters
6278svchp (IN) - the service context handle that contains the session that
6279 this stmt handle belongs to.
6280stmtp (OUT) - an unallocated stmt handle must be pased in. An allocated
6281 and prepared statement handle will be returned.
6282errhp (IN) - an error handle to retrieve diagnostic information.
6283stmt (IN) - SQL or PL/SQL statement to be executed. Must be a null-
6284 terminated string. The pointer to the OraText of the statement
6285 must be available as long as the statement is executed.
6286stmt_len (IN) - length of the statement. Must not be zero.
6287key (IN) - This is only Valid for OCI Stmt Caching. It indicates the
6288 key to search with. It thus optimizes the search in the cache.
6289key_len (IN) - the length of the key. This, too, is onlly valid for stmt
6290 caching.
6291language (IN) - V7, V8, or native syntax. Possible values are:
6292OCI_V7_SYNTAX - V7 ORACLE parsing syntax
6293OCI_V8_SYNTAX - V8 ORACLE parsing syntax
6294OCI_NTV_SYNTAX - syntax depending upon the version of the server.
6295mode (IN) - the defined modes are OCI_DEFAULT and OCI_PREP2_CACHE_SEARCHONLY.
6296Example
6297Related Functions
6298OCIStmtExecute(), OCIStmtRelease()
6299
6300
6301OCIStmtRelease()
6302Name
6303OCI Statement Release. This call is used to relesae the stmt that
6304was retreived using OCIStmtPrepare2(). If the stmt is release
6305using this call, OCIHandleFree() must not be called on the stmt
6306handle.
6307Purpose
6308This call releases the statement obtained by OCIStmtPrepare2
6309Syntax
6310sword OCIStmtRelease ( OCIStmt *stmtp,
6311 OCIError *errhp,
6312 cONST OraText *key,
6313 ub4 key_len,
6314 ub4 mode);
6315Comments
6316This call is used to release a handle obtained via OCIStmtPrepare2().
6317It also frees the memory associated with the handle.
6318This is a purely local call.
6319Parameters
6320stmtp (IN/OUT) - The statement handle to be released/freed.
6321errhp (IN) - an error handle to retrieve diagnostic information.
6322key (IN) - This is only Valid for OCI Stmt Caching. It indicates the
6323 key to tag the stmt with.
6324key_len (IN) - the length of the key. This, too, is only valid for stmt
6325 caching.
6326mode (IN) - the defined modes are OCI_DEFAULT for default mode and
6327 OCI_STRLS_CACHE_DELETE (only used for Stmt Caching).
6328Example
6329Related Functions
6330OCIStmtExecute(), OCIStmtPrepare2()
6331
6332
6333OCIStmtSetPieceInfo()
6334Name
6335OCI Set Piece Information
6336Purpose
6337Sets piece information for a piecewise operation.
6338Syntax
6339sword OCIStmtSetPieceInfo ( void *hndlp,
6340 ub4 type,
6341 OCIError *errhp,
6342 const void *bufp,
6343 ub4 *alenp,
6344 ub1 piece,
6345 const void *indp,
6346 ub2 *rcodep );
6347Comments
6348When an execute call returns OCI_NEED_DATA to get a dynamic IN/OUT
6349bind value or piece, OCIStmtSetPieceInfo() sets the piece information: the
6350buffer, the length, the indicator and which piece is currently being processed.
6351For more information about using OCIStmtSetPieceInfo() see the section
6352"Runtime Data Allocation and Piecewise Operations" on page 5-16.
6353Parameters
6354hndlp (IN/OUT) - the bind/define handle.
6355type (IN) - type of the handle.
6356errhp (OUT) - an error handle which can be passed to OCIErrorGet() for
6357diagnostic information in the event of an error.
6358bufp (IN/OUT) - bufp is a pointer to a storage containing the data value or
6359the piece when it is an IN bind variable, otherwise bufp is a pointer to
6360storage for getting a piece or a value for OUT binds and define variables. For
6361named data types or REFs, a pointer to the object or REF is returned.
6362alenp (IN/OUT) - the length of the piece or the value.
6363piece (IN) - the piece parameter. The following are valid values:
6364OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE, or
6365OCI_LAST_PIECE.
6366The default value is OCI_ONE_PIECE. This parameter is used for IN bind
6367variables only.
6368indp (IN/OUT) - indicator. A pointer to a sb2 value or pointer to an indicator
6369structure for named data types (SQLT_NTY) and REFs (SQLT_REF), i.e., *indp
6370is either an sb2 or a void * depending upon the data type.
6371rcodep (IN/OUT) - return code.
6372Related Functions
6373OCIAttrGet(), OCIAttrGet(), OCIStmtExecute(), OCIStmtFetch(),
6374OCIStmtGetPieceInfo()
6375
6376
6377OCIFormatInit
6378Name
6379OCIFormat Package Initialize
6380Purpose
6381Initializes the OCIFormat package.
6382Syntax
6383sword OCIFormatInit(void *hndl, OCIError *err);
6384Comments
6385This routine must be called before calling any other OCIFormat routine.
6386Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
6387Parameters
6388hndl (IN/OUT) - OCI environment or session handle
6389err (IN/OUT) - OCI error handle
6390Related Functions
6391OCIFormatTerm()
6392
6393
6394OCIFormatString
6395Name
6396OCIFormat Package Format String
6397Purpose
6398Writes a text string into the supplied text buffer using the argument
6399list submitted to it and in accordance with the format string given.
6400Syntax
6401sword OCIFormatString(void *hndl, OCIError *err, OraText *buffer,
6402 sbig_ora bufferLength, sbig_ora *returnLength,
6403 const OraText *formatString, ...);
6404Comments
6405The first call to this routine must be preceded by a call to the
6406OCIFormatInit routine that initializes the OCIFormat package
6407for use. When this routine is no longer needed then terminate
6408the OCIFormat package by a call to the OCIFormatTerm routine.
6409Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
6410Parameters
6411hndl (IN/OUT) - OCI environment or session handle
6412err (IN/OUT) - OCI error handle
6413buffer (OUT) - text buffer for the string
6414bufferLength (IN) - length of the text buffer
6415returnLength (OUT) - length of the formatted string
6416formatString (IN) - format specification string
6417... (IN) - variable argument list
6418Related Functions
6419
6420
6421OCIFormatTerm
6422Name
6423OCIFormat Package Terminate
6424Purpose
6425Terminates the OCIFormat package.
6426Syntax
6427sword OCIFormatTerm(void *hndl, OCIError *err);
6428Comments
6429It must be called after the OCIFormat package is no longer being used.
6430Returns OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
6431Parameters
6432hndl (IN/OUT) - OCI environment or session handle
6433err (IN/OUT) - OCI error handle
6434Related Functions
6435OCIFormatInit()
6436
6437
6438OCIFormatTUb1
6439Name
6440OCIFormat Package ub1 Type
6441Purpose
6442Return the type value for the ub1 type.
6443Syntax
6444sword OCIFormatTUb1(void);
6445Comments
6446None
6447Parameters
6448None
6449Related Functions
6450None
6451
6452
6453OCIFormatTUb2
6454Name
6455OCIFormat Package ub2 Type
6456Purpose
6457Return the type value for the ub2 type.
6458Syntax
6459sword OCIFormatTUb2(void);
6460Comments
6461None
6462Parameters
6463None
6464Related Functions
6465None
6466
6467
6468OCIFormatTUb4
6469Name
6470OCIFormat Package ub4 Type
6471Purpose
6472Return the type value for the ub4 type.
6473Syntax
6474sword OCIFormatTUb4(void);
6475Comments
6476None
6477Parameters
6478None
6479Related Functions
6480None
6481
6482
6483OCIFormatTUword
6484Name
6485OCIFormat Package uword Type
6486Purpose
6487Return the type value for the uword type.
6488Syntax
6489sword OCIFormatTUword(void);
6490Comments
6491None
6492Parameters
6493None
6494Related Functions
6495None
6496
6497
6498OCIFormatTUbig_ora
6499Name
6500OCIFormat Package ubig_ora Type
6501Purpose
6502Return the type value for the ubig_ora type.
6503Syntax
6504sword OCIFormatTUbig_ora(void);
6505Comments
6506None
6507Parameters
6508None
6509Related Functions
6510None
6511
6512
6513OCIFormatTSb1
6514Name
6515OCIFormat Package sb1 Type
6516Purpose
6517Return the type value for the sb1 type.
6518Syntax
6519sword OCIFormatTSb1(void);
6520Comments
6521None
6522Parameters
6523None
6524Related Functions
6525None
6526
6527
6528OCIFormatTSb2
6529Name
6530OCIFormat Package sb2 Type
6531Purpose
6532Return the type value for the sb2 type.
6533Syntax
6534sword OCIFormatTSb2(void);
6535Comments
6536None
6537Parameters
6538None
6539Related Functions
6540None
6541
6542
6543OCIFormatTSb4
6544Name
6545OCIFormat Package sb4 Type
6546Purpose
6547Return the type value for the sb4 type.
6548Syntax
6549sword OCIFormatTSb4(void);
6550Comments
6551None
6552Parameters
6553None
6554Related Functions
6555None
6556
6557
6558OCIFormatTSword
6559Name
6560OCIFormat Package sword Type
6561Purpose
6562Return the type value for the sword type.
6563Syntax
6564sword OCIFormatTSword(void);
6565Comments
6566None
6567Parameters
6568None
6569Related Functions
6570None
6571
6572
6573OCIFormatTSbig_ora
6574Name
6575OCIFormat Package sbig_ora Type
6576Purpose
6577Return the type value for the sbig_ora type.
6578Syntax
6579sword OCIFormatTSbig_ora(void);
6580Comments
6581None
6582Parameters
6583None
6584Related Functions
6585None
6586
6587
6588OCIFormatTEb1
6589Name
6590OCIFormat Package eb1 Type
6591Purpose
6592Return the type value for the eb1 type.
6593Syntax
6594sword OCIFormatTEb1(void);
6595Comments
6596None
6597Parameters
6598None
6599Related Functions
6600None
6601
6602
6603OCIFormatTEb2
6604Name
6605OCIFormat Package eb2 Type
6606Purpose
6607Return the type value for the eb2 type.
6608Syntax
6609sword OCIFormatTEb2(void);
6610Comments
6611None
6612Parameters
6613None
6614Related Functions
6615None
6616
6617
6618OCIFormatTEb4
6619Name
6620OCIFormat Package eb4 Type
6621Purpose
6622Return the type value for the eb4 type.
6623Syntax
6624sword OCIFormatTEb4(void);
6625Comments
6626None
6627Parameters
6628None
6629Related Functions
6630None
6631
6632
6633OCIFormatTEword
6634Name
6635OCIFormat Package eword Type
6636Purpose
6637Return the type value for the eword type.
6638Syntax
6639sword OCIFormatTEword(void);
6640Comments
6641None
6642Parameters
6643None
6644Related Functions
6645None
6646
6647
6648OCIFormatTChar
6649Name
6650OCIFormat Package text Type
6651Purpose
6652Return the type value for the text type.
6653Syntax
6654sword OCIFormatTChar(void);
6655Comments
6656None
6657Parameters
6658None
6659Related Functions
6660None
6661
6662
6663OCIFormatTText
6664Name
6665OCIFormat Package *text Type
6666Purpose
6667Return the type value for the *text type.
6668Syntax
6669sword OCIFormatTText(void);
6670Comments
6671None
6672Parameters
6673None
6674Related Functions
6675None
6676
6677
6678OCIFormatTDouble
6679Name
6680OCIFormat Package double Type
6681Purpose
6682Return the type value for the double type.
6683Syntax
6684sword OCIFormatTDouble(void);
6685Comments
6686None
6687Parameters
6688None
6689Related Functions
6690None
6691
6692
6693OCIFormatDvoid
6694Name
6695OCIFormat Package void Type
6696Purpose
6697Return the type value for the void type.
6698Syntax
6699sword OCIFormatTDvoid(void);
6700Comments
6701None
6702Parameters
6703None
6704Related Functions
6705None
6706
6707
6708OCIFormatTEnd
6709Name
6710OCIFormat Package end Type
6711Purpose
6712Return the list terminator's "type".
6713Syntax
6714sword OCIFormatTEnd(void);
6715Comments
6716None
6717Parameters
6718None
6719Related Functions
6720None
6721
6722
6723OCISvcCtxToLda()
6724Name
6725OCI toggle SerVice context handle to Version 7 Lda_Def
6726Purpose
6727Toggles between a V8 service context handle and a V7 Lda_Def.
6728Syntax
6729sword OCISvcCtxToLda ( OCISvcCtx *srvhp,
6730 OCIError *errhp,
6731 Lda_Def *ldap );
6732Comments
6733Toggles between an Oracle8 service context handle and an Oracle7 Lda_Def.
6734This function can only be called after a service context has been properly
6735initialized.
6736Once the service context has been translated to an Lda_Def, it can be used in
6737release 7.x OCI calls (e.g., obindps(), ofen()).
6738Note: If there are multiple service contexts which share the same server
6739handle, only one can be in V7 mode at any time.
6740The action of this call can be reversed by passing the resulting Lda_Def to
6741the OCILdaToSvcCtx() function.
6742Parameters
6743svchp (IN/OUT) - the service context handle.
6744errhp (IN/OUT) - an error handle which can be passed to OCIErrorGet() for
6745diagnostic information in the event of an error.
6746ldap (IN/OUT) - a Logon Data Area for V7-style OCI calls which is initialized
6747by this call.
6748Related Functions
6749OCILdaToSvcCtx()
6750
6751
6752
6753
6754OCITransCommit()
6755Name
6756OCI TX (transaction) CoMmit
6757Purpose
6758Commits the transaction associated with a specified service context.
6759Syntax
6760sword OCITransCommit ( OCISvcCtx *srvcp,
6761 OCIError *errhp,
6762 ub4 flags );
6763Comments
6764The transaction currently associated with the service context is committed. If
6765it is a distributed transaction that the server cannot commit, this call
6766additionally retrieves the state of the transaction from the database to be
6767returned to the user in the error handle.
6768If the application has defined multiple transactions, this function operates
6769on the transaction currently associated with the service context. If the
6770application is working with only the implicit local transaction created when
6771database changes are made, that implicit transaction is committed.
6772If the application is running in the object mode, then the modified or updated
6773objects in the object cache for this transaction are also committed.
6774The flags parameter is used for one-phase commit optimization in distributed
6775transactions. If the transaction is non-distributed, the flags parameter is
6776ignored, and OCI_DEFAULT can be passed as its value. OCI applications
6777managing global transactions should pass a value of
6778OCI_TRANS_TWOPHASE to the flags parameter for a two-phase commit. The
6779default is one-phase commit.
6780Under normal circumstances, OCITransCommit() returns with a status
6781indicating that the transaction has either been committed or rolled back. With
6782distributed transactions, it is possible that the transaction is now in-doubt
6783(i.e., neither committed nor aborted). In this case, OCITransCommit()
6784attempts to retrieve the status of the transaction from the server.
6785The status is returned.
6786Parameters
6787srvcp (IN) - the service context handle.
6788errhp (IN) - an error handle which can be passed to OCIErrorGet() for
6789diagnostic information in the event of an error.
6790flags -see the "Comments" section above.
6791Related Functions
6792OCITransRollback()
6793
6794
6795
6796
6797OCITransDetach()
6798Name
6799OCI TX (transaction) DeTach
6800Purpose
6801Detaches a transaction.
6802Syntax
6803sword OCITransDetach ( OCISvcCtx *srvcp,
6804 OCIError *errhp,
6805 ub4 flags);
6806Comments
6807Detaches a global transaction from the service context handle. The transaction
6808currently attached to the service context handle becomes inactive at the end
6809of this call. The transaction may be resumed later by calling OCITransStart(),
6810specifying a flags value of OCI_TRANS_RESUME.
6811When a transaction is detached, the value which was specified in the timeout
6812parameter of OCITransStart() when the transaction was started is used to
6813determine the amount of time the branch can remain inactive before being
6814deleted by the server's PMON process.
6815Note: The transaction can be resumed by a different process than the one
6816that detached it, provided that the transaction has the same
6817authorization.
6818Parameters
6819srvcp (IN) - the service context handle.
6820errhp (IN) - an error handle which can be passed to OCIErrorGet() for
6821diagnostic information in the event of an error.
6822flags (IN) - you must pass a value of OCI_DEFAULT for this parameter.
6823Related Functions
6824OCITransStart()
6825
6826
6827
6828OCITransForget()
6829Name
6830OCI TX (transaction) ForGeT
6831Purpose
6832Causes the server to forget a heuristically completed global transaction.
6833Syntax
6834sword OCITransForget ( OCISvcCtx *svchp,
6835 OCIError *errhp,
6836 ub4 flags);
6837
6838Comments
6839
6840Forgets a heuristically completed global transaction. The server deletes the
6841status of the transaction from the system's pending transaction table.
6842The XID of the transaction to be forgotten is set as an attribute of the
6843transaction handle (OCI_ATTR_XID).
6844Parameters
6845srvcp (IN) - the service context handle - the transaction is rolled back.
6846errhp (IN) - an error handle which can be passed to OCIErrorGet() for
6847diagnostic information in the event of an error.
6848flags (IN) - you must pass OCI_DEFAULT for this parameter.
6849Related Functions
6850OCITransCommit(), OCITransRollback()
6851
6852
6853OCITransMultiPrepare()
6854Name
6855OCI Trans(action) Multi-Branch Prepare
6856Purpose
6857Prepares a transaction with multiple branches in a single call.
6858Syntax
6859sword OCITransMultiPrepare ( OCISvcCtx *svchp,
6860 ub4 numBranches,
6861 OCITrans **txns,
6862 OCIError **errhp);
6863
6864Comments
6865
6866Prepares the specified global transaction for commit.
6867This call is valid only for distributed transactions.
6868This call is an advanced performance feature intended for use only in
6869situations where the caller is responsible for preparing all the branches
6870in a transaction.
6871Parameters
6872srvcp (IN) - the service context handle.
6873numBranches (IN) - This is the number of branches expected. It is also the
6874array size for the next two parameters.
6875txns (IN) - This is the array of transaction handles for the branches to
6876prepare. They should all have the OCI_ATTR_XID set. The global transaction
6877ID should be the same.
6878errhp (IN) - This is the array of error handles. If OCI_SUCCESS is not
6879returned, then these will indicate which branches received which errors.
6880Related Functions
6881OCITransPrepare()
6882
6883
6884OCITransPrepare()
6885Name
6886OCI TX (transaction) PREpare
6887Purpose
6888Prepares a transaction for commit.
6889Syntax
6890sword OCITransPrepare ( OCISvcCtx *svchp,
6891 OCIError *errhp,
6892 ub4 flags);
6893
6894Comments
6895
6896Prepares the specified global transaction for commit.
6897This call is valid only for distributed transactions.
6898The call returns OCI_SUCCESS_WITH_INFO if the transaction has not made
6899any changes. The error handle will indicate that the transaction is read-only.
6900The flag parameter is not currently used.
6901Parameters
6902srvcp (IN) - the service context handle.
6903errhp (IN) - an error handle which can be passed to OCIErrorGet() for
6904diagnostic information in the event of an error.
6905flags (IN) - you must pass OCI_DEFAULT for this parameter.
6906Related Functions
6907OCITransCommit(), OCITransForget()
6908
6909
6910
6911
6912OCITransRollback()
6913Name
6914OCI TX (transaction) RoLlback
6915Purpose
6916Rolls back the current transaction.
6917Syntax
6918sword OCITransRollback ( void *svchp,
6919 OCIError *errhp,
6920 ub4 flags );
6921Comments
6922The current transaction- defined as the set of statements executed since the
6923last OCITransCommit() or since OCISessionBegin()-is rolled back.
6924If the application is running under object mode then the modified or updated
6925objects in the object cache for this transaction are also rolled back.
6926An error is returned if an attempt is made to roll back a global transaction
6927that is not currently active.
6928Parameters
6929svchp (IN) - a service context handle. The transaction currently set in the
6930service context handle is rolled back.
6931errhp -(IN) - an error handle which can be passed to OCIErrorGet() for
6932diagnostic information in the event of an error.
6933flags - you must pass a value of OCI_DEFAULT for this parameter.
6934Related Functions
6935OCITransCommit()
6936
6937
6938
6939
6940OCITransStart()
6941Name
6942OCI TX (transaction) STart
6943Purpose
6944Sets the beginning of a transaction.
6945Syntax
6946sword OCITransStart ( OCISvcCtx *svchp,
6947 OCIError *errhp,
6948 uword timeout,
6949 ub4 flags);
6950
6951Comments
6952This function sets the beginning of a global or serializable transaction. The
6953transaction context currently associated with the service context handle is
6954initialized at the end of the call if the flags parameter specifies that a new
6955transaction should be started.
6956The XID of the transaction is set as an attribute of the transaction handle
6957(OCI_ATTR_XID)
6958Parameters
6959svchp (IN/OUT) - the service context handle. The transaction context in the
6960service context handle is initialized at the end of the call if the flag
6961specified a new transaction to be started.
6962errhp (IN/OUT) - The OCI error handle. If there is an error, it is recorded in
6963err and this function returns OCI_ERROR. Diagnostic information can be
6964obtained by calling OCIErrorGet().
6965timeout (IN) - the time, in seconds, to wait for a transaction to become
6966available for resumption when OCI_TRANS_RESUME is specified. When
6967OCI_TRANS_NEW is specified, this value is stored and may be used later by
6968OCITransDetach().
6969flags (IN) - specifies whether a new transaction is being started or an
6970existing transaction is being resumed. Also specifies serializiability or
6971read-only status. More than a single value can be specified. By default,
6972a read/write transaction is started. The flag values are:
6973OCI_TRANS_NEW - starts a new transaction branch. By default starts a
6974tightly coupled and migratable branch.
6975OCI_TRANS_TIGHT - explicitly specifies a tightly coupled branch
6976OCI_TRANS_LOOSE - specifies a loosely coupled branch
6977OCI_TRANS_RESUME - resumes an existing transaction branch.
6978OCI_TRANS_READONLY - start a readonly transaction
6979OCI_TRANS_SERIALIZABLE - start a serializable transaction
6980Related Functions
6981OCITransDetach()
6982
6983
6984
6985
6986
6987******************************************************************************/
6988/*-----------------------Dynamic Callback Function Pointers------------------*/
6989
6990
6991typedef sb4 (*OCICallbackInBind)(void *ictxp, OCIBind *bindp, ub4 iter,
6992 ub4 index, void **bufpp, ub4 *alenp,
6993 ub1 *piecep, void **indp);
6994
6995typedef sb4 (*OCICallbackOutBind)(void *octxp, OCIBind *bindp, ub4 iter,
6996 ub4 index, void **bufpp, ub4 **alenp,
6997 ub1 *piecep, void **indp,
6998 ub2 **rcodep);
6999
7000typedef sb4 (*OCICallbackDefine)(void *octxp, OCIDefine *defnp, ub4 iter,
7001 void **bufpp, ub4 **alenp, ub1 *piecep,
7002 void **indp, ub2 **rcodep);
7003
7004typedef sword (*OCIUserCallback)(void *ctxp, void *hndlp, ub4 type,
7005 ub4 fcode, ub4 when, sword returnCode,
7006 sb4 *errnop, va_list arglist);
7007
7008typedef sword (*OCIEnvCallbackType)(OCIEnv *env, ub4 mode,
7009 size_t xtramem_sz, void *usrmemp,
7010 OCIUcb *ucbDesc);
7011
7012typedef sb4 (*OCICallbackLobRead)(void *ctxp, const void *bufp,
7013 ub4 len, ub1 piece);
7014
7015typedef sb4 (*OCICallbackLobWrite)(void *ctxp, void *bufp,
7016 ub4 *lenp, ub1 *piece);
7017
7018#ifdef ORAXB8_DEFINED
7019
7020typedef sb4 (*OCICallbackLobRead2)(void *ctxp, const void *bufp, oraub8 len,
7021 ub1 piece, void **changed_bufpp,
7022 oraub8 *changed_lenp);
7023
7024typedef sb4 (*OCICallbackLobWrite2)(void *ctxp, void *bufp, oraub8 *lenp,
7025 ub1 *piece, void **changed_bufpp,
7026 oraub8 *changed_lenp);
7027
7028typedef sb4 (*OCICallbackLobArrayRead)(void *ctxp, ub4 array_iter,
7029 const void *bufp, oraub8 len,
7030 ub1 piece, void **changed_bufpp,
7031 oraub8 *changed_lenp);
7032
7033typedef sb4 (*OCICallbackLobArrayWrite)(void *ctxp, ub4 array_iter,
7034 void *bufp, oraub8 *lenp,
7035 ub1 *piece, void **changed_bufpp,
7036 oraub8 *changed_lenp);
7037#endif
7038
7039typedef sb4 (*OCICallbackLobGetDeduplicateRegions)(void *ctxp,
7040 OCILobRegion *regions,
7041 ub4 count, ub1 piece,
7042 OCILobRegion **changed_reg,
7043 ub4 *changed_count);
7044
7045typedef sb4 (*OCICallbackAQEnq)(void *ctxp, void **payload,
7046 void **payload_ind);
7047
7048typedef sb4 (*OCICallbackAQEnqStreaming)(void *ctxp, void **payload,
7049 void **payload_ind,
7050 OCIAQMsgProperties **msgprop,
7051 OCIType **tdo);
7052
7053typedef sb4 (*OCICallbackAQDeq)(void *ctxp, void **payload,
7054 void **payload_ind);
7055
7056/*--------------------------Failover Callback Structure ---------------------*/
7057typedef sb4 (*OCICallbackFailover)(void *svcctx, void *envctx,
7058 void *fo_ctx, ub4 fo_type,
7059 ub4 fo_event);
7060
7061typedef struct
7062{
7063 OCICallbackFailover callback_function;
7064 void *fo_ctx;
7065}
7066OCIFocbkStruct;
7067
7068/*---------------------Statement Cache callback function ------------------*/
7069
7070typedef sword (*OCICallbackStmtCache)(void *ctx, OCIStmt *stmt, ub4 mode);
7071
7072/*--------------------------HA Callback Structure ---------------------*/
7073typedef void (*OCIEventCallback)(void *evtctx, OCIEvent *eventhp);
7074
7075
7076/*------------------------- Round Trip Callback Structure --------------------*/
7077typedef sword (*OCIRoundTripCallback)(void *rtctx, OCISvcCtx *svch,
7078 OCISession *userh);
7079
7080
7081/*****************************************************************************
7082 ACTUAL PROTOTYPE DECLARATIONS
7083******************************************************************************/
7084
7085sword OCIInitialize (ub4 mode, void *ctxp,
7086 void *(*malocfp)(void *ctxp, size_t size),
7087 void *(*ralocfp)(void *ctxp, void *memptr, size_t newsize),
7088 void (*mfreefp)(void *ctxp, void *memptr) );
7089
7090sword OCITerminate( ub4 mode);
7091
7092sword OCIEnvCreate (OCIEnv **envp, ub4 mode, void *ctxp,
7093 void *(*malocfp)(void *ctxp, size_t size),
7094 void *(*ralocfp)(void *ctxp, void *memptr, size_t newsize),
7095 void (*mfreefp)(void *ctxp, void *memptr),
7096 size_t xtramem_sz, void **usrmempp);
7097
7098sword OCIEnvNlsCreate (OCIEnv **envp, ub4 mode, void *ctxp,
7099 void *(*malocfp)(void *ctxp, size_t size),
7100 void *(*ralocfp)(void *ctxp, void *memptr, size_t newsize),
7101 void (*mfreefp)(void *ctxp, void *memptr),
7102 size_t xtramem_sz, void **usrmempp,
7103 ub2 charset, ub2 ncharset);
7104
7105sword OCIFEnvCreate (OCIEnv **envp, ub4 mode, void *ctxp,
7106 void *(*malocfp)(void *ctxp, size_t size),
7107 void *(*ralocfp)(void *ctxp, void *memptr, size_t newsize),
7108 void (*mfreefp)(void *ctxp, void *memptr),
7109 size_t xtramem_sz, void **usrmempp, void *fupg);
7110
7111sword OCIHandleAlloc(const void *parenth, void **hndlpp, const ub4 type,
7112 const size_t xtramem_sz, void **usrmempp);
7113
7114sword OCIHandleFree(void *hndlp, const ub4 type);
7115
7116
7117sword OCIDescriptorAlloc(const void *parenth, void **descpp,
7118 const ub4 type, const size_t xtramem_sz,
7119 void **usrmempp);
7120
7121sword OCIArrayDescriptorAlloc(const void *parenth, void **descpp,
7122 const ub4 type, ub4 array_size,
7123 const size_t xtramem_sz, void **usrmempp);
7124
7125sword OCIDescriptorFree(void *descp, const ub4 type);
7126
7127sword OCIArrayDescriptorFree(void **descp, const ub4 type);
7128
7129sword OCIEnvInit (OCIEnv **envp, ub4 mode,
7130 size_t xtramem_sz, void **usrmempp);
7131
7132sword OCIServerAttach (OCIServer *srvhp, OCIError *errhp,
7133 const OraText *dblink, sb4 dblink_len, ub4 mode);
7134
7135sword OCIServerDetach (OCIServer *srvhp, OCIError *errhp, ub4 mode);
7136
7137sword OCISessionBegin (OCISvcCtx *svchp, OCIError *errhp, OCISession *usrhp,
7138 ub4 credt, ub4 mode);
7139
7140sword OCISessionEnd (OCISvcCtx *svchp, OCIError *errhp, OCISession *usrhp,
7141 ub4 mode);
7142
7143sword OCILogon (OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp,
7144 const OraText *username, ub4 uname_len,
7145 const OraText *password, ub4 passwd_len,
7146 const OraText *dbname, ub4 dbname_len);
7147
7148sword OCILogon2 (OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp,
7149 const OraText *username, ub4 uname_len,
7150 const OraText *password, ub4 passwd_len,
7151 const OraText *dbname, ub4 dbname_len,
7152 ub4 mode);
7153
7154sword OCILogoff (OCISvcCtx *svchp, OCIError *errhp);
7155
7156
7157sword OCIPasswordChange (OCISvcCtx *svchp, OCIError *errhp,
7158 const OraText *user_name, ub4 usernm_len,
7159 const OraText *opasswd, ub4 opasswd_len,
7160 const OraText *npasswd, ub4 npasswd_len,
7161 ub4 mode);
7162
7163sword OCIStmtPrepare (OCIStmt *stmtp, OCIError *errhp, const OraText *stmt,
7164 ub4 stmt_len, ub4 language, ub4 mode);
7165
7166sword OCIStmtPrepare2 ( OCISvcCtx *svchp, OCIStmt **stmtp, OCIError *errhp,
7167 const OraText *stmt, ub4 stmt_len, const OraText *key,
7168 ub4 key_len, ub4 language, ub4 mode);
7169
7170sword OCIStmtRelease ( OCIStmt *stmtp, OCIError *errhp, const OraText *key,
7171 ub4 key_len, ub4 mode);
7172
7173sword OCIBindByPos (OCIStmt *stmtp, OCIBind **bindp, OCIError *errhp,
7174 ub4 position, void *valuep, sb4 value_sz,
7175 ub2 dty, void *indp, ub2 *alenp, ub2 *rcodep,
7176 ub4 maxarr_len, ub4 *curelep, ub4 mode);
7177
7178sword OCIBindByName (OCIStmt *stmtp, OCIBind **bindp, OCIError *errhp,
7179 const OraText *placeholder, sb4 placeh_len,
7180 void *valuep, sb4 value_sz, ub2 dty,
7181 void *indp, ub2 *alenp, ub2 *rcodep,
7182 ub4 maxarr_len, ub4 *curelep, ub4 mode);
7183
7184sword OCIBindObject (OCIBind *bindp, OCIError *errhp, const OCIType *type,
7185 void **pgvpp, ub4 *pvszsp, void **indpp,
7186 ub4 *indszp);
7187
7188sword OCIBindDynamic (OCIBind *bindp, OCIError *errhp, void *ictxp,
7189 OCICallbackInBind icbfp, void *octxp,
7190 OCICallbackOutBind ocbfp);
7191
7192sword OCIBindArrayOfStruct (OCIBind *bindp, OCIError *errhp,
7193 ub4 pvskip, ub4 indskip,
7194 ub4 alskip, ub4 rcskip);
7195
7196sword OCIStmtGetPieceInfo (OCIStmt *stmtp, OCIError *errhp,
7197 void **hndlpp, ub4 *typep,
7198 ub1 *in_outp, ub4 *iterp, ub4 *idxp,
7199 ub1 *piecep);
7200
7201sword OCIStmtSetPieceInfo (void *hndlp, ub4 type, OCIError *errhp,
7202 const void *bufp, ub4 *alenp, ub1 piece,
7203 const void *indp, ub2 *rcodep);
7204
7205sword OCIStmtExecute (OCISvcCtx *svchp, OCIStmt *stmtp, OCIError *errhp,
7206 ub4 iters, ub4 rowoff, const OCISnapshot *snap_in,
7207 OCISnapshot *snap_out, ub4 mode);
7208
7209sword OCIDefineByPos (OCIStmt *stmtp, OCIDefine **defnp, OCIError *errhp,
7210 ub4 position, void *valuep, sb4 value_sz, ub2 dty,
7211 void *indp, ub2 *rlenp, ub2 *rcodep, ub4 mode);
7212
7213sword OCIDefineObject (OCIDefine *defnp, OCIError *errhp,
7214 const OCIType *type, void **pgvpp,
7215 ub4 *pvszsp, void **indpp, ub4 *indszp);
7216
7217sword OCIDefineDynamic (OCIDefine *defnp, OCIError *errhp, void *octxp,
7218 OCICallbackDefine ocbfp);
7219
7220sword OCIRowidToChar (OCIRowid *rowidDesc, OraText *outbfp, ub2 *outbflp,
7221 OCIError *errhp);
7222
7223sword OCIDefineArrayOfStruct (OCIDefine *defnp, OCIError *errhp, ub4 pvskip,
7224 ub4 indskip, ub4 rlskip, ub4 rcskip);
7225
7226sword OCIStmtFetch (OCIStmt *stmtp, OCIError *errhp, ub4 nrows,
7227 ub2 orientation, ub4 mode);
7228
7229sword OCIStmtFetch2 (OCIStmt *stmtp, OCIError *errhp, ub4 nrows,
7230 ub2 orientation, sb4 scrollOffset, ub4 mode);
7231
7232sword OCIStmtGetBindInfo (OCIStmt *stmtp, OCIError *errhp, ub4 size,
7233 ub4 startloc,
7234 sb4 *found, OraText *bvnp[], ub1 bvnl[],
7235 OraText *invp[], ub1 inpl[], ub1 dupl[],
7236 OCIBind **hndl);
7237
7238sword OCIDescribeAny (OCISvcCtx *svchp, OCIError *errhp,
7239 void *objptr,
7240 ub4 objnm_len, ub1 objptr_typ, ub1 info_level,
7241 ub1 objtyp, OCIDescribe *dschp);
7242
7243sword OCIParamGet (const void *hndlp, ub4 htype, OCIError *errhp,
7244 void **parmdpp, ub4 pos);
7245
7246sword OCIParamSet(void *hdlp, ub4 htyp, OCIError *errhp, const void *dscp,
7247 ub4 dtyp, ub4 pos);
7248
7249sword OCITransStart (OCISvcCtx *svchp, OCIError *errhp,
7250 uword timeout, ub4 flags );
7251
7252sword OCITransDetach (OCISvcCtx *svchp, OCIError *errhp, ub4 flags );
7253
7254sword OCITransCommit (OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
7255
7256sword OCITransRollback (OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
7257
7258sword OCITransPrepare (OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
7259
7260sword OCITransMultiPrepare (OCISvcCtx *svchp, ub4 numBranches,
7261 OCITrans **txns, OCIError **errhp);
7262
7263sword OCITransForget (OCISvcCtx *svchp, OCIError *errhp, ub4 flags);
7264
7265sword OCIErrorGet (void *hndlp, ub4 recordno, OraText *sqlstate,
7266 sb4 *errcodep, OraText *bufp, ub4 bufsiz, ub4 type);
7267
7268sword OCILobAppend (OCISvcCtx *svchp, OCIError *errhp,
7269 OCILobLocator *dst_locp,
7270 OCILobLocator *src_locp);
7271
7272sword OCILobAssign (OCIEnv *envhp, OCIError *errhp,
7273 const OCILobLocator *src_locp,
7274 OCILobLocator **dst_locpp);
7275
7276sword OCILobCharSetForm (OCIEnv *envhp, OCIError *errhp,
7277 const OCILobLocator *locp, ub1 *csfrm);
7278
7279sword OCILobCharSetId (OCIEnv *envhp, OCIError *errhp,
7280 const OCILobLocator *locp, ub2 *csid);
7281
7282sword OCILobCopy (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *dst_locp,
7283 OCILobLocator *src_locp, ub4 amount, ub4 dst_offset,
7284 ub4 src_offset);
7285
7286sword OCILobCreateTemporary(OCISvcCtx *svchp,
7287 OCIError *errhp,
7288 OCILobLocator *locp,
7289 ub2 csid,
7290 ub1 csfrm,
7291 ub1 lobtype,
7292 boolean cache,
7293 OCIDuration duration);
7294
7295
7296sword OCILobClose( OCISvcCtx *svchp,
7297 OCIError *errhp,
7298 OCILobLocator *locp );
7299
7300
7301sword OCILobDisableBuffering (OCISvcCtx *svchp,
7302 OCIError *errhp,
7303 OCILobLocator *locp);
7304
7305sword OCILobEnableBuffering (OCISvcCtx *svchp,
7306 OCIError *errhp,
7307 OCILobLocator *locp);
7308
7309sword OCILobErase (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
7310 ub4 *amount, ub4 offset);
7311
7312sword OCILobFileClose (OCISvcCtx *svchp, OCIError *errhp,
7313 OCILobLocator *filep);
7314
7315sword OCILobFileCloseAll (OCISvcCtx *svchp, OCIError *errhp);
7316
7317sword OCILobFileExists (OCISvcCtx *svchp, OCIError *errhp,
7318 OCILobLocator *filep,
7319 boolean *flag);
7320
7321sword OCILobFileGetName (OCIEnv *envhp, OCIError *errhp,
7322 const OCILobLocator *filep,
7323 OraText *dir_alias, ub2 *d_length,
7324 OraText *filename, ub2 *f_length);
7325
7326sword OCILobFileIsOpen (OCISvcCtx *svchp, OCIError *errhp,
7327 OCILobLocator *filep,
7328 boolean *flag);
7329
7330sword OCILobFileOpen (OCISvcCtx *svchp, OCIError *errhp,
7331 OCILobLocator *filep,
7332 ub1 mode);
7333
7334sword OCILobFileSetName (OCIEnv *envhp, OCIError *errhp,
7335 OCILobLocator **filepp,
7336 const OraText *dir_alias, ub2 d_length,
7337 const OraText *filename, ub2 f_length);
7338
7339sword OCILobFlushBuffer (OCISvcCtx *svchp,
7340 OCIError *errhp,
7341 OCILobLocator *locp,
7342 ub4 flag);
7343
7344sword OCILobFreeTemporary(OCISvcCtx *svchp,
7345 OCIError *errhp,
7346 OCILobLocator *locp);
7347
7348sword OCILobGetChunkSize(OCISvcCtx *svchp,
7349 OCIError *errhp,
7350 OCILobLocator *locp,
7351 ub4 *chunksizep);
7352
7353sword OCILobGetLength (OCISvcCtx *svchp, OCIError *errhp,
7354 OCILobLocator *locp,
7355 ub4 *lenp);
7356
7357sword OCILobIsEqual (OCIEnv *envhp, const OCILobLocator *x,
7358 const OCILobLocator *y,
7359 boolean *is_equal);
7360
7361sword OCILobIsOpen( OCISvcCtx *svchp,
7362 OCIError *errhp,
7363 OCILobLocator *locp,
7364 boolean *flag);
7365
7366sword OCILobIsTemporary(OCIEnv *envp,
7367 OCIError *errhp,
7368 OCILobLocator *locp,
7369 boolean *is_temporary);
7370
7371sword OCILobLoadFromFile (OCISvcCtx *svchp, OCIError *errhp,
7372 OCILobLocator *dst_locp,
7373 OCILobLocator *src_filep,
7374 ub4 amount, ub4 dst_offset,
7375 ub4 src_offset);
7376
7377sword OCILobLocatorAssign (OCISvcCtx *svchp, OCIError *errhp,
7378 const OCILobLocator *src_locp,
7379 OCILobLocator **dst_locpp);
7380
7381
7382sword OCILobLocatorIsInit (OCIEnv *envhp, OCIError *errhp,
7383 const OCILobLocator *locp,
7384 boolean *is_initialized);
7385
7386sword OCILobOpen( OCISvcCtx *svchp,
7387 OCIError *errhp,
7388 OCILobLocator *locp,
7389 ub1 mode );
7390
7391sword OCILobRead (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
7392 ub4 *amtp, ub4 offset, void *bufp, ub4 bufl, void *ctxp,
7393 OCICallbackLobRead cbfp, ub2 csid, ub1 csfrm);
7394
7395sword OCILobTrim (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
7396 ub4 newlen);
7397
7398sword OCILobWrite (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
7399 ub4 *amtp, ub4 offset, void *bufp, ub4 buflen,
7400 ub1 piece, void *ctxp, OCICallbackLobWrite cbfp,
7401 ub2 csid, ub1 csfrm);
7402
7403sword OCILobGetDeduplicateRegions(OCISvcCtx *svchp, OCIError *errhp,
7404 OCILobLocator *locp,
7405 OCILobRegion *regp, ub4 *count, ub1 piece,
7406 void *ctxp,
7407 OCICallbackLobGetDeduplicateRegions cbfp);
7408
7409sword OCILobWriteAppend(OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *lobp,
7410 ub4 *amtp, void *bufp, ub4 bufl, ub1 piece,
7411 void *ctxp, OCICallbackLobWrite cbfp, ub2 csid,
7412 ub1 csfrm);
7413
7414sword OCIBreak (void *hndlp, OCIError *errhp);
7415
7416sword OCIReset (void *hndlp, OCIError *errhp);
7417
7418sword OCIServerVersion (void *hndlp, OCIError *errhp, OraText *bufp,
7419 ub4 bufsz,
7420 ub1 hndltype);
7421
7422sword OCIServerRelease (void *hndlp, OCIError *errhp, OraText *bufp,
7423 ub4 bufsz,
7424 ub1 hndltype, ub4 *version);
7425
7426sword OCIAttrGet (const void *trgthndlp, ub4 trghndltyp,
7427 void *attributep, ub4 *sizep, ub4 attrtype,
7428 OCIError *errhp);
7429
7430sword OCIAttrSet (void *trgthndlp, ub4 trghndltyp, void *attributep,
7431 ub4 size, ub4 attrtype, OCIError *errhp);
7432
7433sword OCISvcCtxToLda (OCISvcCtx *svchp, OCIError *errhp, Lda_Def *ldap);
7434
7435sword OCILdaToSvcCtx (OCISvcCtx **svchpp, OCIError *errhp, Lda_Def *ldap);
7436
7437sword OCIResultSetToStmt (OCIResult *rsetdp, OCIError *errhp);
7438
7439sword OCIFileClose ( void *hndl, OCIError *err, OCIFileObject *filep );
7440
7441sword OCIUserCallbackRegister(void *hndlp, ub4 type, void *ehndlp,
7442 OCIUserCallback callback, void *ctxp,
7443 ub4 fcode, ub4 when, OCIUcb *ucbDesc);
7444
7445sword OCIUserCallbackGet(void *hndlp, ub4 type, void *ehndlp,
7446 ub4 fcode, ub4 when, OCIUserCallback *callbackp,
7447 void **ctxpp, OCIUcb *ucbDesc);
7448
7449sword OCISharedLibInit(void *metaCtx, void *libCtx, ub4 argfmt, sword argc,
7450 void **argv, OCIEnvCallbackType envCallback);
7451
7452sword OCIFileExists ( void *hndl, OCIError *err, OraText *filename,
7453 OraText *path, ub1 *flag );
7454
7455sword OCIFileFlush( void *hndl, OCIError *err, OCIFileObject *filep );
7456
7457
7458sword OCIFileGetLength( void *hndl, OCIError *err, OraText *filename,
7459 OraText *path, ubig_ora *lenp );
7460
7461sword OCIFileInit ( void *hndl, OCIError *err );
7462
7463sword OCIFileOpen ( void *hndl, OCIError *err, OCIFileObject **filep,
7464 OraText *filename, OraText *path, ub4 mode, ub4 create,
7465 ub4 type );
7466
7467sword OCIFileRead ( void *hndl, OCIError *err, OCIFileObject *filep,
7468 void *bufp, ub4 bufl, ub4 *bytesread );
7469
7470sword OCIFileSeek ( void *hndl, OCIError *err, OCIFileObject *filep,
7471 uword origin, ubig_ora offset, sb1 dir );
7472
7473sword OCIFileTerm ( void *hndl, OCIError *err );
7474
7475
7476sword OCIFileWrite ( void *hndl, OCIError *err, OCIFileObject *filep,
7477 void *bufp, ub4 buflen, ub4 *byteswritten );
7478
7479
7480#ifdef ORAXB8_DEFINED
7481
7482sword OCILobCopy2 (OCISvcCtx *svchp, OCIError *errhp,
7483 OCILobLocator *dst_locp,
7484 OCILobLocator *src_locp, oraub8 amount,
7485 oraub8 dst_offset,
7486 oraub8 src_offset);
7487
7488sword OCILobErase2 (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
7489 oraub8 *amount, oraub8 offset);
7490
7491sword OCILobGetLength2 (OCISvcCtx *svchp, OCIError *errhp,
7492 OCILobLocator *locp, oraub8 *lenp);
7493
7494sword OCILobLoadFromFile2 (OCISvcCtx *svchp, OCIError *errhp,
7495 OCILobLocator *dst_locp,
7496 OCILobLocator *src_filep,
7497 oraub8 amount, oraub8 dst_offset,
7498 oraub8 src_offset);
7499
7500sword OCILobRead2 (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
7501 oraub8 *byte_amtp, oraub8 *char_amtp, oraub8 offset,
7502 void *bufp, oraub8 bufl, ub1 piece, void *ctxp,
7503 OCICallbackLobRead2 cbfp, ub2 csid, ub1 csfrm);
7504
7505sword OCILobArrayRead (OCISvcCtx *svchp, OCIError *errhp, ub4 *array_iter,
7506 OCILobLocator **lobp_arr, oraub8 *byte_amt_arr,
7507 oraub8 *char_amt_arr, oraub8 *offset_arr,
7508 void **bufp_arr, oraub8 *bufl_arr, ub1 piece,
7509 void *ctxp, OCICallbackLobArrayRead cbfp, ub2 csid,
7510 ub1 csfrm);
7511
7512sword OCILobTrim2 (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
7513 oraub8 newlen);
7514
7515sword OCILobWrite2 (OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp,
7516 oraub8 *byte_amtp, oraub8 *char_amtp, oraub8 offset,
7517 void *bufp, oraub8 buflen, ub1 piece, void *ctxp,
7518 OCICallbackLobWrite2 cbfp, ub2 csid, ub1 csfrm);
7519
7520sword OCILobArrayWrite (OCISvcCtx *svchp, OCIError *errhp, ub4 *array_iter,
7521 OCILobLocator **lobp_arr, oraub8 *byte_amt_arr,
7522 oraub8 *char_amt_arr, oraub8 *offset_arr,
7523 void **bufp_arr, oraub8 *bufl_arr, ub1 piece,
7524 void *ctxp, OCICallbackLobArrayWrite cbfp, ub2 csid,
7525 ub1 csfrm);
7526
7527sword OCILobWriteAppend2 (OCISvcCtx *svchp, OCIError *errhp,
7528 OCILobLocator *lobp,
7529 oraub8 *byte_amtp, oraub8 *char_amtp, void *bufp,
7530 oraub8 bufl, ub1 piece, void *ctxp,
7531 OCICallbackLobWrite2 cbfp, ub2 csid, ub1 csfrm);
7532
7533sword OCILobGetStorageLimit (OCISvcCtx *svchp, OCIError *errhp,
7534 OCILobLocator *lobp, oraub8 *limitp);
7535
7536sword OCILobGetOptions (OCISvcCtx *svchp, OCIError *errhp,
7537 OCILobLocator *lobp,
7538 ub4 optypes, void *optionsp, ub4 *optionslenp,
7539 ub4 mode);
7540
7541sword OCILobSetOptions (OCISvcCtx *svchp, OCIError *errhp,
7542 OCILobLocator *lobp,
7543 ub4 optypes, void *optionsp, ub4 optionslen,
7544 ub4 mode);
7545
7546sword OCILobGetContentType (OCISvcCtx *svchp,
7547 OCIError *errhp, OCILobLocator *lobp,
7548 oratext *contenttypep, ub4 *contenttypelenp,
7549 ub4 mode);
7550
7551sword OCILobSetContentType (OCISvcCtx *svchp,
7552 OCIError *errhp, OCILobLocator *lobp,
7553 const oratext *contenttypep, ub4 contenttypelen,
7554 ub4 mode);
7555
7556#endif
7557
7558/*
7559 ** Initialize the security package
7560 */
7561sword OCISecurityInitialize (OCISecurity *sechandle, OCIError *error_handle);
7562
7563sword OCISecurityTerminate (OCISecurity *sechandle, OCIError *error_handle);
7564
7565sword OCISecurityOpenWallet(OCISecurity *osshandle,
7566 OCIError *error_handle,
7567 size_t wrllen,
7568 OraText *wallet_resource_locator,
7569 size_t pwdlen,
7570 OraText *password,
7571 nzttWallet *wallet);
7572
7573sword OCISecurityCloseWallet(OCISecurity *osshandle,
7574 OCIError *error_handle,
7575 nzttWallet *wallet);
7576
7577sword OCISecurityCreateWallet(OCISecurity *osshandle,
7578 OCIError *error_handle,
7579 size_t wrllen,
7580 OraText *wallet_resource_locator,
7581 size_t pwdlen,
7582 OraText *password,
7583 nzttWallet *wallet);
7584
7585sword OCISecurityDestroyWallet(OCISecurity *osshandle,
7586 OCIError *error_handle,
7587 size_t wrllen,
7588 OraText *wallet_resource_locator,
7589 size_t pwdlen,
7590 OraText *password);
7591
7592sword OCISecurityStorePersona(OCISecurity *osshandle,
7593 OCIError *error_handle,
7594 nzttPersona **persona,
7595 nzttWallet *wallet);
7596
7597sword OCISecurityOpenPersona(OCISecurity *osshandle,
7598 OCIError *error_handle,
7599 nzttPersona *persona);
7600
7601sword OCISecurityClosePersona(OCISecurity *osshandle,
7602 OCIError *error_handle,
7603 nzttPersona *persona);
7604
7605sword OCISecurityRemovePersona(OCISecurity *osshandle,
7606 OCIError *error_handle,
7607 nzttPersona **persona);
7608
7609sword OCISecurityCreatePersona(OCISecurity *osshandle,
7610 OCIError *error_handle,
7611 nzttIdentType identity_type,
7612 nzttCipherType cipher_type,
7613 nzttPersonaDesc *desc,
7614 nzttPersona **persona);
7615
7616sword OCISecuritySetProtection(OCISecurity *osshandle,
7617 OCIError *error_handle,
7618 nzttPersona *persona,
7619 nzttcef crypto_engine_function,
7620 nztttdufmt data_unit_format,
7621 nzttProtInfo *protection_info);
7622
7623sword OCISecurityGetProtection(OCISecurity *osshandle,
7624 OCIError *error_handle,
7625 nzttPersona *persona,
7626 nzttcef crypto_engine_function,
7627 nztttdufmt * data_unit_format_ptr,
7628 nzttProtInfo *protection_info);
7629
7630sword OCISecurityRemoveIdentity(OCISecurity *osshandle,
7631 OCIError *error_handle,
7632 nzttIdentity **identity_ptr);
7633
7634sword OCISecurityCreateIdentity(OCISecurity *osshandle,
7635 OCIError *error_handle,
7636 nzttIdentType type,
7637 nzttIdentityDesc *desc,
7638 nzttIdentity **identity_ptr);
7639
7640sword OCISecurityAbortIdentity(OCISecurity *osshandle,
7641 OCIError *error_handle,
7642 nzttIdentity **identity_ptr);
7643
7644sword OCISecurityFreeIdentity(OCISecurity *osshandle,
7645 OCIError *error_handle,
7646 nzttIdentity **identity_ptr);
7647
7648
7649sword OCISecurityStoreTrustedIdentity(OCISecurity *osshandle,
7650 OCIError *error_handle,
7651 nzttIdentity **identity_ptr,
7652 nzttPersona *persona);
7653
7654sword OCISecuritySign(OCISecurity *osshandle,
7655 OCIError *error_handle,
7656 nzttPersona *persona,
7657 nzttces signature_state,
7658 size_t input_length,
7659 ub1 *input,
7660 nzttBufferBlock *buffer_block);
7661
7662sword OCISecuritySignExpansion(OCISecurity *osshandle,
7663 OCIError *error_handle,
7664 nzttPersona *persona,
7665 size_t inputlen,
7666 size_t *signature_length);
7667
7668sword OCISecurityVerify(OCISecurity *osshandle,
7669 OCIError *error_handle,
7670 nzttPersona *persona,
7671 nzttces signature_state,
7672 size_t siglen,
7673 ub1 *signature,
7674 nzttBufferBlock *extracted_message,
7675 boolean *verified,
7676 boolean *validated,
7677 nzttIdentity **signing_party_identity);
7678
7679sword OCISecurityValidate(OCISecurity *osshandle,
7680 OCIError *error_handle,
7681 nzttPersona *persona,
7682 nzttIdentity *identity,
7683 boolean *validated);
7684
7685sword OCISecuritySignDetached(OCISecurity *osshandle,
7686 OCIError *error_handle,
7687 nzttPersona *persona,
7688 nzttces signature_state,
7689 size_t input_length,
7690 ub1 * input,
7691 nzttBufferBlock *signature);
7692
7693sword OCISecuritySignDetExpansion(OCISecurity *osshandle,
7694 OCIError *error_handle,
7695 nzttPersona *persona,
7696 size_t input_length,
7697 size_t *required_buffer_length);
7698
7699sword OCISecurityVerifyDetached(OCISecurity *osshandle,
7700 OCIError *error_handle,
7701 nzttPersona *persona,
7702 nzttces signature_state,
7703 size_t data_length,
7704 ub1 *data,
7705 size_t siglen,
7706 ub1 *signature,
7707 boolean *verified,
7708 boolean *validated,
7709 nzttIdentity **signing_party_identity);
7710
7711sword OCISecurity_PKEncrypt(OCISecurity *osshandle,
7712 OCIError *error_handle,
7713 nzttPersona *persona,
7714 size_t number_of_recipients,
7715 nzttIdentity *recipient_list,
7716 nzttces encryption_state,
7717 size_t input_length,
7718 ub1 *input,
7719 nzttBufferBlock *encrypted_data);
7720
7721sword OCISecurityPKEncryptExpansion(OCISecurity *osshandle,
7722 OCIError *error_handle,
7723 nzttPersona *persona,
7724 size_t number_recipients,
7725 size_t input_length,
7726 size_t *buffer_length_required);
7727
7728sword OCISecurityPKDecrypt(OCISecurity *osshandle,
7729 OCIError *error_handle,
7730 nzttPersona *persona,
7731 nzttces encryption_state,
7732 size_t input_length,
7733 ub1 *input,
7734 nzttBufferBlock *encrypted_data);
7735
7736sword OCISecurityEncrypt(OCISecurity *osshandle,
7737 OCIError *error_handle,
7738 nzttPersona *persona,
7739 nzttces encryption_state,
7740 size_t input_length,
7741 ub1 *input,
7742 nzttBufferBlock *encrypted_data);
7743
7744sword OCISecurityEncryptExpansion(OCISecurity *osshandle,
7745 OCIError *error_handle,
7746 nzttPersona *persona,
7747 size_t input_length,
7748 size_t *encrypted_data_length);
7749
7750sword OCISecurityDecrypt(OCISecurity *osshandle,
7751 OCIError *error_handle,
7752 nzttPersona *persona,
7753 nzttces decryption_state,
7754 size_t input_length,
7755 ub1 *input,
7756 nzttBufferBlock *decrypted_data);
7757
7758sword OCISecurityEnvelope(OCISecurity *osshandle,
7759 OCIError *error_handle,
7760 nzttPersona *persona,
7761 size_t number_of_recipients,
7762 nzttIdentity *identity,
7763 nzttces encryption_state,
7764 size_t input_length,
7765 ub1 *input,
7766 nzttBufferBlock *enveloped_data);
7767
7768sword OCISecurityDeEnvelope(OCISecurity *osshandle,
7769 OCIError *error_handle,
7770 nzttPersona *persona,
7771 nzttces decryption_state,
7772 size_t input_length,
7773 ub1 *input,
7774 nzttBufferBlock *output_message,
7775 boolean *verified,
7776 boolean *validated,
7777 nzttIdentity **sender_identity);
7778
7779sword OCISecurityKeyedHash(OCISecurity *osshandle,
7780 OCIError *error_handle,
7781 nzttPersona *persona,
7782 nzttces hash_state,
7783 size_t input_length,
7784 ub1 *input,
7785 nzttBufferBlock *keyed_hash);
7786
7787sword OCISecurityKeyedHashExpansion(OCISecurity *osshandle,
7788 OCIError *error_handle,
7789 nzttPersona *persona,
7790 size_t input_length,
7791 size_t *required_buffer_length);
7792
7793sword OCISecurityHash(OCISecurity *osshandle,
7794 OCIError *error_handle,
7795 nzttPersona *persona,
7796 nzttces hash_state,
7797 size_t input,
7798 ub1 *input_length,
7799 nzttBufferBlock *hash);
7800
7801sword OCISecurityHashExpansion(OCISecurity *osshandle,
7802 OCIError *error_handle,
7803 nzttPersona *persona,
7804 size_t input_length,
7805 size_t *required_buffer_length);
7806
7807sword OCISecuritySeedRandom(OCISecurity *osshandle,
7808 OCIError *error_handle,
7809 nzttPersona *persona,
7810 size_t seed_length,
7811 ub1 *seed);
7812
7813sword OCISecurityRandomBytes(OCISecurity *osshandle,
7814 OCIError *error_handle,
7815 nzttPersona *persona,
7816 size_t number_of_bytes_desired,
7817 nzttBufferBlock *random_bytes);
7818
7819sword OCISecurityRandomNumber(OCISecurity *osshandle,
7820 OCIError *error_handle,
7821 nzttPersona *persona,
7822 uword *random_number_ptr);
7823
7824sword OCISecurityInitBlock(OCISecurity *osshandle,
7825 OCIError *error_handle,
7826 nzttBufferBlock *buffer_block);
7827
7828sword OCISecurityReuseBlock(OCISecurity *osshandle,
7829 OCIError *error_handle,
7830 nzttBufferBlock *buffer_block);
7831
7832sword OCISecurityPurgeBlock(OCISecurity *osshandle,
7833 OCIError *error_handle,
7834 nzttBufferBlock *buffer_block);
7835
7836sword OCISecuritySetBlock(OCISecurity *osshandle,
7837 OCIError *error_handle,
7838 uword flags_to_set,
7839 size_t buffer_length,
7840 size_t used_buffer_length,
7841 ub1 *buffer,
7842 nzttBufferBlock *buffer_block);
7843
7844sword OCISecurityGetIdentity(OCISecurity *osshandle,
7845 OCIError *error_handle,
7846 size_t namelen,
7847 OraText *distinguished_name,
7848 nzttIdentity **identity);
7849
7850sword OCIAQEnq(OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
7851 OCIAQEnqOptions *enqopt, OCIAQMsgProperties *msgprop,
7852 OCIType *payload_tdo, void **payload, void **payload_ind,
7853 OCIRaw **msgid, ub4 flags);
7854
7855sword OCIAQDeq(OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
7856 OCIAQDeqOptions *deqopt, OCIAQMsgProperties *msgprop,
7857 OCIType *payload_tdo, void **payload, void **payload_ind,
7858 OCIRaw **msgid, ub4 flags);
7859
7860sword OCIAQEnqArray(OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
7861 OCIAQEnqOptions *enqopt, ub4 *iters,
7862 OCIAQMsgProperties **msgprop, OCIType *payload_tdo,
7863 void **payload, void **payload_ind, OCIRaw **msgid,
7864 void *ctxp, OCICallbackAQEnq enqcbfp, ub4 flags);
7865
7866sword OCIAQEnqStreaming(OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
7867 OCIAQEnqOptions *enqopt, OCIType *payload_tdo,
7868 void *ctxp, OCICallbackAQEnqStreaming enqcbfp,
7869 ub4 flags);
7870
7871sword OCIAQDeqArray(OCISvcCtx *svchp, OCIError *errhp, OraText *queue_name,
7872 OCIAQDeqOptions *deqopt, ub4 *iters,
7873 OCIAQMsgProperties **msgprop, OCIType *payload_tdo,
7874 void **payload, void **payload_ind, OCIRaw **msgid,
7875 void *ctxp, OCICallbackAQDeq deqcbfp, ub4 flags);
7876
7877sword OCIAQListen(OCISvcCtx *svchp, OCIError *errhp,
7878 OCIAQAgent **agent_list, ub4 num_agents,
7879 sb4 wait, OCIAQAgent **agent,
7880 ub4 flags);
7881
7882sword OCIAQListen2(OCISvcCtx *svchp, OCIError *errhp,
7883 OCIAQAgent **agent_list, ub4 num_agents,
7884 OCIAQListenOpts *lopts, OCIAQAgent **agent,
7885 OCIAQLisMsgProps *lmops, ub4 flags);
7886
7887sword OCIAQGetReplayInfo(OCISvcCtx *svchp, OCIError *errhp,
7888 OraText *queue_name, OCIAQAgent *sender,
7889 ub4 replay_attribute, OraText *correlation,
7890 ub2 *corr_len);
7891
7892sword OCIAQResetReplayInfo(OCISvcCtx *svchp, OCIError *errhp,
7893 OraText *queue_name, OCIAQAgent *sender,
7894 ub4 replay_attribute);
7895
7896sword OCIExtractInit(void *hndl, OCIError *err);
7897
7898sword OCIExtractTerm(void *hndl, OCIError *err);
7899
7900sword OCIExtractReset(void *hndl, OCIError *err);
7901
7902sword OCIExtractSetNumKeys(void *hndl, OCIError *err, uword numkeys);
7903
7904sword OCIExtractSetKey(void *hndl, OCIError *err, const OraText *name,
7905 ub1 type, ub4 flag, const void *defval,
7906 const sb4 *intrange, const OraText *const *strlist);
7907
7908sword OCIExtractFromFile(void *hndl, OCIError *err, ub4 flag,
7909 OraText *filename);
7910
7911sword OCIExtractFromStr(void *hndl, OCIError *err, ub4 flag, OraText *input);
7912
7913sword OCIExtractToInt(void *hndl, OCIError *err, OraText *keyname,
7914 uword valno, sb4 *retval);
7915
7916sword OCIExtractToBool(void *hndl, OCIError *err, OraText *keyname,
7917 uword valno, ub1 *retval);
7918
7919sword OCIExtractToStr(void *hndl, OCIError *err, OraText *keyname,
7920 uword valno, OraText *retval, uword buflen);
7921
7922sword OCIExtractToOCINum(void *hndl, OCIError *err, OraText *keyname,
7923 uword valno, OCINumber *retval);
7924
7925sword OCIExtractToList(void *hndl, OCIError *err, uword *numkeys);
7926
7927sword OCIExtractFromList(void *hndl, OCIError *err, uword index,
7928 OraText **name,
7929 ub1 *type, uword *numvals, void ***values);
7930
7931/* Memory Related Service Interfaces */
7932
7933sword OCIMemoryAlloc(void *hdl, OCIError *err, void **mem,
7934 OCIDuration dur, ub4 size, ub4 flags);
7935
7936sword OCIMemoryResize(void *hdl, OCIError *err, void **mem,
7937 ub4 newsize, ub4 flags);
7938
7939sword OCIMemoryFree(void *hdl, OCIError *err, void *mem);
7940
7941sword OCIContextSetValue(void *hdl, OCIError *err, OCIDuration duration,
7942 ub1 *key, ub1 keylen, void *ctx_value);
7943
7944sword OCIContextGetValue(void *hdl, OCIError *err, ub1 *key,
7945 ub1 keylen, void **ctx_value);
7946
7947sword OCIContextClearValue(void *hdl, OCIError *err, ub1 *key,
7948 ub1 keylen);
7949
7950sword OCIContextGenerateKey(void *hdl, OCIError *err, ub4 *key);
7951
7952sword OCIMemorySetCurrentIDs(void *hdl, OCIError *err,
7953 ub4 curr_session_id, ub4 curr_trans_id,
7954 ub4 curr_stmt_id);
7955
7956sword OCIPicklerTdsCtxInit(OCIEnv *env, OCIError *err,
7957 OCIPicklerTdsCtx **tdsc);
7958
7959sword OCIPicklerTdsCtxFree(OCIEnv *env, OCIError *err, OCIPicklerTdsCtx *tdsc);
7960
7961sword OCIPicklerTdsInit(OCIEnv *env, OCIError *err, OCIPicklerTdsCtx *tdsc,
7962 OCIPicklerTds **tdsh);
7963
7964sword OCIPicklerTdsFree(OCIEnv *env, OCIError *err, OCIPicklerTds *tdsh);
7965
7966sword OCIPicklerTdsCreateElementNumber(OCIEnv *env, OCIError *err,
7967 OCIPicklerTds *tdsh, ub1 prec,
7968 sb1 scale, OCIPicklerTdsElement *elt);
7969
7970sword OCIPicklerTdsCreateElementChar(OCIEnv *env, OCIError *err,
7971 OCIPicklerTds *tdsh, ub2 len,
7972 OCIPicklerTdsElement *elt);
7973
7974sword OCIPicklerTdsCreateElementVarchar(OCIEnv *env, OCIError *err,
7975 OCIPicklerTds *tdsh, ub2 len,
7976 OCIPicklerTdsElement *elt);
7977
7978sword OCIPicklerTdsCreateElementRaw(OCIEnv *env, OCIError *err,
7979 OCIPicklerTds *tdsh, ub2 len,
7980 OCIPicklerTdsElement *elt);
7981
7982sword OCIPicklerTdsCreateElement(OCIEnv *env, OCIError *err,
7983 OCIPicklerTds *tdsh, OCITypeCode dty,
7984 OCIPicklerTdsElement *elt);
7985
7986sword OCIPicklerTdsAddAttr(OCIEnv *env, OCIError *err,
7987 OCIPicklerTds *tdsh, OCIPicklerTdsElement elt);
7988
7989sword OCIPicklerTdsGenerate(OCIEnv *env, OCIError *err,
7990 OCIPicklerTds *tdsh);
7991
7992sword OCIPicklerTdsGetAttr(OCIEnv *env, OCIError *err,
7993 const OCIPicklerTds *tdsh, ub1 attrno,
7994 OCITypeCode *typ, ub2 *len);
7995
7996sword OCIPicklerFdoInit(OCIEnv *env, OCIError *err,
7997 OCIPicklerFdo **fdoh);
7998
7999sword OCIPicklerFdoFree(OCIEnv *env, OCIError *err,
8000 OCIPicklerFdo *fdoh);
8001
8002sword OCIPicklerImageInit(OCIEnv *env, OCIError *err,
8003 OCIPicklerFdo *fdoh,
8004 OCIPicklerTds *tdsh,
8005 OCIPicklerImage **imgh);
8006
8007sword OCIPicklerImageFree(OCIEnv *env, OCIError *err,
8008 OCIPicklerImage *imgh);
8009
8010sword OCIPicklerImageAddScalar(OCIEnv *env, OCIError *err,
8011 OCIPicklerImage *imgh,
8012 void *scalar, ub4 len);
8013
8014sword OCIPicklerImageAddNullScalar(OCIEnv *env, OCIError *err,
8015 OCIPicklerImage *imgh);
8016
8017sword OCIPicklerImageGenerate(OCIEnv *env, OCIError *err,
8018 OCIPicklerImage *imgh);
8019
8020sword OCIPicklerImageGetScalarSize(OCIEnv *env, OCIError *err,
8021 OCIPicklerImage *imgh,
8022 ub4 attrno, ub4 *size);
8023
8024sword OCIPicklerImageGetScalar(OCIEnv *env, OCIError *err,
8025 OCIPicklerImage *imgh, ub4 attrno,
8026 void *buf, ub4 *len, OCIInd *ind);
8027
8028sword OCIPicklerImageCollBegin(OCIEnv *env, OCIError *err,
8029 OCIPicklerImage *imgh, const OCIPicklerTds *colltdsh);
8030
8031sword OCIPicklerImageCollAddScalar( OCIEnv *env, OCIError *err,
8032 OCIPicklerImage *imgh, void *scalar,
8033 ub4 buflen, OCIInd ind);
8034
8035sword OCIPicklerImageCollEnd(OCIEnv *env, OCIError *err,
8036 OCIPicklerImage *imgh);
8037
8038/* should take svcctx for locator stuff */
8039sword OCIPicklerImageCollBeginScan(OCIEnv *env, OCIError *err,
8040 OCIPicklerImage *imgh, const OCIPicklerTds *coll_tdsh,
8041 ub4 attrnum, ub4 startidx, OCIInd *ind);
8042
8043sword OCIPicklerImageCollGetScalarSize(OCIEnv *env, OCIError *err,
8044 const OCIPicklerTds *coll_tdsh, ub4 *size);
8045
8046sword OCIPicklerImageCollGetScalar(OCIEnv *env, OCIError *err,
8047 OCIPicklerImage *imgh, void *buf,
8048 ub4 *buflen, OCIInd *ind);
8049
8050sword OCIAnyDataGetType(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
8051 OCITypeCode *tc, OCIType **type);
8052
8053sword OCIAnyDataIsNull(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
8054 boolean *isnull);
8055
8056sword OCIAnyDataConvert(OCISvcCtx *svchp, OCIError *errhp, OCITypeCode tc,
8057 OCIType *type, OCIDuration dur, void *ind, void *data_val,
8058 ub4 len, OCIAnyData **sdata);
8059
8060sword OCIAnyDataBeginCreate(OCISvcCtx *svchp, OCIError *errhp, OCITypeCode tc,
8061 OCIType *type, OCIDuration dur, OCIAnyData **sdata);
8062
8063sword OCIAnyDataDestroy(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata);
8064
8065sword OCIAnyDataAttrSet(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
8066 OCITypeCode tc, OCIType *type, void *ind, void *attr_val,
8067 ub4 length, boolean is_any);
8068
8069sword OCIAnyDataCollAddElem(OCISvcCtx *svchp, OCIError *errhp,
8070 OCIAnyData *sdata, OCITypeCode tc, OCIType *type, void *ind,
8071 void *attr_val, ub4 length, boolean is_any, boolean last_elem);
8072
8073sword OCIAnyDataEndCreate(OCISvcCtx *svchp, OCIError *errhp,
8074 OCIAnyData *sdata);
8075
8076sword OCIAnyDataAccess(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
8077 OCITypeCode tc, OCIType *type, void *ind, void *attr_val,
8078 ub4 *length);
8079
8080sword OCIAnyDataGetCurrAttrNum(OCISvcCtx *svchp, OCIError *errhp,
8081 OCIAnyData *sdata, ub4 *attrnum);
8082
8083sword OCIAnyDataAttrGet(OCISvcCtx *svchp, OCIError *errhp, OCIAnyData *sdata,
8084 OCITypeCode tc, OCIType *type, void *ind, void *attr_val,
8085 ub4 *length, boolean is_any);
8086
8087sword OCIAnyDataCollGetElem(OCISvcCtx *svchp, OCIError *errhp,
8088 OCIAnyData *sdata,
8089 OCITypeCode tc, OCIType *type, void *ind, void *celem_val,
8090 ub4 *length, boolean is_any);
8091
8092
8093/*------------------------ OCIAnyDataSet interfaces -------------------------*/
8094
8095/*
8096 NAME
8097 OCIAnyDataSetBeginCreate - OCIAnyDataSet Begin Creation
8098 PARAMETERS
8099 svchp (IN/OUT) - The OCI service context.
8100 errhp (IN/OUT) - The OCI error handle. If there is an error, it is
8101 recorded in errhp and this function returns OCI_ERROR.
8102 Diagnostic information can be obtained by calling
8103 OCIErrorGet().
8104 typecode - typecode corresponding to the OCIAnyDataSet.
8105 type (IN) - type corresponding to the OCIAnyDataSet. If the typecode
8106 corresponds to a built-in type (OCI_TYPECODE_NUMBER etc.)
8107 , this parameter can be NULL. It should be non NULL for
8108 user defined types (OCI_TYPECODE_OBJECT,
8109 OCI_TYPECODE_REF, collection types etc.)
8110 dur (IN) - duration for which OCIAnyDataSet is allocated.
8111 data_set (OUT) - Initialized OCIAnyDataSet.
8112 RETURNS - error code
8113 NOTES
8114 This call allocates an OCIAnyDataSet for the duration of dur and
8115 initializes it with the type information. The OCIAnyDataSet can hold
8116 multiple instances of the given type. For performance reasons, the
8117 OCIAnyDataSet will end up pointing to the passed in OCIType parameter.
8118 It is the responsibility of the caller to ensure that the OCIType is
8119 longer lived (has allocation duration >= the duration of the OCIAnyData
8120 if the OCIType is a transient one, allocation/pin duration >= duration of
8121 the OCIAnyData if the OCIType is a persistent one).
8122
8123*/
8124sword OCIAnyDataSetBeginCreate(OCISvcCtx *svchp, OCIError *errhp,
8125 OCITypeCode typecode, const OCIType *type, OCIDuration dur,
8126 OCIAnyDataSet ** data_set);
8127
8128/*
8129 NAME
8130 OCIAnyDataSetDestroy - OCIAnyDataSet Destroy
8131 DESCRIPTION
8132 This call frees the OCIAnyDataSet allocated using
8133 OCIAnyDataSetBeginCreate().
8134 RETURNS
8135 error code.
8136 PARAMETERS
8137 svchp (IN/OUT) - The OCI service context.
8138 errhp (IN/OUT) - The OCI Error handle.
8139 data_set (IN/OUT) - OCIAnyDataSet to be freed.
8140*/
8141sword OCIAnyDataSetDestroy(OCISvcCtx *svchp, OCIError *errhp,
8142 OCIAnyDataSet *data_set);
8143
8144
8145/*
8146 NAME
8147 OCIAnyDataSetAddInstance - OCIAnyDataSet Add an instance
8148 DESCRIPTION
8149 This call adds a new skeleton instance to the OCIAnyDataSet and all the
8150 attributes of the instance are set to NULL. It returns this skeleton
8151 instance through the OCIAnyData parameter which can be constructed
8152 subsequently by invoking the OCIAnyData API.
8153 RETURNS
8154 error code.
8155 PARAMETERS
8156 svchp (IN/OUT) - The OCI service context.
8157 errhp (IN/OUT) - The OCI Error handle.
8158 data_set (IN/OUT) - OCIAnyDataSet to which a new instance is added.
8159 data (IN/OUT) - OCIAnyData corresponding to the newly added
8160 instance. If (*data) is NULL, a new OCIAnyData will
8161 be allocated for same duration as the OCIAnyDataSet.
8162 If (*data) is not NULL, it will get reused. This
8163 OCIAnyData can be subseqently constructed using the
8164 OCIAnyDataConvert() call or it can be constructed
8165 piece-wise using the OCIAnyDataAttrSet and
8166 OCIAnyDataCollAddElem calls.
8167 NOTES
8168 No Destruction of the old value is done here. It is the responsibility of
8169 the caller to destroy the old value pointed to by (*data) and set (*data)
8170 to a null pointer before beginning to make a sequence of this call. No
8171 deep copying (of OCIType information nor the data part.) is done in the
8172 returned OCIAnyData. This OCIAnyData cannot be used beyond the allocation
8173 duration of the OCIAnyDataSet (it is like a reference into the
8174 OCIAnyDataSet). The returned OCIAnyData can be reused on subsequent calls
8175 to this function, to sequentially add new data instances to the
8176 OCIAnyDataSet.
8177*/
8178sword OCIAnyDataSetAddInstance(OCISvcCtx *svchp, OCIError *errhp,
8179 OCIAnyDataSet *data_set, OCIAnyData **data);
8180
8181/*
8182 NAME
8183 OCIAnyDataSetEndCreate - OCIAnyDataSet End Creation process.
8184 DESCRIPTION
8185 This call marks the end of OCIAnyDataSet creation. It should be called
8186 after constructing all of its instance(s).
8187 RETURNS
8188 error code.
8189 PARAMETERS
8190 svchp (IN/OUT) - The OCI service context.
8191 errhp (IN/OUT) - The OCI error handle. If there is an error, it is
8192 recorded in errhp and this function returns
8193 OCI_ERROR. Diagnostic information can be obtained
8194 by calling OCIErrorGet().
8195 data_set (IN/OUT) - OCIAnyDataSet that has been fully constructed.
8196*/
8197sword OCIAnyDataSetEndCreate(OCISvcCtx *svchp, OCIError *errhp,
8198 OCIAnyDataSet *data_set);
8199
8200/*
8201 NAME
8202 OCIAnyDataSetGetType - OCIAnyDataSet Get Type of an OCIAnyDataSet
8203 DESCRIPTION
8204 Gets the Type corresponding to an OCIAnyDataSet. It returns the actual
8205 pointer to the type maintained inside an OCIAnyDataSet. No copying is
8206 done for performance reasons. The client is responsible for not using
8207 this type once the OCIAnyDataSet is freed (or its duration ends).
8208 RETURNS
8209 error code.
8210 PARAMETERS
8211 svchp (IN/OUT) - The OCI service context.
8212 errhp (IN/OUT) - The OCI Error handle.
8213 data_set (IN) - Initialized OCIAnyDataSet.
8214 tc (OUT) - The typecode of the type.
8215 type (OUT) - The type corresponding to the OCIAnyDataSet. This
8216 could be null if the OCIAnyData corresponds to a
8217 built-in type.
8218*/
8219sword OCIAnyDataSetGetType (OCISvcCtx *svchp, OCIError *errhp,
8220 OCIAnyDataSet *data_set, OCITypeCode *tc, OCIType **type);
8221
8222/*
8223 NAME
8224 OCIAnyDataSetGetCount - OCIAnyDataSet Get Count of instances.
8225 DESCRIPTION
8226 This call gets the number of instances in the OCIAnyDataSet.
8227 RETURNS
8228 error code.
8229 PARAMETERS
8230 svchp (IN/OUT) - OCI Service Context
8231 errhp (IN/OUT) - OCI Error handle
8232 data_set (IN) - Well formed OCIAnyDataSet.
8233 count (OUT) - number of instances in OCIAnyDataSet
8234*/
8235sword OCIAnyDataSetGetCount(OCISvcCtx *svchp, OCIError *errhp,
8236 OCIAnyDataSet *data_set, ub4 *count);
8237
8238/*
8239 NAME
8240 OCIAnyDataSetGetInstance - OCIAnyDataSet Get next instance.
8241 DESCRIPTION
8242 Only sequential access to the instances in an OCIAnyDataSet is allowed.
8243 This call returns the OCIAnyData corresponding to an instance at the
8244 current position and updates the current position. Subsequently, the
8245 OCIAnyData access routines may be used to access the instance.
8246 RETURNS
8247 error code. Returns OCI_NO_DATA if the current position is at the end of
8248 the set, OCI_SUCCESS otherwise.
8249 PARAMETERS
8250 svchp (IN/OUT) - OCI Service Context
8251 errhp (IN/OUT) - OCI Error handle
8252 data_set (IN) - Well formed OCIAnyDataSet
8253 data (IN/OUT) - OCIAnyData corresponding to the instance. If (*data)
8254 is NULL, a new OCIAnyData will be allocated for same
8255 duration as the OCIAnyDataSet. If (*data) is not NULL
8256 , it will get reused. This OCIAnyData can be
8257 subsequently accessed using the OCIAnyDataAccess()
8258 call or piece-wise by using the OCIAnyDataAttrGet()
8259 call.
8260 NOTE
8261 No Destruction of the old value is done here. It is the responsibility of
8262 the caller to destroy the old value pointed to by (*data) and set (*data)
8263 to a null pointer before beginning to make a sequence of this call. No deep
8264 copying (of OCIType information nor the data part.) is done in the returned
8265 OCIAnyData. This OCIAnyData cannot be used beyond the allocation duration
8266 of the OCIAnyDataSet (it is like a reference into the OCIAnyDataSet). The
8267 returned OCIAnyData can be reused on subsequent calls to this function to
8268 sequentially access the OCIAnyDataSet.
8269*/
8270sword OCIAnyDataSetGetInstance(OCISvcCtx *svchp, OCIError *errhp,
8271 OCIAnyDataSet *data_set, OCIAnyData **data);
8272
8273/*--------------------- End of OCIAnyDataSet interfaces ---------------------*/
8274
8275sword OCIFormatInit(void *hndl, OCIError *err);
8276
8277sword OCIFormatString(void *hndl, OCIError *err, OraText *buffer,
8278 sbig_ora bufferLength, sbig_ora *returnLength,
8279 const OraText *formatString, ...);
8280
8281sword OCIFormatTerm(void *hndl, OCIError *err);
8282
8283sword OCIFormatTUb1(void);
8284sword OCIFormatTUb2(void);
8285sword OCIFormatTUb4(void);
8286sword OCIFormatTUword(void);
8287sword OCIFormatTUbig_ora(void);
8288sword OCIFormatTSb1(void);
8289sword OCIFormatTSb2(void);
8290sword OCIFormatTSb4(void);
8291sword OCIFormatTSword(void);
8292sword OCIFormatTSbig_ora(void);
8293sword OCIFormatTEb1(void);
8294sword OCIFormatTEb2(void);
8295sword OCIFormatTEb4(void);
8296sword OCIFormatTEword(void);
8297sword OCIFormatTChar(void);
8298sword OCIFormatTText(void);
8299sword OCIFormatTDouble(void);
8300sword OCIFormatTDvoid(void);
8301sword OCIFormatTEnd(void);
8302
8303/*-------------------------- Extensions to XA interface ---------------------*/
8304/* ------------------------- xaosvch ----------------------------------------*/
8305/*
8306 NAME
8307 xaosvch - XA Oracle get SerViCe Handle
8308 DESCRIPTION
8309 Given a database name return the service handle that is used by the
8310 XA library
8311 NOTE
8312 This macro has been provided for backward compatibilty with 8.0.2
8313*/
8314OCISvcCtx *xaosvch(OraText *dbname);
8315
8316/* ------------------------- xaoSvcCtx --------------------------------------*/
8317/*
8318 NAME
8319 xaoSvcCtx - XA Oracle get SerViCe ConTeXt
8320 DESCRIPTION
8321 Given a database name return the service handle that is used by the
8322 XA library
8323 NOTE
8324 This routine has been provided for APs to get access to the service
8325 handle that XA library uses. Without this routine APs must use SQLLIB
8326 routine sqlld2 to get access to the Logon data area registered by the
8327 XA library
8328*/
8329OCISvcCtx *xaoSvcCtx(OraText *dbname);
8330
8331/* ------------------------- xaoEnv -----------------------------------------*/
8332/*
8333 NAME
8334 xaoEnv - XA Oracle get ENvironment Handle
8335 DESCRIPTION
8336 Given a database name return the environment handle that is used by the
8337 XA library
8338 NOTE
8339 This routine has been provided for APs to get access to the environment
8340 handle that XA library uses. Without this routine APs must use SQLLIB
8341 routine sqlld2 to get access to the Logon data area registered by the
8342 XA library
8343*/
8344OCIEnv *xaoEnv(OraText *dbname);
8345
8346/* ------------------------- xaosterr ---------------------------------------*/
8347/*
8348 NAME
8349 xaosterr - XA Oracle get xa STart ERRor code
8350 DESCRIPTION
8351 Given an oracle error code return the XA error code
8352 */
8353int xaosterr(OCISvcCtx *svch, sb4 error);
8354/*-------------------------- End Extensions ---------------------------------*/
8355/*---------------------- Extensions to NLS cartridge service ----------------*/
8356/* ----------------------- OCINlsGetInfo ------------------------------------*/
8357/*
8358 NAME
8359 OCINlsGetInfo - Get NLS info from OCI environment handle
8360 REMARKS
8361 This function generates language information specified by item from OCI
8362 environment handle envhp into an array pointed to by buf within size
8363 limitation as buflen.
8364 RETURNS
8365 OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR on wrong item.
8366 envhp(IN/OUT)
8367 OCI environment handle.
8368 errhp(IN/OUT)
8369 The OCI error handle. If there is an error, it is record in errhp and
8370 this function returns a NULL pointer. Diagnostic information can be
8371 obtained by calling OCIErrorGet().
8372 buf(OUT)
8373 Pointer to the destination buffer.
8374 buflen(IN)
8375 The size of destination buffer. The maximum length for each information
8376 is 32 bytes.
8377 item(IN)
8378 It specifies to get which item in OCI environment handle and can be one
8379 of following values:
8380 OCI_NLS_DAYNAME1 : Native name for Monday.
8381 OCI_NLS_DAYNAME2 : Native name for Tuesday.
8382 OCI_NLS_DAYNAME3 : Native name for Wednesday.
8383 OCI_NLS_DAYNAME4 : Native name for Thursday.
8384 OCI_NLS_DAYNAME5 : Native name for Friday.
8385 OCI_NLS_DAYNAME6 : Native name for for Saturday.
8386 OCI_NLS_DAYNAME7 : Native name for for Sunday.
8387 OCI_NLS_ABDAYNAME1 : Native abbreviated name for Monday.
8388 OCI_NLS_ABDAYNAME2 : Native abbreviated name for Tuesday.
8389 OCI_NLS_ABDAYNAME3 : Native abbreviated name for Wednesday.
8390 OCI_NLS_ABDAYNAME4 : Native abbreviated name for Thursday.
8391 OCI_NLS_ABDAYNAME5 : Native abbreviated name for Friday.
8392 OCI_NLS_ABDAYNAME6 : Native abbreviated name for for Saturday.
8393 OCI_NLS_ABDAYNAME7 : Native abbreviated name for for Sunday.
8394 OCI_NLS_MONTHNAME1 : Native name for January.
8395 OCI_NLS_MONTHNAME2 : Native name for February.
8396 OCI_NLS_MONTHNAME3 : Native name for March.
8397 OCI_NLS_MONTHNAME4 : Native name for April.
8398 OCI_NLS_MONTHNAME5 : Native name for May.
8399 OCI_NLS_MONTHNAME6 : Native name for June.
8400 OCI_NLS_MONTHNAME7 : Native name for July.
8401 OCI_NLS_MONTHNAME8 : Native name for August.
8402 OCI_NLS_MONTHNAME9 : Native name for September.
8403 OCI_NLS_MONTHNAME10 : Native name for October.
8404 OCI_NLS_MONTHNAME11 : Native name for November.
8405 OCI_NLS_MONTHNAME12 : Native name for December.
8406 OCI_NLS_ABMONTHNAME1 : Native abbreviated name for January.
8407 OCI_NLS_ABMONTHNAME2 : Native abbreviated name for February.
8408 OCI_NLS_ABMONTHNAME3 : Native abbreviated name for March.
8409 OCI_NLS_ABMONTHNAME4 : Native abbreviated name for April.
8410 OCI_NLS_ABMONTHNAME5 : Native abbreviated name for May.
8411 OCI_NLS_ABMONTHNAME6 : Native abbreviated name for June.
8412 OCI_NLS_ABMONTHNAME7 : Native abbreviated name for July.
8413 OCI_NLS_ABMONTHNAME8 : Native abbreviated name for August.
8414 OCI_NLS_ABMONTHNAME9 : Native abbreviated name for September.
8415 OCI_NLS_ABMONTHNAME10 : Native abbreviated name for October.
8416 OCI_NLS_ABMONTHNAME11 : Native abbreviated name for November.
8417 OCI_NLS_ABMONTHNAME12 : Native abbreviated name for December.
8418 OCI_NLS_YES : Native string for affirmative response.
8419 OCI_NLS_NO : Native negative response.
8420 OCI_NLS_AM : Native equivalent string of AM.
8421 OCI_NLS_PM : Native equivalent string of PM.
8422 OCI_NLS_AD : Native equivalent string of AD.
8423 OCI_NLS_BC : Native equivalent string of BC.
8424 OCI_NLS_DECIMAL : decimal character.
8425 OCI_NLS_GROUP : group separator.
8426 OCI_NLS_DEBIT : Native symbol of debit.
8427 OCI_NLS_CREDIT : Native sumbol of credit.
8428 OCI_NLS_DATEFORMAT : Oracle date format.
8429 OCI_NLS_INT_CURRENCY: International currency symbol.
8430 OCI_NLS_LOC_CURRENCY : Locale currency symbol.
8431 OCI_NLS_LANGUAGE : Language name.
8432 OCI_NLS_ABLANGUAGE : Abbreviation for language name.
8433 OCI_NLS_TERRITORY : Territory name.
8434 OCI_NLS_CHARACTER_SET : Character set name.
8435 OCI_NLS_LINGUISTIC : Linguistic name.
8436 OCI_NLS_CALENDAR : Calendar name.
8437 OCI_NLS_DUAL_CURRENCY : Dual currency symbol.
8438*/
8439sword OCINlsGetInfo(void *envhp, OCIError *errhp, OraText *buf,
8440 size_t buflen, ub2 item);
8441
8442/* ----------------------- OCINlsNumericInfoGet -----------------------------*/
8443/*
8444 NAME
8445 OCINlsNumericInfoGet - Get NLS numeric info from OCI environment handle
8446 REMARKS
8447 This function generates numeric language information specified by item
8448 from OCI environment handle envhp into an output number variable.
8449 RETURNS
8450 OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR on wrong item.
8451 envhp(IN/OUT)
8452 OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE.
8453 errhp(IN/OUT)
8454 The OCI error handle. If there is an error, it is record in errhp and
8455 this function returns a NULL pointer. Diagnostic information can be
8456 obtained by calling OCIErrorGet().
8457 val(OUT)
8458 Pointer to the output number variable. On OCI_SUCCESS return, it will
8459 contain the requested NLS numeric info.
8460 item(IN)
8461 It specifies to get which item in OCI environment handle and can be one
8462 of following values:
8463 OCI_NLS_CHARSET_MAXBYTESZ : Maximum character byte size for OCI
8464 environment or session handle charset
8465 OCI_NLS_CHARSET_FIXEDWIDTH: Character byte size for fixed-width charset;
8466 0 for variable-width charset
8467*/
8468sword OCINlsNumericInfoGet(void *envhp, OCIError *errhp, sb4 *val, ub2 item);
8469
8470/* ----------------------- OCINlsCharSetNameToId ----------------------------*/
8471/*
8472 NAME
8473 OCINlsCharSetNameToId - Get Oracle charset id given Oracle charset name
8474 REMARKS
8475 This function will get the Oracle character set id corresponding to
8476 the given Oracle character set name.
8477 RETURNS
8478 Oracle character set id for the given Oracle character set name if
8479 character set name and OCI handle are valid; otherwise returns 0.
8480 envhp(IN/OUT)
8481 OCI environment handle.
8482 name(IN)
8483 Pointer to a null-terminated Oracle character set name whose id
8484 will be returned.
8485*/
8486ub2 OCINlsCharSetNameToId(void *envhp, const oratext *name);
8487
8488/* ----------------------- OCINlsCharSetIdToName ----------------------------*/
8489/*
8490 NAME
8491 OCINlsCharSetIdToName - Get Oracle charset name given Oracle charset id
8492 REMARKS
8493 This function will get the Oracle character set name corresponding to
8494 the given Oracle character set id.
8495 RETURNS
8496 OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
8497 envhp(IN/OUT)
8498 OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE.
8499 buf(OUT)
8500 Pointer to the destination buffer. On OCI_SUCCESS return, it will contain
8501 the null-terminated string for character set name.
8502 buflen(IN)
8503 Size of destination buffer. Recommended size is OCI_NLS_MAXBUFSZ for
8504 guarantee to store an Oracle character set name. If it's smaller than
8505 the length of the character set name, the function will return OCI_ERROR.
8506 id(IN)
8507 Oracle character set id.
8508*/
8509sword OCINlsCharSetIdToName(void *envhp, oratext *buf, size_t buflen, ub2 id);
8510
8511/* ----------------------- OCINlsNameMap ------------------------------------*/
8512/*
8513 NAME
8514 OCINlsNameMap - Map NLS naming from Oracle to other standards and vice
8515 versa
8516 REMARKS
8517 This function will map NLS naming from Oracle to other standards (such
8518 as ISO, IANA) and vice versa.
8519 RETURNS
8520 OCI_SUCCESS, OCI_INVALID_HANDLE, or OCI_ERROR
8521 envhp(IN/OUT)
8522 OCI environment handle. If handle invalid, returns OCI_INVALID_HANDLE.
8523 buf(OUT)
8524 Pointer to the destination buffer. On OCI_SUCCESS return, it will
8525 contain null-terminated string for requested mapped name.
8526 buflen(IN)
8527 The size of destination buffer. Recommended size is OCI_NLS_MAXBUFSZ
8528 for guarantee to store an NLS name. If it is smaller than the length
8529 of the name, the function will return OCI_ERROR.
8530 srcbuf(IN)
8531 Pointer to null-terminated NLS name. If it is not a valid name in its
8532 define scope, the function will return OCI_ERROR.
8533 flag(IN)
8534 It specifies name mapping direction and can take the following values:
8535 OCI_NLS_CS_IANA_TO_ORA : Map character set name from IANA to Oracle
8536 OCI_NLS_CS_ORA_TO_IANA : Map character set name from Oracle to IANA
8537 OCI_NLS_LANG_ISO_TO_ORA : Map language name from ISO to Oracle
8538 OCI_NLS_LANG_ORA_TO_ISO : Map language name from Oracle to ISO
8539 OCI_NLS_TERR_ISO_TO_ORA : Map territory name from ISO to Oracle
8540 OCI_NLS_TERR_ORA_TO_ISO : Map territory name from Oracle to ISO
8541 OCI_NLS_TERR_ISO3_TO_ORA : Map territory name from 3-letter ISO
8542 abbreviation to Oracle
8543 OCI_NLS_TERR_ORA_TO_ISO3 : Map territory name from Oracle to 3-letter
8544 ISO abbreviation
8545*/
8546sword OCINlsNameMap(void *envhp, oratext *buf, size_t buflen,
8547 const oratext *srcbuf, ub4 flag);
8548
8549/* -------------------- OCIMultiByteToWideChar ------------------------------*/
8550/*
8551 NAME
8552 OCIMultiByteToWideChar - Convert a null terminated multibyte string into
8553 wchar
8554 REMARKS
8555 This routine converts an entire null-terminated string into the wchar
8556 format. The wchar output buffer will be null-terminated.
8557 RETURNS
8558 OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
8559 envhp(IN/OUT)
8560 OCI environment handle to determine the character set of string.
8561 dst (OUT)
8562 Destination buffer for wchar.
8563 src (IN)
8564 Source string to be converted.
8565 rsize (OUT)
8566 Number of characters converted including null-terminator.
8567 If it is a NULL pointer, no number return
8568*/
8569sword OCIMultiByteToWideChar(void *envhp, OCIWchar *dst, const OraText *src,
8570 size_t *rsize);
8571
8572
8573/* --------------------- OCIMultiByteInSizeToWideChar -----------------------*/
8574/*
8575 NAME
8576 OCIMultiByteInSizeToWideChar - Convert a mulitbyte string in length into
8577 wchar
8578 REMARKS
8579 This routine converts part of string into the wchar format. It will
8580 convert as many complete characters as it can until it reaches output
8581 buffer size or input buffer size or it reaches a null-terminator in
8582 source string. The output buffer will be null-terminated if space permits.
8583 If dstsz is zero, this function will only return number of characters not
8584 including ending null terminator for converted string.
8585 RETURNS
8586 OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
8587 envhp(IN/OUT)
8588 OCI environment handle to determine the character set of string.
8589 dst (OUT)
8590 Pointer to a destination buffer for wchar. It can be NULL pointer when
8591 dstsz is zero.
8592 dstsz(IN)
8593 Destination buffer size in character. If it is zero, this function just
8594 returns number of characters will be need for the conversion.
8595 src (IN)
8596 Source string to be converted.
8597 srcsz(IN)
8598 Length of source string in byte.
8599 rsize(OUT)
8600 Number of characters written into destination buffer, or number of
8601 characters for converted string is dstsz is zero.
8602 If it is NULL pointer, nothing to return.
8603*/
8604sword OCIMultiByteInSizeToWideChar(void *envhp, OCIWchar *dst,
8605 size_t dstsz, const OraText *src,
8606 size_t srcsz, size_t *rsize);
8607
8608
8609/* ---------------------- OCIWideCharToMultiByte ----------------------------*/
8610/*
8611 NAME
8612 OCIWideCharToMultiByte - Convert a null terminated wchar string into
8613 multibyte
8614 REMARKS
8615 This routine converts an entire null-terminated wide character string into
8616 multi-byte string. The output buffer will be null-terminated.
8617 RETURNS
8618 OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
8619 envhp(IN/OUT)
8620 OCI environment handle to determine the character set of string.
8621 dst (OUT)
8622 Destination buffer for multi-byte string.
8623 src (IN)
8624 Source wchar string to be converted.
8625 rsize (OUT)
8626 Number of bytes written into the destination buffer.
8627 If it is NULL pointer, nothing to return.
8628*/
8629sword OCIWideCharToMultiByte(void *envhp, OraText *dst, const OCIWchar *src,
8630 size_t *rsize);
8631
8632
8633/* ---------------------- OCIWideCharInSizeToMultiByte ----------------------*/
8634/*
8635 NAME
8636 OCIWideCharInSizeToMultiByte - Convert a wchar string in length into
8637 mulitbyte
8638 REMARKS
8639 This routine converts part of wchar string into the multi-byte format.
8640 It will convert as many complete characters as it can until it reaches
8641 output buffer size or input buffer size or it reaches a null-terminator
8642 in source string. The output buffer will be null-terminated if space
8643 permits. If dstsz is zero, the function just returns the size of byte not
8644 including ending null-terminator need to store the converted string.
8645 RETURNS
8646 OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
8647 envhp(IN/OUT)
8648 OCI environment handle to determine the character set of string.
8649 dst (OUT)
8650 Destination buffer for multi-byte. It can be NULL pointer if dstsz is
8651 zero.
8652 dstsz(IN)
8653 Destination buffer size in byte. If it is zero, it just returns the size
8654 of bytes need for converted string.
8655 src (IN)
8656 Source wchar string to be converted.
8657 srcsz(IN)
8658 Length of source string in character.
8659 rsize(OUT)
8660 Number of bytes written into destination buffer, or number of bytes need
8661 to store the converted string if dstsz is zero.
8662 If it is NULL pointer, nothing to return.
8663*/
8664sword OCIWideCharInSizeToMultiByte(void *envhp, OraText *dst,
8665 size_t dstsz, const OCIWchar *src,
8666 size_t srcsz, size_t *rsize);
8667
8668
8669
8670/* ----------------------- OCIWideCharIsAlnum -------------------------------*/
8671/*
8672 NAME
8673 OCIWideCharIsAlnum - test whether wc is a letter or decimal digit
8674 REMARKS
8675 It tests whether wc is a letter or decimal digit.
8676 RETURNS
8677 TRUE or FLASE.
8678 envhp(IN/OUT)
8679 OCI environment handle to determine the character set .
8680 wc(IN)
8681 Wchar for testing.
8682*/
8683boolean OCIWideCharIsAlnum(void *envhp, OCIWchar wc);
8684
8685
8686/* ----------------------- OCIWideCharIsAlpha -------------------------------*/
8687/*
8688 NAME
8689 OCIWideCharIsAlpha - test whether wc is an alphabetic letter
8690 REMARKS
8691 It tests whether wc is an alphabetic letter
8692 RETURNS
8693 TRUE or FLASE.
8694 envhp(IN/OUT)
8695 OCI environment handle to determine the character set .
8696 wc(IN)
8697 Wchar for testing.
8698*/
8699boolean OCIWideCharIsAlpha(void *envhp, OCIWchar wc);
8700
8701
8702/* --------------------- OCIWideCharIsCntrl ---------------------------------*/
8703/*
8704 NAME
8705 OCIWideCharIsCntrl - test whether wc is a control character
8706 REMARKS
8707 It tests whether wc is a control character.
8708 RETURNS
8709 TRUE or FLASE.
8710 envhp(IN/OUT)
8711 OCI environment handle to determine the character set .
8712 wc(IN)
8713 Wchar for testing.
8714*/
8715boolean OCIWideCharIsCntrl(void *envhp, OCIWchar wc);
8716
8717
8718/* ----------------------- OCIWideCharIsDigit -------------------------------*/
8719/*
8720 NAME
8721 OCIWideCharIsDigit - test whether wc is a decimal digit character
8722 REMARKS
8723 It tests whether wc is a decimal digit character.
8724 RETURNS
8725 TRUE or FLASE.
8726 envhp(IN/OUT)
8727 OCI environment handle to determine the character set .
8728 wc(IN)
8729 Wchar for testing.
8730*/
8731boolean OCIWideCharIsDigit(void *envhp, OCIWchar wc);
8732
8733
8734/* ----------------------- OCIWideCharIsGraph -------------------------------*/
8735/*
8736 NAME
8737 OCIWideCharIsGraph - test whether wc is a graph character
8738 REMARKS
8739 It tests whether wc is a graph character. A graph character is character
8740 with a visible representation and normally includes alphabetic letter,
8741 decimal digit, and punctuation.
8742 RETURNS
8743 TRUE or FLASE.
8744 envhp(IN/OUT)
8745 OCI environment handle to determine the character set .
8746 wc(IN)
8747 Wchar for testing.
8748*/
8749boolean OCIWideCharIsGraph(void *envhp, OCIWchar wc);
8750
8751
8752/* ----------------------- OCIWideCharIsLower -------------------------------*/
8753/*
8754 NAME
8755 OCIWideCharIsLower - test whether wc is a lowercase letter
8756 REMARKS
8757 It tests whether wc is a lowercase letter.
8758 RETURNS
8759 TRUE or FLASE.
8760 envhp(IN/OUT)
8761 OCI environment handle to determine the character set .
8762 wc(IN)
8763 Wchar for testing.
8764*/
8765boolean OCIWideCharIsLower(void *envhp, OCIWchar wc);
8766
8767
8768/* ----------------------- OCIWideCharIsPrint -------------------------------*/
8769/*
8770 NAME
8771 OCIWideCharIsPrint - test whether wc is a printable character
8772 REMARKS
8773 It tests whether wc is a printable character.
8774 RETURNS
8775 TRUE or FLASE.
8776 envhp(IN/OUT)
8777 OCI environment handle to determine the character set .
8778 wc(IN)
8779 Wchar for testing.
8780*/
8781boolean OCIWideCharIsPrint(void *envhp, OCIWchar wc);
8782
8783
8784/* ----------------------- OCIWideCharIsPunct -------------------------------*/
8785/*
8786 NAME
8787 OCIWideCharIsPunct - test whether wc is a punctuation character
8788 REMARKS
8789 It tests whether wc is a punctuation character.
8790 RETURNS
8791 TRUE or FLASE.
8792 envhp(IN/OUT)
8793 OCI environment handle to determine the character set .
8794 wc(IN)
8795 Wchar for testing.
8796*/
8797boolean OCIWideCharIsPunct(void *envhp, OCIWchar wc);
8798
8799
8800/* ----------------------- OCIWideCharIsSpace -------------------------------*/
8801/*
8802 NAME
8803 OCIWideCharIsSpace - test whether wc is a space character
8804 REMARKS
8805 It tests whether wc is a space character. A space character only causes
8806 white space in displayed text(for example, space, tab, carriage return,
8807 newline, vertical tab or form feed).
8808 RETURNS
8809 TRUE or FLASE.
8810 envhp(IN/OUT)
8811 OCI environment handle to determine the character set .
8812 wc(IN)
8813 Wchar for testing.
8814*/
8815boolean OCIWideCharIsSpace(void *envhp, OCIWchar wc);
8816
8817
8818/* ----------------------- OCIWideCharIsUpper -------------------------------*/
8819/*
8820 NAME
8821 OCIWideCharIsUpper - test whether wc is a uppercase letter
8822 REMARKS
8823 It tests whether wc is a uppercase letter.
8824 RETURNS
8825 TRUE or FLASE.
8826 envhp(IN/OUT)
8827 OCI environment handle to determine the character set .
8828 wc(IN)
8829 Wchar for testing.
8830*/
8831boolean OCIWideCharIsUpper(void *envhp, OCIWchar wc);
8832
8833
8834/*----------------------- OCIWideCharIsXdigit -------------------------------*/
8835/*
8836 NAME
8837 OCIWideCharIsXdigit - test whether wc is a hexadecimal digit
8838 REMARKS
8839 It tests whether wc is a hexadecimal digit ( 0-9, A-F, a-f ).
8840 RETURNS
8841 TRUE or FLASE.
8842 envhp(IN/OUT)
8843 OCI environment handle to determine the character set .
8844 wc(IN)
8845 Wchar for testing.
8846*/
8847boolean OCIWideCharIsXdigit(void *envhp, OCIWchar wc);
8848
8849
8850/* --------------------- OCIWideCharIsSingleByte ----------------------------*/
8851/*
8852 NAME
8853 OCIWideCharIsSingleByte - test whether wc is a single-byte character
8854 REMARKS
8855 It tests whether wc is a single-byte character when converted into
8856 multi-byte.
8857 RETURNS
8858 TRUE or FLASE.
8859 envhp(IN/OUT)
8860 OCI environment handle to determine the character set .
8861 wc(IN)
8862 Wchar for testing.
8863*/
8864boolean OCIWideCharIsSingleByte(void *envhp, OCIWchar wc);
8865
8866
8867/* ----------------------- OCIWideCharToLower -------------------------------*/
8868/*
8869 NAME
8870 OCIWideCharToLower - Convert a wchar into the lowercase
8871 REMARKS
8872 If there is a lower-case character mapping for wc in the specified locale,
8873 it will return the lower-case in wchar, else return wc itself.
8874 RETURNS
8875 A wchar
8876 envhp(IN/OUT)
8877 OCI environment handle to determine the character set .
8878 wc(IN)
8879 Wchar for lowercase mapping.
8880*/
8881OCIWchar OCIWideCharToLower(void *envhp, OCIWchar wc);
8882
8883
8884/* ----------------------- OCIWideCharToUpper -------------------------------*/
8885/*
8886 NAME
8887 OCIWideCharToUpper - Convert a wchar into the uppercase
8888 REMARKS
8889 If there is a upper-case character mapping for wc in the specified locale,
8890 it will return the upper-case in wchar, else return wc itself.
8891 RETURNS
8892 A wchar
8893 envhp(IN/OUT)
8894 OCI environment handle to determine the character set .
8895 wc(IN)
8896 Wchar for uppercase mapping.
8897*/
8898OCIWchar OCIWideCharToUpper(void *envhp, OCIWchar wc);
8899
8900
8901/* ----------------------- OCIWideCharStrcmp --------------------------------*/
8902/*
8903 NAME
8904 OCIWideCharStrcmp - compare two null terminated wchar string
8905 REMARKS
8906 It compares two wchar string in binary ( based on wchar encoding value ),
8907 linguistic, or case-insensitive.
8908 RETURNS
8909 0, if wstr1 == wstr2.
8910 Positive, if wstr1 > wstr2.
8911 Negative, if wstr1 < wstr2.
8912 envhp(IN/OUT)
8913 OCI environment handle to determine the character set.
8914 wstr1(IN)
8915 Pointer to a null-terminated wchar string.
8916 wstr2(IN)
8917 Pointer to a null-terminated wchar string.
8918 flag(IN)
8919 It is used to decide the comparison method. It can be taken one of the
8920 following values:
8921 OCI_NLS_BINARY : for the binary comparison, this is default value.
8922 OCI_NLS_LINGUISTIC : for linguistic comparison specified in the locale.
8923 This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive
8924 comparison.
8925*/
8926int OCIWideCharStrcmp(void *envhp, const OCIWchar *wstr1,
8927 const OCIWchar *wstr2, int flag);
8928
8929
8930/* ----------------------- OCIWideCharStrncmp -------------------------------*/
8931/*
8932 NAME
8933 OCIWideCharStrncmp - compare twe wchar string in length
8934 REMARKS
8935 This function is similar to OCIWideCharStrcmp(), except that at most len1
8936 characters from wstr1 and len2 characters from wstr1 are compared. The
8937 null-terminator will be taken into the comparison.
8938 RETURNS
8939 0, if wstr1 = wstr2
8940 Positive, if wstr1 > wstr2
8941 Negative, if wstr1 < wstr2
8942 envhp(IN/OUT)
8943 OCI environment handle to determine the character set .
8944 wstr1(IN)
8945 Pointer to the first wchar string
8946 len1(IN)
8947 The length for the first string for comparison
8948 wstr2(IN)
8949 Pointer to the second wchar string
8950 len2(IN)
8951 The length for the second string for comparison.
8952 flag(IN)
8953 It is used to decide the comparison method. It can be taken one of the
8954 following values:
8955 OCI_NLS_BINARY : for the binary comparison, this is default value.
8956 OCI_NLS_LINGUISTIC : for linguistic comparison specified in the locale.
8957 This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive
8958 comparison.
8959*/
8960int OCIWideCharStrncmp(void *envhp, const OCIWchar *wstr1, size_t len1,
8961 const OCIWchar *wstr2, size_t len2, int flag);
8962
8963
8964/* ----------------------- OCIWideCharStrcat --------------------------------*/
8965/*
8966 NAME
8967 OCIWideCharStrcat - concatenate two wchar strings
8968 REMARKS
8969 This function appends a copy of the wchar string pointed to by wsrcstr,
8970 including the null-terminator to the end of wchar string pointed to by
8971 wdststr. It returns the number of character in the result string not
8972 including the ending null-terminator.
8973 RETURNS
8974 number of characters in the result string not including the ending
8975 null-terminator.
8976 envhp(IN/OUT)
8977 OCI environment handle to determine the character set .
8978 wdststr(IN/OUT)
8979 Pointer to the destination wchar string for appending.
8980 wsrcstr(IN)
8981 Pointer to the source wchar string to append.
8982*/
8983size_t OCIWideCharStrcat(void *envhp, OCIWchar *wdststr,
8984 const OCIWchar *wsrcstr);
8985
8986
8987/* ----------------------- OCIWideCharStrchr --------------------------------*/
8988/*
8989 NAME
8990 OCIWideCharStrchr - Search the first occurrence of wchar in a wchar string
8991 REMARKS
8992 This function searchs for the first occurrence of wc in the wchar string
8993 pointed to by wstr. It returns a pointer to the whcar if successful, or
8994 a null pointer.
8995 RETURNS
8996 wchar pointer if successful, otherwise a null pointer.
8997 envhp(IN/OUT)
8998 OCI environment handle to determine the character set .
8999 wstr(IN)
9000 Pointer to the wchar string to search
9001 wc(IN)
9002 Wchar to search for.
9003*/
9004OCIWchar *OCIWideCharStrchr(void *envhp, const OCIWchar *wstr,
9005 OCIWchar wc);
9006
9007
9008/* ----------------------- OCIWideCharStrcpy --------------------------------*/
9009/*
9010 NAME
9011 OCIWideCharStrcpy - copy a wchar string
9012 REMARKS
9013 This function copies the wchar string pointed to by wsrcstr, including the
9014 null-terminator, into the array pointed to by wdststr. It returns the
9015 number of character copied not including the ending null-terminator.
9016 RETURNS
9017 number of characters copied not including the ending null-terminator.
9018 envhp(IN/OUT)
9019 OCI environment handle to determine the character set .
9020 wdststr(OUT)
9021 Pointer to the destination wchar buffer.
9022 wsrcstr(IN)
9023 Pointer to the source wchar string.
9024*/
9025size_t OCIWideCharStrcpy(void *envhp, OCIWchar *wdststr,
9026 const OCIWchar *wsrcstr);
9027
9028
9029/* ----------------------- OCIWideCharStrlen --------------------------------*/
9030/*
9031 NAME
9032 OCIWideCharStrlen - Return number of character in a wchar string
9033 REMARKS
9034 This function computes the number of characters in the wchar string
9035 pointed to by wstr, not including the null-terminator, and returns
9036 this number.
9037 RETURNS
9038 number of characters not including ending null-terminator.
9039 envhp(IN/OUT)
9040 OCI environment handle to determine the character set .
9041 wstr(IN)
9042 Pointer to the source wchar string.
9043*/
9044size_t OCIWideCharStrlen(void *envhp, const OCIWchar *wstr);
9045
9046
9047/* ----------------------- OCIWideCharStrncat -------------------------------*/
9048/*
9049 NAME
9050 OCIWideCharStrncat - Concatenate wchar string in length
9051 REMARKS
9052 This function is similar to OCIWideCharStrcat(), except that at most n
9053 characters from wsrcstr are appended to wdststr. Note that the
9054 null-terminator in wsrcstr will stop appending. wdststr will be
9055 null-terminated..
9056 RETURNS
9057 Number of characters in the result string not including the ending
9058 null-terminator.
9059 envhp(IN/OUT)
9060 OCI environment handle to determine the character set .
9061 wdststr(IN/OUT)
9062 Pointer to the destination wchar string for appending.
9063 wsrcstr(IN)
9064 Pointer to the source wchar string to append.
9065 n(IN)
9066 Number of characters from wsrcstr to append.
9067*/
9068size_t OCIWideCharStrncat(void *envhp, OCIWchar *wdststr,
9069 const OCIWchar *wsrcstr, size_t n);
9070
9071
9072/* ----------------------- OCIWideCharStrncpy -------------------------------*/
9073/*
9074 NAME
9075 OCIWideCharStrncpy - Copy wchar string in length
9076 REMARKS
9077 This function is similar to OCIWideCharStrcpy(), except that at most n
9078 characters are copied from the array pointed to by wsrcstr to the array
9079 pointed to by wdststr. Note that the null-terminator in wdststr will
9080 stop coping and result string will be null-terminated.
9081 RETURNS
9082 number of characters copied not including the ending null-terminator.
9083 envhp(IN/OUT)
9084 OCI environment handle to determine the character set .
9085 wdststr(OUT)
9086 Pointer to the destination wchar buffer.
9087 wsrcstr(IN)
9088 Pointer to the source wchar string.
9089 n(IN)
9090 Number of characters from wsrcstr to copy.
9091*/
9092size_t OCIWideCharStrncpy(void *envhp, OCIWchar *wdststr,
9093 const OCIWchar *wsrcstr, size_t n);
9094
9095
9096/* ----------------------- OCIWideCharStrrchr -------------------------------*/
9097/*
9098 NAME
9099 OCIWideCharStrrchr - search the last occurrence of a wchar in wchar string
9100 REMARKS
9101 This function searchs for the last occurrence of wc in the wchar string
9102 pointed to by wstr. It returns a pointer to the whcar if successful, or
9103 a null pointer.
9104 RETURNS
9105 wchar pointer if successful, otherwise a null pointer.
9106 envhp(IN/OUT)
9107 OCI environment handle to determine the character set .
9108 wstr(IN)
9109 Pointer to the wchar string to search
9110 wc(IN)
9111 Wchar to search for.
9112*/
9113OCIWchar *OCIWideCharStrrchr(void *envhp, const OCIWchar *wstr,
9114 OCIWchar wc);
9115
9116
9117/* --------------------- OCIWideCharStrCaseConversion -----------------------*/
9118/*
9119 NAME
9120 OCIWideCharStrCaseConversion - convert a wchar string into lowercase or
9121 uppercase
9122 REMARKS
9123 This function convert the wide char string pointed to by wsrcstr into the
9124 uppercase or lowercase specified by flag and copies the result into the
9125 array pointed to by wdststr. The result string will be null-terminated.
9126 RETURNS
9127 number of characters for result string not including null-terminator.
9128 envhp(IN/OUT)
9129 OCI environment handle.
9130 wdststr(OUT)
9131 Pointer to destination array.
9132 wsrcstr(IN)
9133 Pointer to source string.
9134 flag(IN)
9135 Specify the case to convert:
9136 OCI_NLS_UPPERCASE : convert to uppercase.
9137 OCI_NLS_LOWERCASE: convert to lowercase.
9138 This flag can be ORed with OCI_NLS_LINGUISTIC to specify that the
9139 linguistic setting in the locale will be used for case conversion.
9140*/
9141size_t OCIWideCharStrCaseConversion(void *envhp, OCIWchar *wdststr,
9142 const OCIWchar *wsrcstr, ub4 flag);
9143
9144
9145/*---------------------- OCIWideCharDisplayLength ---------------------------*/
9146/*
9147 NAME
9148 OCIWideCharDisplayLength - Calculate the display length for a wchar
9149 REMARKS
9150 This function determines the number of column positions required for wc
9151 in display. It returns number of column positions, or 0 if wc is
9152 null-terminator.
9153 RETURNS
9154 Number of display positions.
9155 envhp(IN/OUT)
9156 OCI environment handle to determine the character set .
9157 wc(IN)
9158 Wchar character.
9159*/
9160size_t OCIWideCharDisplayLength(void *envhp, OCIWchar wc );
9161
9162
9163/*---------------------- OCIWideCharMultiByteLength -------------------------*/
9164/*
9165 NAME
9166 OCIWideCharMultiByteLength - Determine byte size in multi-byte encoding
9167 REMARKS
9168 This function determines the number of byte required for wc in multi-byte
9169 encoding. It returns number of bytes in multi-byte for wc.
9170 RETURNS
9171 Number of bytes.
9172 envhp(IN/OUT)
9173 OCI environment handle to determine the character set .
9174 wc(IN)
9175 Wchar character.
9176*/
9177size_t OCIWideCharMultiByteLength(void *envhp, OCIWchar wc);
9178
9179
9180/* ----------------------- OCIMultiByteStrcmp -------------------------------*/
9181/*
9182 NAME
9183 OCIMultiByteStrcmp - Compare two multi-byte strings
9184 REMARKS
9185 It compares two multi-byte strings in binary ( based on encoding value ),
9186 linguistic, or case-insensitive.
9187 RETURNS
9188 0, if str1 == str2.
9189 Positive, if str1 > str2.
9190 Negative, if str1 < str2.
9191 envhp(IN/OUT)
9192 OCI environment handle to determine the character set.
9193 str1(IN)
9194 Pointer to a null-terminated string.
9195 str2(IN)
9196 Pointer to a null-terminated string.
9197 flag(IN)
9198 It is used to decide the comparison method. It can be taken one of the
9199 following values:
9200 OCI_NLS_BINARY: for the binary comparison, this is default value.
9201 OCI_NLS_LINGUISTIC: for linguistic comparison specified in the locale.
9202 This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive
9203 comparison.
9204*/
9205int OCIMultiByteStrcmp(void *envhp, const OraText *str1,
9206 const OraText *str2, int flag);
9207
9208
9209/*----------------------- OCIMultiByteStrncmp -------------------------------*/
9210/*
9211 NAME
9212 OCIMultiByteStrncmp - compare two strings in length
9213 REMARKS
9214 This function is similar to OCIMultiBytestrcmp(), except that at most
9215 len1 bytes from str1 and len2 bytes from str2 are compared. The
9216 null-terminator will be taken into the comparison.
9217 RETURNS
9218 0, if str1 = str2
9219 Positive, if str1 > str2
9220 Negative, if str1 < str2
9221 envhp(IN/OUT)
9222 OCI environment handle to determine the character set.
9223 str1(IN)
9224 Pointer to the first string
9225 len1(IN)
9226 The length for the first string for comparison
9227 str2(IN)
9228 Pointer to the second string
9229 len2(IN)
9230 The length for the second string for comparison.
9231 flag(IN)
9232 It is used to decide the comparison method. It can be taken one of the
9233 following values:
9234 OCI_NLS_BINARY: for the binary comparison, this is default value.
9235 OCI_NLS_LINGUISTIC: for linguistic comparison specified in the locale.
9236 This flag can be ORed with OCI_NLS_CASE_INSENSITIVE for case-insensitive
9237 comparison.
9238*/
9239int OCIMultiByteStrncmp(void *envhp, const OraText *str1, size_t len1,
9240 OraText *str2, size_t len2, int flag);
9241
9242
9243/*----------------------- OCIMultiByteStrcat --------------------------------*/
9244/*
9245 NAME
9246 OCIMultiByteStrcat - concatenate multibyte strings
9247 REMARKS
9248 This function appends a copy of the multi-byte string pointed to by
9249 srcstr, including the null-terminator to the end of string pointed to by
9250 dststr. It returns the number of bytes in the result string not including
9251 the ending null-terminator.
9252 RETURNS
9253 number of bytes in the result string not including the ending
9254 null-terminator.
9255 envhp(IN/OUT)
9256 Pointer to OCI environment handle
9257 dststr(IN/OUT)
9258 Pointer to the destination multi-byte string for appending.
9259 srcstr(IN)
9260 Pointer to the source string to append.
9261*/
9262size_t OCIMultiByteStrcat(void *envhp, OraText *dststr,
9263 const OraText *srcstr);
9264
9265
9266/*------------------------- OCIMultiByteStrcpy ------------------------------*/
9267/*
9268 NAME
9269 OCIMultiByteStrcpy - copy multibyte string
9270 REMARKS
9271 This function copies the multi-byte string pointed to by srcstr,
9272 including the null-terminator, into the array pointed to by dststr. It
9273 returns the number of bytes copied not including the ending
9274 null-terminator.
9275 RETURNS
9276 number of bytes copied not including the ending null-terminator.
9277 envhp(IN/OUT)
9278 Pointer to the OCI environment handle.
9279 srcstr(OUT)
9280 Pointer to the destination buffer.
9281 dststr(IN)
9282 Pointer to the source multi-byte string.
9283*/
9284size_t OCIMultiByteStrcpy(void *envhp, OraText *dststr,
9285 const OraText *srcstr);
9286
9287
9288/*----------------------- OCIMultiByteStrlen --------------------------------*/
9289/*
9290 NAME
9291 OCIMultiByteStrlen - Calculate multibyte string length
9292 REMARKS
9293 This function computes the number of bytes in the multi-byte string
9294 pointed to by str, not including the null-terminator, and returns this
9295 number.
9296 RETURNS
9297 number of bytes not including ending null-terminator.
9298 str(IN)
9299 Pointer to the source multi-byte string.
9300*/
9301size_t OCIMultiByteStrlen(void *envhp, const OraText *str);
9302
9303
9304/*----------------------- OCIMultiByteStrncat -------------------------------*/
9305/*
9306 NAME
9307 OCIMultiByteStrncat - concatenate string in length
9308 REMARKS
9309 This function is similar to OCIMultiBytestrcat(), except that at most n
9310 bytes from srcstr are appended to dststr. Note that the null-terminator in
9311 srcstr will stop appending and the function will append as many character
9312 as possible within n bytes. dststr will be null-terminated.
9313 RETURNS
9314 Number of bytes in the result string not including the ending
9315 null-terminator.
9316 envhp(IN/OUT)
9317 Pointer to OCI environment handle.
9318 srcstr(IN/OUT)
9319 Pointer to the destination multi-byte string for appending.
9320 dststr(IN)
9321 Pointer to the source multi-byte string to append.
9322 n(IN)
9323 Number of bytes from srcstr to append.
9324*/
9325size_t OCIMultiByteStrncat(void *envhp, OraText *dststr,
9326 const OraText *srcstr, size_t n);
9327
9328
9329/*----------------------- OCIMultiByteStrncpy -------------------------------*/
9330/*
9331 NAME
9332 OCIMultiByteStrncpy - copy multibyte string in length
9333 REMARKS
9334 This function is similar to OCIMultiBytestrcpy(), except that at most n
9335 bytes are copied from the array pointed to by srcstr to the array pointed
9336 to by dststr. Note that the null-terminator in srcstr will stop coping and
9337 the function will copy as many character as possible within n bytes. The
9338 result string will be null-terminated.
9339 RETURNS
9340 number of bytes copied not including the ending null-terminator.
9341 envhp(IN/OUT)
9342 Pointer to a OCI environment handle.
9343 dststr(IN)
9344 Pointer to the source multi-byte string.
9345 srcstr(OUT)
9346 Pointer to the destination buffer.
9347 n(IN)
9348 Number of bytes from srcstr to copy.
9349*/
9350size_t OCIMultiByteStrncpy(void *envhp, OraText *dststr,
9351 const OraText *srcstr, size_t n);
9352
9353
9354/*----------------------- OCIMultiByteStrnDisplayLength ---------------------*/
9355/*
9356 NAME
9357 OCIMultiByteStrnDisplayLength - calculate the display length for a
9358 multibyt string
9359 REMARKS
9360 This function returns the number of display positions occupied by the
9361 complete characters within the range of n bytes.
9362 RETURNS
9363 number of display positions.
9364 envhp(IN/OUT)
9365 OCI environment handle.
9366 str(IN)
9367 Pointer to a multi-byte string.
9368 n(IN)
9369 Number of bytes to examine.
9370*/
9371size_t OCIMultiByteStrnDisplayLength(void *envhp, const OraText *str1,
9372 size_t n);
9373
9374
9375/*---------------------- OCIMultiByteStrCaseConversion ---------------------*/
9376/*
9377 NAME
9378 OCIMultiByteStrCaseConversion
9379 REMARKS
9380 This function convert the multi-byte string pointed to by srcstr into the
9381 uppercase or lowercase specified by flag and copies the result into the
9382 array pointed to by dststr. The result string will be null-terminated.
9383 RETURNS
9384 number of bytes for result string not including null-terminator.
9385 envhp(IN/OUT)
9386 OCI environment handle.
9387 dststr(OUT)
9388 Pointer to destination array.
9389 srcstr(IN)
9390 Pointer to source string.
9391 flag(IN)
9392 Specify the case to convert:
9393 OCI_NLS_UPPERCASE: convert to uppercase.
9394 OCI_NLS_LOWERCASE: convert to lowercase.
9395 This flag can be ORed with OCI_NLS_LINGUISTIC to specify that the
9396 linguistic setting in the locale will be used for case conversion.
9397*/
9398size_t OCIMultiByteStrCaseConversion(void *envhp, OraText *dststr,
9399 const OraText *srcstr, ub4 flag);
9400
9401
9402/*------------------------- OCICharSetToUnicode -----------------------------*/
9403/*
9404 NAME
9405 OCICharSetToUnicode - convert multibyte string into Unicode as UCS2
9406 REMARKS
9407 This function converts a multi-byte string pointed to by src to Unicode
9408 into the array pointed to by dst. The conversion will stop when it reach
9409 to the source limitation or destination limitation.
9410 The function will return number of characters converted into Unicode.
9411 If dstlen is zero, it will just return the number of characters for the
9412 result without real conversion.
9413 RETURNS
9414 OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
9415 envhp(IN/OUT)
9416 Pointer to an OCI environment handle
9417 dst(OUT)
9418 Pointer to a destination buffer
9419 dstlen(IN)
9420 Size of destination buffer in character
9421 src(IN)
9422 Pointer to multi-byte source string.
9423 srclen(IN)
9424 Size of source string in bytes.
9425 rsize(OUT)
9426 Number of characters converted.
9427 If it is a NULL pointer, nothing to return.
9428*/
9429sword OCICharSetToUnicode(void *envhp, ub2 *dst, size_t dstlen,
9430 const OraText *src, size_t srclen, size_t *rsize);
9431
9432
9433/*------------------------- OCIUnicodeToCharSet -----------------------------*/
9434/*
9435 NAME
9436 OCIUnicodeToCharSet - convert Unicode into multibyte
9437 REMARKS
9438 This function converts a Unicode string pointed to by src to multi-byte
9439 into the array pointed to by dst. The conversion will stop when it reach
9440 to the source limitation or destination limitation. The function will
9441 return number of bytes converted into multi-byte. If dstlen is zero, it
9442 will just return the number of bytes for the result without real
9443 conversion. If a Unicode character is not convertible for the character
9444 set specified in OCI environment handle, a replacement character will be
9445 used for it. In this case, OCICharSetConversionIsReplacementUsed() will
9446 return ture.
9447 RETURNS
9448 OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
9449 envhp(IN/OUT)
9450 Pointer to an OCI environment handle.
9451 dst(OUT)
9452 Pointer to a destination buffer.
9453 dstlen(IN)
9454 Size of destination buffer in byte.
9455 src(IN)
9456 Pointer to a Unicode string.
9457 srclen(IN)
9458 Size of source string in characters.
9459 rsize(OUT)
9460 Number of bytes converted.
9461 If it is a NULL pointer, nothing to return.
9462*/
9463sword OCIUnicodeToCharSet(void *envhp, OraText *dst, size_t dstlen,
9464 const ub2 *src, size_t srclen, size_t *rsize);
9465
9466/*----------------------- OCINlsCharSetConvert ------------------------------*/
9467/*
9468 NAME
9469 OCINlsCharSetConvert - convert between any two character set.
9470 REMARKS
9471 This function converts a string pointed to by src in the character set
9472 specified with srcid to the array pointed to by dst in the character set
9473 specified with dstid. The conversion will stop when it reaches the source
9474 limitation or destination limitation. The function will return the number
9475 of bytes converted into the destination buffer. Even though either source
9476 or destination character set id is OCI_UTF16ID, given and return data
9477 length will be represented with the byte length as this function is
9478 intended for generic purpose. Note the conversion will not stop at null
9479 data.
9480 To get character set id from name, OCINlsCharSetNameToId can be used.
9481 To check if derived data in the destination buffer contains any
9482 replacement character resulting from conversion failure,
9483 OCICharSetConversionIsReplacementUsed can be used to get the status.
9484 Data alignment should be guaranteed by a caller. For example, UTF-16 data
9485 should be aligned to ub2 type.
9486
9487 RETURNS
9488 OCI_SUCCESS or OCI_ERROR.
9489 errhp(IN/OUT)
9490 OCI error handle. If there is an error, it is recorded in errhp and this
9491 function returns a NULL pointer. Diagnostic information can be obtained
9492 by calling OCIErrorGet().
9493 dstid(IN)
9494 Character set id for the destination buffer.
9495 dstp(OUT)
9496 Pointer to the destination buffer.
9497 dstlen(IN)
9498 The maximum byte size of destination buffer.
9499 srcid(IN)
9500 Character set id for the source buffer.
9501 srcp(IN)
9502 Pointer to the source buffer.
9503 srclen(IN)
9504 The length byte size of source buffer.
9505 rsize(OUT)
9506 The number of characters converted. If it is a NULL pointer, nothing to
9507 return.
9508*/
9509sword OCINlsCharSetConvert(void *envhp, OCIError *errhp,
9510 ub2 dstid, void *dstp, size_t dstlen,
9511 ub2 srcid, const void *srcp, size_t srclen,
9512 size_t *rsize);
9513
9514
9515/* ------------------- OCICharsetConversionIsReplacementUsed ----------------*/
9516/*
9517 NAME
9518 OCICharsetConversionIsReplacementUsed - chech if replacement is used in
9519 conversion
9520 REMARKS
9521 This function indicates whether or not the replacement character was used
9522 for nonconvertible characters in character set conversion in last invoke
9523 of OCICharsetUcs2ToMb().
9524 RETURNS
9525 TRUE is the replacement character was used in last OCICharsetUcs2ToMb()
9526 invoking, else FALSE.
9527 envhp(IN/OUT)
9528 OCI environment handle. This should be the first handle passed to
9529 OCICharsetUcs2ToMb().
9530*/
9531boolean OCICharSetConversionIsReplacementUsed(void *envhp);
9532
9533/*------------------- OCINlsEnvironmentVariableGet -----------------*/
9534/*
9535 NAME
9536 OCINlsEnvironmentVariableGet - get a value of NLS environment variable.
9537
9538 DESCRIPTION
9539 This function retrieves a value of NLS environment variable to the buffer
9540 pointed to by val. Data type is determined by the parameter specified by
9541 item. Either numeric data or string data can be retrieved.
9542
9543 RETURNS
9544 OCI_SUCCESS or OCI_ERROR.
9545
9546 PARAMETERS
9547 valp(OUT) -
9548 Pointer to the buffer.
9549 size(IN) -
9550 Size of the buffer. This argument is only applicable to string data type,
9551 but not to numerical data, in such case, it is ignored.
9552 item(IN) -
9553 NLS item value, which can be one of following values:
9554 OCI_NLS_CHARSET_ID - NLS_LANG character set id in ub2 data type.
9555 OCI_NLS_NCHARSET_ID - NLS_NCHAR character set id in ub2 data type.
9556 charset(IN) -
9557 Character set id for retrieved string data. If it is 0, NLS_LANG will be
9558 used. OCI_UTF16ID is a valid id. In case of numeric data, this argument
9559 is ignored.
9560 rsize(OUT) -
9561 Size of return value.
9562
9563 NOTE
9564 This functions is mainly used for retrieving character set id from either
9565 NLS_LANG or NLS_NCHAR environment variables. If NLS_LANG is not set,
9566 the default character set id is returned.
9567 For future extension, the buffer is capable for storing other data types.
9568*/
9569sword OCINlsEnvironmentVariableGet(void *valp, size_t size, ub2 item,
9570 ub2 charset, size_t *rsize);
9571
9572
9573/*------------------------- OCIMessageOpen ----------------------------------*/
9574/*
9575 NAME
9576 OCIMessageOpen - open a locale message file
9577 REMARKS
9578 This function opens a message handle for facility of product in a language
9579 pointed to by envhp. It first try to open the message file corresponding
9580 to envhp for the facility. If it successes, it will use that file to
9581 initialize a message handle, else it will use the default message file
9582 which is for American language for the facility. The function return a
9583 pointer pointed to a message handle into msghp parameter.
9584 RETURNS
9585 OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
9586 envhp(IN/OUT)
9587 A pointer to OCI environment handle for message language.
9588 errhp(IN/OUT)
9589 The OCI error handle. If there is an error, it is record in errhp and this
9590 function returns a NULL pointer. Diagnostic information can be obtained by
9591 calling OCIErrorGet().
9592 msghp(OUT)
9593 a message handle for return
9594 product(IN)
9595 A pointer to a product name. Product name is used to locate the directory
9596 for message in a system dependent way. For example, in Solaris, the
9597 directory of message files for the product `rdbms' is
9598 `${ORACLE_HOME}/rdbms'.
9599 facility(IN)
9600 A pointer to a facility name in the product. It is used to construct a
9601 message file name. A message file name follows the conversion with
9602 facility as prefix. For example, the message file name for facility
9603 `img' in American language will be `imgus.msb' where `us' is the
9604 abbreviation of American language and `msb' as message binary file
9605 extension.
9606 dur(IN)
9607 Duration for memory allocation for the return message handle. It can be
9608 the following values:
9609 OCI_DURATION_CALL
9610 OCI_DURATION_STATEMENT
9611 OCI_DURATION_SESSION
9612 OCI_DURATION_TRANSACTION
9613 For the detail description, please refer to Memory Related Service
9614 Interfaces section.
9615*/
9616sword OCIMessageOpen(void *envhp, OCIError *errhp, OCIMsg **msghp,
9617 const OraText *product, const OraText *facility,
9618 OCIDuration dur);
9619
9620
9621/*------------------------- OCIMessageGet -----------------------------------*/
9622/*
9623 NAME
9624 OCIMessageGet - get a locale message from a message handle
9625 REMARKS
9626 This function will get message with message number identified by msgno and
9627 if buflen is not zero, the function will copy the message into the buffer
9628 pointed to by msgbuf. If buflen is zero, the message will be copied into
9629 a message buffer inside the message handle pointed to by msgh. For both
9630 cases. it will return the pointer to the null-terminated message string.
9631 If it cannot get the message required, it will return a NULL pointer.
9632 RETURNS
9633 A pointer to a null-terminated message string on success, otherwise a NULL
9634 pointer.
9635 msgh(IN/OUT)
9636 Pointer to a message handle which was previously opened by
9637 OCIMessageOpen().
9638 msgno(IN)
9639 The message number for getting message.
9640 msgbuf(OUT)
9641 Pointer to a destination buffer to the message retrieved. If buflen is
9642 zero, it can be NULL pointer.
9643 buflen(IN)
9644 The size of the above destination buffer.
9645*/
9646OraText *OCIMessageGet(OCIMsg *msgh, ub4 msgno, OraText *msgbuf,
9647 size_t buflen);
9648
9649/*------------------------- OCIMessageClose ---------------------------------*/
9650/*
9651 NAME
9652 OCIMessageClose - close a message handle
9653 REMARKS
9654 This function closes a message handle pointed to by msgh and frees any
9655 memory associated with this handle.
9656 RETURNS
9657 OCI_SUCCESS, OCI_INVALID_HANDLE or OCI_ERROR
9658 envhp(IN/OUT)
9659 A pointer to OCI environment handle for message language.
9660 errhp(IN/OUT)
9661 The OCI error handle. If there is an error, it is record in errhp and this
9662 function returns a NULL pointer. Diagnostic information can be obtained by
9663 calling OCIErrorGet().
9664 msghp(IN/OUT)
9665 A pointer to a message handle which was previously opened by
9666 OCIMessageOpen().
9667*/
9668sword OCIMessageClose(void *envhp, OCIError *errhp, OCIMsg *msghp);
9669
9670/*--------------- End of Extensions to NLS cartridge service ----------------*/
9671
9672
9673/*----------------- Extensions to OCI Thread interface ---------------------*/
9674/*****************************************************************************
9675 DESCRIPTION
9676******************************************************************************
96771 Threads Interface
9678
9679The OCIThread package provides a number of commonly used threading
9680primitives for use by Oracle customers. It offers a portable interface to
9681threading capabilities native to various platforms. It does not implement
9682threading on platforms which do not have native threading capability.
9683
9684OCIThread does not provide a portable implementation of multithreaded
9685facilities. It only serves as a set of portable covers for native
9686multithreaded facilities. Therefore, platforms that do not have native
9687support for multi-threading will only be able to support a limited
9688implementation of OCIThread. As a result, products that rely on all of
9689OCIThread's functionality will not port to all platforms. Products that must
9690port to all platforms must use only a subset of OCIThread's functionality.
9691This issue is discussed further in later sections of this document.
9692
9693The OCIThread API is split into four main parts. Each part is described
9694briefly here. The following subsections describe each in greater detail.
9695
9696 1. Initialization and Termination Calls
9697
9698 These calls deal with the initialization and termination of OCIThread.
9699 Initialization of OCIThread initializes the OCIThread context which is
9700 a member of the OCI environment or session handle. This context is
9701 required for other OCIThread calls.
9702
9703 2. Passive Threading Primitives
9704
9705 The passive threading primitives include primitives to manipulate mutual
9706 exclusion (mutex) locks, thread ID's, and thread-specific data keys.
9707
9708 The reason that these primitives are described as 'passive' is that while
9709 their specifications allow for the existence of multiple threads, they do
9710 not require it. This means that it is possible for these primitives to
9711 be implemented according to specification in both single-threaded and
9712 multi-threaded environments.
9713
9714 As a result, OCIThread clients that use only these primitives will not
9715 require the existence of multiple threads in order to work correctly,
9716 i.e., they will be able to work in single-threaded environments without
9717 branching code.
9718
9719 3. Active Threading Primitives
9720
9721 Active threading primitives include primitives dealing with the creation,
9722 termination, and other manipulation of threads.
9723
9724 The reason that these primitives are described as 'active' is that they
9725 can only be used in true multi-threaded environments. Their
9726 specifications explicitly require that it be possible to have multiple
9727 threads. If you need to determine at runtime whether or not you are in a
9728 multi-threaded environment, call OCIThreadIsMulti() before calling an
9729 OCIThread active primitive.
9730
9731
97321.1 Initialization & Termination
9733==================================
9734
9735The types and functions described in this section are associated with the
9736initialization and termination of the OCIThread package. OCIThread must
9737be properly initialized before any of its functionality can be used.
9738OCIThread's process initialization function, 'OCIThreadProcessInit()',
9739must be called with care; see below.
9740
9741The observed behavior of the initialization and termination functions is the
9742same regardless of whether OCIThread is in single-threaded or multi-threaded
9743environment. It is OK to call the initialization functions from both generic
9744and operating system specific (OSD) code.
9745
97461.1.1 Types
9747
9748 OCIThreadContext - OCIThread Context
9749 -------------------------------------
9750
9751 Most calls to OCIThread functions take the OCI environment or session
9752 handle as a parameter. The OCIThread context is part of the OCI
9753 environment or session handle and it must be initialized by calling
9754 'OCIThreadInit()'. Termination of the OCIThread context occurs by calling
9755 'OCIThreadTerm()'.
9756
9757 The OCIThread context is a private data structure. Clients must NEVER
9758 attempt to examine the contents of the context.
9759
97601.1.2 OCIThreadProcessInit
9761
9762 OCIThreadProcessInit - OCIThread Process INITialization
9763 --------------------------------------------------------
9764
9765 Description
9766
9767 This function should be called to perform OCIThread process
9768 initialization.
9769
9770 Prototype
9771
9772 void OCIThreadProcessInit();
9773
9774 Returns
9775
9776 Nothing.
9777
9778 Notes
9779
9780 Whether or not this function needs to be called depends on how OCI
9781 Thread is going to be used.
9782
9783 * In a single-threaded application, calling this function is optional.
9784 If it is called at all, the first call to it must occur before calls
9785 to any other OCIThread functions. Subsequent calls can be made
9786 without restriction; they will not have any effect.
9787
9788 * In a multi-threaded application, this function MUST be called. The
9789 first call to it MUST occur 'strictly before' any other OCIThread
9790 calls; i.e., no other calls to OCIThread functions (including other
9791 calls to this one) can be concurrent with the first call.
9792 Subsequent calls to this function can be made without restriction;
9793 they will not have any effect.
9794
9795
97961.1.3 OCIThreadInit
9797
9798 OCIThreadInit - OCIThread INITialize
9799 -------------------------------------
9800
9801 Description
9802
9803 This initializes OCIThread context.
9804
9805 Prototype
9806
9807 sword OCIThreadInit(void *hndl, OCIError *err);
9808
9809 hndl(IN/OUT): The OCI environment or session handle.
9810
9811 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
9812 is returned, the error is recorded in err and diagnostic
9813 information can be obtained by calling OCIErrorGet().
9814
9815 Returns
9816
9817 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
9818
9819 Notes
9820
9821 It is illegal for OCIThread clients to try an examine the memory
9822 pointed to by the returned pointer.
9823
9824 It is safe to make concurrent calls to 'OCIThreadInit()'. Unlike
9825 'OCIThreadProcessInit()', there is no need to have a first call
9826 that occurs before all the others.
9827
9828 The first time 'OCIThreadInit()' is called, it initilaizes the OCI
9829 Thread context. It also saves a pointer to the context in some system
9830 dependent manner. Subsequent calls to 'OCIThreadInit()' will return
9831 the same context.
9832
9833 Each call to 'OCIThreadInit()' must eventually be matched by a call to
9834 'OCIThreadTerm()'.
9835
9836 OCIThreadTerm - OCIThread TERMinate
9837 ------------------------------------
9838
9839 Description
9840
9841 This should be called to release the OCIThread context. It should be
9842 called exactly once for each call made to 'OCIThreadInit()'.
9843
9844 Prototype
9845
9846 sword OCIThreadTerm(void *hndl, OCIError *err);
9847
9848 hndl(IN/OUT): The OCI environment or session handle.
9849
9850 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
9851 is returned, the error is recorded in err and diagnostic
9852 information can be obtained by calling OCIErrorGet().
9853
9854 Returns
9855
9856 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
9857
9858 Notes
9859
9860 It is safe to make concurrent calls to 'OCIThreadTerm()'.
9861
9862 'OCIThreadTerm()' will not do anything until it has been called as
9863 many times as 'OCIThreadInit()' has been called. When that happens,
9864 it terminates the OCIThread layer and frees the memory allocated for
9865 the context. Once this happens, the context should not be re-used.
9866 It will be necessary to obtain a new one by calling 'OCIThreadInit()'.
9867
9868
9869 OCIThreadIsMulti - OCIThread Is Multi-Threaded?
9870 ------------------------------------------------
9871
9872 Description
9873
9874 This tells the caller whether the application is running in a
9875 multi-threaded environment or a single-threaded environment.
9876
9877 Prototype
9878 boolean OCIThreadIsMulti(void);
9879
9880 Returns
9881
9882 TRUE if the environment is multi-threaded;
9883 FALSE if the environment is single-threaded.
9884
9885
98861.2 Passive Threading Primitives
9887==================================
9888
98891.2.1 Types
9890
9891The passive threading primitives deal with the manipulation of mutex,
9892thread ID's, and thread-specific data. Since the specifications of these
9893primitives do not require the existence of multiple threads, they can be
9894used both on multithreaded and single-threaded platforms.
9895
98961.2.1.1 OCIThreadMutex - OCIThread Mutual Exclusion Lock
9897-----------------------------------------------------------
9898
9899 The type 'OCIThreadMutex' is used to represent a mutual exclusion lock
9900 (mutex). A mutex is typically used for one of two purposes: (i) to
9901 ensure that only one thread accesses a given set of data at a time, or
9902 (ii) to ensure that only one thread executes a given critical section of
9903 code at a time.
9904
9905 Mutexes pointer can be declared as parts of client structures or as
9906 stand-alone variables. Before they can be used, they must be initialized
9907 using 'OCIThreadMutexInit()'. Once they are no longer needed, they must be
9908 destroyed using 'OCIThreadMutexDestroy()'. A mutex pointer must NOT be
9909 used after it is destroyed.
9910
9911 A thread can acquire a mutex by using either 'OCIThreadMutexAcquire()' or
9912 'OCIThreadMutexTry()'. They both ensure that only one thread at a time is
9913 allowed to hold a given mutex. A thread that holds a mutex can release it
9914 by calling 'OCIThreadMutexRelease()'.
9915
9916
99171.2.1.2 OCIThreadKey - OCIThread Key for Thread-Specific Data
9918----------------------------------------------------------------
9919
9920 A key can be thought of as a process-wide variable that has a
9921 thread-specific value. What this means is that all the threads in a
9922 process can use any given key. However, each thread can examine or modify
9923 that key independently of the other threads. The value that a thread sees
9924 when it examines the key will always be the same as the value that it last
9925 set for the key. It will not see any values set for the key by the other
9926 threads.
9927
9928 The type of the value held by a key is a 'void *' generic pointer.
9929
9930 Keys can be created using 'OCIThreadKeyInit()'. When a key is created, its
9931 value is initialized to 'NULL' for all threads.
9932
9933 A thread can set a key's value using 'OCIThreadKeySet()'. A thread can
9934 get a key's value using 'OCIThreadKeyGet()'.
9935
9936 The OCIThread key functions will save and retrieve data SPECIFIC TO THE
9937 THREAD. When clients maintain a pool of threads and assign the threads to
9938 different tasks, it *may not* be appropriate for a task to use OCIThread
9939 key functions to save data associated with it. Here is a scenario of how
9940 things can fail: A thread is assigned to execute the initialization of a
9941 task. During the initialization, the task stored some data related to it
9942 in the thread using OCIThread key functions. After the initialization,
9943 the thread is returned back to the threads pool. Later, the threads pool
9944 manager assigned another thread to perform some operations on the task,
9945 and the task needs to retrieve those data it stored earlier in
9946 initialization. Since the task is running in another thread, it will not
9947 be able to retrieve the same data back! Applications that use thread
9948 pools should be aware of this and be cautious when using OCIThread key
9949 functions.
9950
9951
99521.2.1.3 OCIThreadKeyDestFunc - OCIThread Key Destructor Function Type
9953------------------------------------------------------------------------
9954
9955 This is the type of a pointer to a key's destructor routine. Keys can be
9956 associated with a destructor routine when they are created (see
9957 'OCIThreadKeyInit()').
9958
9959 A key's destructor routine will be called whenever a thread that has a
9960 non-NULL value for the key terminates.
9961
9962 The destructor routine returns nothing and takes one parameter. The
9963 parameter will be the value that was set for key when the thread
9964 terminated.
9965
9966 The destructor routine is guaranteed to be called on a thread's value
9967 in the key after the termination of the thread and before process
9968 termination. No more precise guarantee can be made about the timing
9969 of the destructor routine call; thus no code in the process may assume
9970 any post-condition of the destructor routine. In particular, the
9971 destructor is not guaranteed to execute before a join call on the
9972 terminated thread returns.
9973
9974
99751.2.1.4 OCIThreadId - OCIThread Thread ID
9976--------------------------------------------
9977
9978 Type 'OCIThreadId' is the type that will be used to identify a thread.
9979 At any given time, no two threads will ever have the same 'OCIThreadId'.
9980 However, 'OCIThreadId' values can be recycled; i.e., once a thread dies,
9981 a new thread may be created that has the same 'OCIThreadId' as the one
9982 that died. In particular, the thread ID must uniquely identify a thread
9983 T within a process, and it must be consistent and valid in all threads U
9984 of the process for which it can be guaranteed that T is running
9985 concurrently with U. The thread ID for a thread T must be retrievable
9986 within thread T. This will be done via OCIThreadIdGet().
9987
9988 The 'OCIThreadId' type supports the concept of a NULL thread ID: the NULL
9989 thread ID will never be the same as the ID of an actual thread.
9990
9991
9992
99931.2.2 Function prototypes for passive primitives
9994--------------------------------------------------
9995
99961.2.2.1 Mutex functions
9997-------------------------
9998
9999 OCIThreadMutexInit - OCIThread MuteX Initialize
10000 -----------------------------------------------
10001
10002 Description
10003
10004 This allocate and initializes a mutex. All mutexes must be
10005 initialized prior to use.
10006
10007 Prototype
10008
10009 sword OCIThreadMutexInit(void *hndl, OCIError *err,
10010 OCIThreadMutex **mutex);
10011
10012 hndl(IN/OUT): The OCI environment or session handle.
10013
10014 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10015 is returned, the error is recorded in err and diagnostic
10016 information can be obtained by calling OCIErrorGet().
10017
10018 mutex(OUT): The mutex to initialize.
10019
10020 Returns
10021
10022 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10023
10024 Notes
10025
10026 Multiple threads must not initialize the same mutex simultaneously.
10027 Also, a mutex must not be reinitialized until it has been destroyed (see
10028 'OCIThreadMutexDestroy()').
10029
10030 OCIThreadMutexDestroy - OCIThread MuteX Destroy
10031 -----------------------------------------------
10032
10033 Description
10034
10035 This destroys and deallocate a mutex. Each mutex must be destroyed
10036 once it is no longer needed.
10037
10038 Prototype
10039
10040 sword OCIThreadMutexDestroy(void *hndl, OCIError *err,
10041 OCIThreadMutex **mutex);
10042
10043 hndl(IN/OUT): The OCI environment or session handle.
10044
10045 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10046 is returned, the error is recorded in err and diagnostic
10047 information can be obtained by calling OCIErrorGet().
10048
10049 mutex(IN/OUT): The mutex to destroy.
10050
10051 Returns
10052
10053 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10054
10055 Notes
10056
10057 It is not legal to destroy a mutex that is uninitialized or is currently
10058 held by a thread. The destruction of a mutex must not occur concurrently
10059 with any other operations on the mutex. A mutex must not be used after
10060 it has been destroyed.
10061
10062
10063 OCIThreadMutexAcquire - OCIThread MuteX Acquire
10064 -----------------------------------------------
10065
10066 Description
10067
10068 This acquires a mutex for the thread in which it is called. If the mutex
10069 is held by another thread, the calling thread is blocked until it can
10070 acquire the mutex.
10071
10072 Prototype
10073
10074 sword OCIThreadMutexAcquire(void *hndl, OCIError *err,
10075 OCIThreadMutex *mutex);
10076
10077 hndl(IN/OUT): The OCI environment or session handle.
10078
10079 err(IN/OUT): The OCI error handle. If there is an error, it is
10080 recorded in err and this function returns OCI_ERROR.
10081 Diagnostic information can be obtained by calling
10082 OCIErrorGet().
10083
10084 mutex(IN/OUT): The mutex to acquire.
10085
10086 Returns
10087
10088 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10089
10090 Notes
10091
10092 It is illegal to attempt to acquire an uninitialized mutex.
10093
10094 This function's behavior is undefined if it is used by a thread to
10095 acquire a mutex that is already held by that thread.
10096
10097
10098
10099 OCIThreadMutexRelease - OCIThread MuteX Release
10100 -----------------------------------------------
10101
10102 Description
10103
10104 This releases a mutex. If there are any threads blocked on the mutex,
10105 one of them will acquire it and become unblocked.
10106
10107 Prototype
10108
10109 sword OCIThreadMutexRelease(void *hndl, OCIError *err,
10110 OCIThreadMutex *mutex);
10111
10112 hndl(IN/OUT): The OCI environment or session handle.
10113
10114 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10115 is returned, the error is recorded in err and diagnostic
10116 information can be obtained by calling OCIErrorGet().
10117
10118 mutex(IN/OUT): The mutex to release.
10119
10120 Returns
10121
10122 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10123
10124 Notes
10125
10126 It is illegal to attempt to release an uninitialized mutex. It is also
10127 illegal for a thread to release a mutex that it does not hold.
10128
10129
10130 OCIThreadKeyInit - OCIThread KeY Initialize
10131 -------------------------------------------
10132
10133 Description
10134
10135 This creates a key. Each call to this routine allocate and generates
10136 a new key that is distinct from all other keys.
10137
10138 Prototype
10139
10140 sword OCIThreadKeyInit(void *hndl, OCIError *err, OCIThreadKey **key,
10141 OCIThreadKeyDestFunc destFn);
10142
10143 hndl(IN/OUT): The OCI environment or session handle.
10144
10145 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10146 is returned, the error is recorded in err and diagnostic
10147 information can be obtained by calling OCIErrorGet().
10148
10149 key(OUT): The 'OCIThreadKey' in which to create the new key.
10150
10151 destFn(IN): The destructor for the key. NULL is permitted.
10152
10153 Returns
10154
10155 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10156
10157 Notes
10158
10159 Once this function executes successfully, a pointer to an allocated and
10160 initialized key is return. That key can be used with 'OCIThreadKeyGet()'
10161 and 'OCIThreadKeySet()'. The initial value of the key will be 'NULL' for
10162 all threads.
10163
10164 It is illegal for this function to be called more than once to create the
10165 same key (i.e., to be called more than once with the same value for the
10166 'key' parameter).
10167
10168 If the 'destFn' parameter is not NULL, the routine pointed to by 'destFn'
10169 will be called whenever a thread that has a non-NULL value for the key
10170 terminates. The routine will be called with one parameter. The
10171 parameter will be the key's value for the thread at the time at which the
10172 thread terminated.
10173 If the key does not need a destructor function, pass NULL for 'destFn'.
10174
10175
10176 OCIThreadKeyDestroy - OCIThread KeY DESTROY
10177 -------------------------------------------
10178
10179 Description
10180
10181 Destroy and deallocate the key pointed to by 'key'.
10182
10183 Prototype
10184
10185 sword OCIThreadKeyDestroy(void *hndl, OCIError *err,
10186 OCIThreadKey **key);
10187
10188 hndl(IN/OUT): The OCI environment or session handle.
10189
10190 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10191 is returned, the error is recorded in err and diagnostic
10192 information can be obtained by calling OCIErrorGet().
10193
10194 key(IN/OUT): The 'OCIThreadKey' in which to destroy the key.
10195
10196 Returns
10197
10198 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10199
10200 Notes
10201
10202 This is different from the destructor function callback passed to the
10203 key create routine. This new destroy function 'OCIThreadKeyDestroy' is
10204 used to terminate any resources OCI THREAD acquired when it created
10205 'key'. [The 'OCIThreadKeyDestFunc' callback type is a key VALUE
10206 destructor; it does in no way operate on the key itself.]
10207
10208 This must be called once the user has finished using the key. Not
10209 calling the key destroy function may result in memory leaks.
10210
10211
10212
10213
102141.2.2.2 Thread Key operations
10215-------------------------------
10216
10217 OCIThreadKeyGet - OCIThread KeY Get value
10218 -----------------------------------------
10219
10220 Description
10221
10222 This gets the calling thread's current value for a key.
10223
10224 Prototype
10225
10226 sword OCIThreadKeyGet(void *hndl, OCIError *err, OCIThreadKey *key,
10227 void **pValue);
10228
10229 hndl(IN/OUT): The OCI environment or session handle.
10230
10231 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10232 is returned, the error is recorded in err and diagnostic
10233 information can be obtained by calling OCIErrorGet().
10234
10235 key(IN): The key.
10236
10237 pValue(IN/OUT): The location in which to place the thread-specific
10238 key value.
10239
10240 Returns
10241
10242 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10243
10244 Notes
10245
10246 It is illegal to use this function on a key that has not been created
10247 using 'OCIThreadKeyInit()'.
10248
10249 If the calling thread has not yet assigned a value to the key, 'NULL' is
10250 placed in the location pointed to by 'pValue'.
10251
10252
10253 OCIThreadKeySet - OCIThread KeY Set value
10254 -----------------------------------------
10255
10256 Description
10257
10258 This sets the calling thread's value for a key.
10259
10260 Prototype
10261
10262 sword OCIThreadKeySet(void *hndl, OCIError *err, OCIThreadKey *key,
10263 void *value);
10264
10265 hndl(IN/OUT): The OCI environment or session handle.
10266
10267 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10268 is returned, the error is recorded in err and diagnostic
10269 information can be obtained by calling OCIErrorGet().
10270
10271 key(IN/OUT): The key.
10272
10273 value(IN): The thread-specific value to set in the key.
10274
10275 Returns
10276
10277 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10278
10279 Notes
10280
10281 It is illegal to use this function on a key that has not been created
10282 using 'OCIThreadKeyInit()'.
10283
102841.2.2.3 Thread Id
10285--------------------
10286
10287 OCIThreadIdInit - OCIThread Thread Id INITialize
10288 --------------------------------------------------
10289
10290 Description
10291
10292 Allocate and initialize the thread id 'tid'.
10293
10294 Prototype
10295
10296 sword OCIThreadIdInit(void *hndl, OCIError *err, OCIThreadId **tid);
10297
10298 hndl(IN/OUT): The OCI environment or session handle.
10299
10300 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10301 is returned, the error is recorded in err and diagnostic
10302 information can be obtained by calling OCIErrorGet().
10303
10304 tid (OUT): Pointer to the thread ID to initialize.
10305
10306 Returns
10307
10308 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10309
10310
10311 OCIThreadIdDestroy - OCIThread Thread Id DESTROY
10312 --------------------------------------------------
10313
10314 Description
10315
10316 Destroy and deallocate the thread id 'tid'.
10317
10318 Prototype
10319
10320 sword OCIThreadIdDestroy(void *hndl, OCIError *err, OCIThreadId **tid);
10321
10322 hndl(IN/OUT): The OCI environment or session handle.
10323
10324 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10325 is returned, the error is recorded in err and diagnostic
10326 information can be obtained by calling OCIErrorGet().
10327
10328 tid(IN/OUT): Pointer to the thread ID to destroy.
10329
10330 Returns
10331
10332 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10333
10334 Note
10335
10336 'tid' should be initialized by OCIThreadIdInit().
10337
10338
10339 OCIThreadIdSet - OCIThread Thread Id Set
10340 -----------------------------------------
10341
10342 Description
10343
10344 This sets one 'OCIThreadId' to another.
10345
10346 Prototype
10347
10348 sword OCIThreadIdSet(void *hndl, OCIError *err,
10349 OCIThreadId *tidDest,
10350 OCIThreadId *tidSrc);
10351
10352 hndl(IN/OUT): The OCI environment or session handle.
10353
10354 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10355 is returned, the error is recorded in err and diagnostic
10356 information can be obtained by calling OCIErrorGet().
10357
10358 tidDest(OUT): This should point to the location of the 'OCIThreadId'
10359 to be set to.
10360
10361 tidSrc(IN): This should point to the 'OCIThreadId' to set from.
10362
10363 Returns
10364
10365 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10366
10367 Notes
10368
10369 'tid' should be initialized by OCIThreadIdInit().
10370
10371
10372 OCIThreadIdSetNull - OCIThread Thread Id Set Null
10373 ---------------------------------------------------------
10374
10375 Description
10376
10377 This sets the NULL thread ID to a given 'OCIThreadId'.
10378
10379 Prototype
10380
10381 sword OCIThreadIdSetNull(void *hndl, OCIError *err,
10382 OCIThreadId *tid);
10383
10384 hndl(IN/OUT): The OCI environment or session handle.
10385
10386 err(IN/OUT): The OCI error handle. If there is an error, it is
10387 recorded in err and this function returns OCI_ERROR.
10388 Diagnostic information can be obtained by calling
10389 OCIErrorGet().
10390
10391 tid(OUT): This should point to the 'OCIThreadId' in which to put
10392 the NULL thread ID.
10393
10394 Returns
10395
10396 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10397
10398 Notes
10399
10400 'tid' should be initialized by OCIThreadIdInit().
10401
10402
10403 OCIThreadIdGet - OCIThread Thread Id Get
10404 ------------------------------------------
10405
10406 Description
10407
10408 This retrieves the 'OCIThreadId' of the thread in which it is called.
10409
10410 Prototype
10411
10412 sword OCIThreadIdGet(void *hndl, OCIError *err,
10413 OCIThreadId *tid);
10414
10415 hndl(IN/OUT): The OCI environment or session handle.
10416
10417 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10418 is returned, the error is recorded in err and diagnostic
10419 information can be obtained by calling OCIErrorGet().
10420
10421 tid(OUT): This should point to the location in which to place the
10422 ID of the calling thread.
10423
10424 Returns
10425
10426 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10427
10428 Notes
10429
10430 'tid' should be initialized by OCIThreadIdInit().
10431
10432 When OCIThread is used in a single-threaded environment,
10433 OCIThreadIdGet() will always place the same value in the location
10434 pointed to by 'tid'. The exact value itself is not important. The
10435 important thing is that it is not the same as the NULL thread ID and
10436 that it is always the same value.
10437
10438
10439 OCIThreadIdSame - OCIThread Thread Ids Same?
10440 ----------------------------------------------
10441
10442 Description
10443
10444 This determines whether or not two 'OCIThreadId's represent the same
10445 thread.
10446
10447 Prototype
10448
10449 sword OCIThreadIdSame(void *hndl, OCIError *err,
10450 OCIThreadId *tid1, OCIThreadId *tid2,
10451 boolean *result);
10452
10453 hndl(IN/OUT): The OCI environment or session handle.
10454
10455 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10456 is returned, the error is recorded in err and diagnostic
10457 information can be obtained by calling OCIErrorGet().
10458
10459 tid1(IN): Pointer to the first 'OCIThreadId'.
10460
10461 tid2(IN): Pointer to the second 'OCIThreadId'.
10462
10463 result(IN/OUT): Pointer to the result.
10464
10465 Returns
10466
10467 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10468
10469 Notes
10470
10471 If 'tid1' and 'tid2' represent the same thread, 'result' is set to TRUE.
10472 Otherwise, 'result' is set to FALSE.
10473
10474 'result' is set to TRUE if both 'tid1' and 'tid2' are the NULL thread ID.
10475
10476 'ti1d' and 'tid2' should be initialized by OCIThreadIdInit().
10477
10478
10479 OCIThreadIdNull - OCIThread Thread Id NULL?
10480 ---------------------------------------------
10481
10482 Description
10483
10484 This determines whether or not a given 'OCIThreadId' is the NULL thread
10485 ID.
10486
10487 Prototype
10488
10489 sword OCIThreadIdNull(void *hndl, OCIError *err,
10490 OCIThreadId *tid,
10491 boolean *result);
10492
10493 hndl(IN/OUT): The OCI environment or session handle.
10494
10495 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10496 is returned, the error is recorded in err and diagnostic
10497 information can be obtained by calling OCIErrorGet().
10498
10499 tid(IN): Pointer to the 'OCIThreadId' to check.
10500
10501 result(IN/OUT): Pointer to the result.
10502
10503 Returns
10504
10505 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10506
10507 Notes
10508
10509 If 'tid' is the NULL thread ID, 'result' is set to TRUE. Otherwise,
10510 'result' is set to FALSE.
10511
10512 'tid' should be initialized by OCIThreadIdInit().
10513
10514
105151.3 Active Threading Primitives
10516=================================
10517
10518The active threading primitives deal with the manipulation of actual
10519threads. Because the specifications of most of these primitives require
10520that it be possible to have multiple threads, they work correctly only in
10521the enabled OCIThread; In the disabled OCIThread, they always return
10522failure. The exception is OCIThreadHandleGet(); it may be called in a
10523single-threaded environment, in which case it will have no effect.
10524
10525Active primitives should only be called by code running in a multi-threaded
10526environment. You can call OCIThreadIsMulti() to determine whether the
10527environment is multi-threaded or single-threaded.
10528
10529
105301.3.1 Types
10531--------------
10532
105331.3.1.1 OCIThreadHandle - OCIThread Thread Handle
10534------------------------------------------------------
10535
10536 Type 'OCIThreadHandle' is used to manipulate a thread in the active
10537 primitives: OCIThreadJoin()and OCIThreadClose(). A thread handle opened by
10538 OCIThreadCreate() must be closed in a matching call to
10539 OCIThreadClose(). A thread handle is invalid after the call to
10540 OCIThreadClose().
10541
10542 The distinction between a thread ID and a thread handle in OCIThread usage
10543 follows the distinction between the thread ID and the thread handle on
10544 Windows NT. On many platforms, the underlying native types are the same.
10545
10546
105471.3.2 Functions
10548------------------
10549
10550 OCIThreadHndInit - OCIThread HaNDle Initialize
10551 ----------------------------------------------
10552
10553 Description
10554
10555 Allocate and initialize the thread handle.
10556
10557 Prototype
10558
10559 sword OCIThreadHndInit(void *hndl, OCIError *err,
10560 OCIThreadHandle **thnd);
10561
10562 hndl(IN/OUT): The OCI environment or session handle.
10563
10564 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10565 is returned, the error is recorded in err and diagnostic
10566 information can be obtained by calling OCIErrorGet().
10567
10568 thnd(OUT): The address of pointer to the thread handle to initialize.
10569
10570 Returns
10571
10572 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10573
10574
10575 OCIThreadHndDestroy - OCIThread HaNDle Destroy
10576 ----------------------------------------------
10577
10578 Description
10579
10580 Destroy and deallocate the thread handle.
10581
10582 Prototype
10583
10584 sword OCIThreadHndDestroy(void *hndl, OCIError *err,
10585 OCIThreadHandle **thnd);
10586
10587 hndl(IN/OUT): The OCI environment or session handle.
10588
10589 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10590 is returned, the error is recorded in err and diagnostic
10591 information can be obtained by calling OCIErrorGet().
10592
10593 thnd(IN/OUT): The address of pointer to the thread handle to destroy.
10594
10595 Returns
10596
10597 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10598
10599 Notes
10600
10601 'thnd' should be initialized by OCIThreadHndInit().
10602
10603
10604 OCIThreadCreate - OCIThread Thread Create
10605 -----------------------------------------
10606
10607 Description
10608
10609 This creates a new thread.
10610
10611 Prototype
10612
10613 sword OCIThreadCreate(void *hndl, OCIError *err,
10614 void (*start)(void *), void *arg,
10615 OCIThreadId *tid, OCIThreadHandle *tHnd);
10616
10617 hndl(IN/OUT): The OCI environment or session handle.
10618
10619 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10620 is returned, the error is recorded in err and diagnostic
10621 information can be obtained by calling OCIErrorGet().
10622
10623 start(IN): The function in which the new thread should begin
10624 execution.
10625
10626 arg(IN): The argument to give the function pointed to by 'start'.
10627
10628 tid(IN/OUT): If not NULL, gets the ID for the new thread.
10629
10630 tHnd(IN/OUT): If not NULL, gets the handle for the new thread.
10631
10632 Returns
10633
10634 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10635
10636 Notes
10637
10638 The new thread will start by executing a call to the function pointed
10639 to by 'start' with the argument given by 'arg'. When that function
10640 returns, the new thread will terminate. The function should not
10641 return a value and should accept one parameter, a 'void *'.
10642
10643 The call to OCIThreadCreate() must be matched by a call to
10644 OCIThreadClose() if and only if tHnd is non-NULL.
10645
10646 If tHnd is NULL, a thread ID placed in *tid will not be valid in the
10647 calling thread because the timing of the spawned thread's termination
10648 is unknown.
10649
10650 'tid' should be initialized by OCIThreadIdInit().
10651
10652 'thnd' should be initialized by OCIThreadHndInit().
10653
10654
10655
10656 OCIThreadJoin - OCIThread Thread Join
10657 -------------------------------------
10658
10659 Description
10660
10661 This function allows the calling thread to 'join' with another thread.
10662 It blocks the caller until the specified thread terminates.
10663
10664 Prototype
10665
10666 sword OCIThreadJoin(void *hndl, OCIError *err, OCIThreadHandle *tHnd);
10667
10668 hndl(IN/OUT): The OCI environment or session handle.
10669
10670 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10671 is returned, the error is recorded in err and diagnostic
10672 information can be obtained by calling OCIErrorGet().
10673
10674 tHnd(IN): The 'OCIThreadHandle' of the thread to join with.
10675
10676 Returns
10677
10678 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10679
10680 Notes
10681
10682 'thnd' should be initialized by OCIThreadHndInit().
10683
10684 The result of multiple threads all trying to join with the same thread is
10685 undefined.
10686
10687
10688 OCIThreadClose - OCIThread Thread Close
10689 ---------------------------------------
10690
10691 Description
10692
10693 This function should be called to close a thread handle.
10694
10695 Prototype
10696
10697 sword OCIThreadClose(void *hndl, OCIError *err, OCIThreadHandle *tHnd);
10698
10699 hndl(IN/OUT): The OCI environment or session handle.
10700
10701 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10702 is returned, the error is recorded in err and diagnostic
10703 information can be obtained by calling OCIErrorGet().
10704
10705 tHnd(IN/OUT): The OCIThread thread handle to close.
10706
10707 Returns
10708
10709 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10710
10711 Notes
10712
10713 'thnd' should be initialized by OCIThreadHndInit().
10714
10715 Both thread handle and the thread ID that was returned by the same call
10716 to OCIThreadCreate() are invalid after the call to OCIThreadClose().
10717
10718
10719
10720 OCIThreadHandleGet - OCIThread Thread Get Handle
10721 ------------------------------------------------
10722
10723 Description
10724
10725 Retrieve the 'OCIThreadHandle' of the thread in which it is called.
10726
10727 Prototype
10728
10729 sword OCIThreadHandleGet(void *hndl, OCIError *err,
10730 OCIThreadHandle *tHnd);
10731
10732 hndl(IN/OUT): The OCI environment or session handle.
10733
10734 err(IN/OUT): The OCI error handle. If there is an error and OCI_ERROR
10735 is returned, the error is recorded in err and diagnostic
10736 information can be obtained by calling OCIErrorGet().
10737
10738 tHnd(IN/OUT): If not NULL, the location to place the thread
10739 handle for the thread.
10740
10741 Returns
10742
10743 OCI_SUCCESS, OCI_ERROR or OCI_INVALID_HANDLE.
10744
10745 Notes
10746
10747 'thnd' should be initialized by OCIThreadHndInit().
10748
10749 The thread handle 'tHnd' retrieved by this function must be closed
10750 with OCIThreadClose() and destroyed by OCIThreadHndDestroy() after it
10751 is used.
10752
10753
10754
10755
107561.4 Using OCIThread
10757=====================
10758
10759This section summarizes some of the more important details relating to the use
10760of OCIThread.
10761
10762 * Process initialization
10763
10764 OCIThread only requires that the process initialization function
10765 ('OCIThreadProcessInit()') be called when OCIThread is being used in a
10766 multi-threaded application. Failing to call 'OCIThreadProcessInit()' in
10767 a single-threaded application is not an error.
10768
10769 * OCIThread initialization
10770
10771 Separate calls to 'OCIThreadInit()' will all return the same OCIThread
10772 context.
10773
10774 Also, remember that each call to 'OCIThreadInit()' must eventually be
10775 matched by a call to 'OCIThreadTerm()'.
10776
10777 * Active vs. Passive Threading primitives
10778
10779 OCIThread client code written without using any active primitives can be
10780 compiled and used without change on both single-threaded and
10781 multi-threaded platforms.
10782
10783 OCIThread client code written using active primitives will only work
10784 correctly on multi-threaded platforms. In order to write a version of the
10785 same application to run on single-threaded platform, it is necessary to
10786 branch the your code, whether by branching versions of the source file or
10787 by branching at runtime with the OCIThreadIsMulti() call.
10788
10789******************************************************************************/
10790
10791/*****************************************************************************
10792 ACTUAL PROTOTYPE DECLARATIONS
10793******************************************************************************/
10794
10795void OCIThreadProcessInit();
10796
10797sword OCIThreadInit(void *hndl, OCIError *err);
10798
10799sword OCIThreadTerm(void *hndl, OCIError *err);
10800
10801boolean OCIThreadIsMulti();
10802
10803sword OCIThreadMutexInit(void *hndl, OCIError *err,
10804 OCIThreadMutex **mutex);
10805
10806sword OCIThreadMutexDestroy(void *hndl, OCIError *err,
10807 OCIThreadMutex **mutex);
10808
10809sword OCIThreadMutexAcquire(void *hndl, OCIError *err,
10810 OCIThreadMutex *mutex);
10811
10812sword OCIThreadMutexRelease(void *hndl, OCIError *err,
10813 OCIThreadMutex *mutex);
10814
10815sword OCIThreadKeyInit(void *hndl, OCIError *err, OCIThreadKey **key,
10816 OCIThreadKeyDestFunc destFn);
10817
10818sword OCIThreadKeyDestroy(void *hndl, OCIError *err,
10819 OCIThreadKey **key);
10820
10821sword OCIThreadKeyGet(void *hndl, OCIError *err, OCIThreadKey *key,
10822 void **pValue);
10823
10824sword OCIThreadKeySet(void *hndl, OCIError *err, OCIThreadKey *key,
10825 void *value);
10826
10827sword OCIThreadIdInit(void *hndl, OCIError *err, OCIThreadId **tid);
10828
10829sword OCIThreadIdDestroy(void *hndl, OCIError *err, OCIThreadId **tid);
10830
10831sword OCIThreadIdSet(void *hndl, OCIError *err,
10832 OCIThreadId *tidDest, OCIThreadId *tidSrc);
10833
10834sword OCIThreadIdSetNull(void *hndl, OCIError *err, OCIThreadId *tid);
10835
10836sword OCIThreadIdGet(void *hndl, OCIError *err, OCIThreadId *tid);
10837
10838sword OCIThreadIdSame(void *hndl, OCIError *err,
10839 OCIThreadId *tid1, OCIThreadId *tid2,
10840 boolean *result);
10841
10842sword OCIThreadIdNull(void *hndl, OCIError *err,
10843 OCIThreadId *tid, boolean *result);
10844
10845sword OCIThreadHndInit(void *hndl, OCIError *err, OCIThreadHandle **thnd);
10846
10847sword OCIThreadHndDestroy(void *hndl, OCIError *err, OCIThreadHandle **thnd);
10848
10849sword OCIThreadCreate(void *hndl, OCIError *err,
10850 void (*start)(void *), void *arg,
10851 OCIThreadId *tid, OCIThreadHandle *tHnd);
10852
10853sword OCIThreadJoin(void *hndl, OCIError *err, OCIThreadHandle *tHnd);
10854
10855sword OCIThreadClose(void *hndl, OCIError *err, OCIThreadHandle *tHnd);
10856
10857sword OCIThreadHandleGet(void *hndl, OCIError *err, OCIThreadHandle *tHnd);
10858/*----------------- End OCI Thread interface Extensions ---------------------*/
10859
10860/*------------------ Begin OCI Row Callback Interfaces ----------------------*/
10861
10862typedef sword (*OCIBindRowCallback)(void *ctx);
10863typedef sword (*OCIFetchRowCallback)(void *ctx);
10864
10865/*------------------ Begin OCI Row Callback Interfaces ----------------------*/
10866
10867/*--------------- Begin OCI Client Notification Interfaces ------------------*/
10868
10869typedef ub4 (*OCISubscriptionNotify)(void *ctx, OCISubscription *subscrhp,
10870 void *pay, ub4 payl,
10871 void *desc, ub4 mode);
10872
10873sword OCISubscriptionRegister(OCISvcCtx *svchp, OCISubscription **subscrhpp,
10874 ub2 count, OCIError *errhp, ub4 mode);
10875
10876
10877sword OCISubscriptionPost(OCISvcCtx *svchp, OCISubscription **subscrhpp,
10878 ub2 count, OCIError *errhp, ub4 mode);
10879
10880sword OCISubscriptionUnRegister(OCISvcCtx *svchp, OCISubscription *subscrhp,
10881 OCIError *errhp, ub4 mode);
10882
10883sword OCISubscriptionDisable(OCISubscription *subscrhp,
10884 OCIError *errhp, ub4 mode);
10885
10886sword OCISubscriptionEnable(OCISubscription *subscrhp,
10887 OCIError *errhp, ub4 mode);
10888
10889/*------------------- End OCI Publish/Subscribe Interfaces ------------------*/
10890
10891/*----------------- Extensions to Datetime interfaces -----------------------*/
10892/*--------------------- Actual Prototypes -----------------------------------*/
10893sword OCIDateTimeGetTime(void *hndl, OCIError *err, OCIDateTime *datetime,
10894 ub1 *hr, ub1 *mm, ub1 *ss, ub4 *fsec);
10895
10896sword OCIDateTimeGetDate(void *hndl, OCIError *err, const OCIDateTime *date,
10897 sb2 *yr, ub1 *mnth, ub1 *dy );
10898
10899sword OCIDateTimeGetTimeZoneOffset(void *hndl,OCIError *err,
10900 const OCIDateTime *datetime,
10901 sb1 *hr,sb1 *mm);
10902
10903sword OCIDateTimeConstruct(void *hndl,OCIError *err,OCIDateTime *datetime,
10904 sb2 yr,ub1 mnth,ub1 dy,ub1 hr,ub1 mm,ub1 ss,ub4 fsec,
10905 OraText *timezone,size_t timezone_length);
10906
10907sword OCIDateTimeSysTimeStamp(void *hndl, OCIError *err,
10908 OCIDateTime *sys_date );
10909
10910sword OCIDateTimeAssign(void *hndl, OCIError *err, const OCIDateTime *from,
10911 OCIDateTime *to);
10912
10913sword OCIDateTimeToText(void *hndl, OCIError *err, const OCIDateTime *date,
10914 const OraText *fmt, ub1 fmt_length, ub1 fsprec,
10915 const OraText *lang_name, size_t lang_length,
10916 ub4 *buf_size, OraText *buf );
10917
10918sword OCIDateTimeFromText(void *hndl, OCIError *err, const OraText *date_str,
10919 size_t dstr_length, const OraText *fmt, ub1 fmt_length,
10920 const OraText *lang_name, size_t lang_length, OCIDateTime *date );
10921
10922sword OCIDateTimeCompare(void *hndl, OCIError *err, const OCIDateTime *date1,
10923 const OCIDateTime *date2, sword *result );
10924
10925sword OCIDateTimeCheck(void *hndl, OCIError *err, const OCIDateTime *date,
10926 ub4 *valid );
10927
10928sword OCIDateTimeConvert(void *hndl, OCIError *err, OCIDateTime *indate,
10929 OCIDateTime *outdate);
10930
10931sword OCIDateTimeSubtract(void *hndl, OCIError *err, OCIDateTime *indate1,
10932 OCIDateTime *indate2, OCIInterval *inter);
10933
10934sword OCIDateTimeIntervalAdd(void *hndl, OCIError *err, OCIDateTime *datetime,
10935 OCIInterval *inter, OCIDateTime *outdatetime);
10936
10937sword OCIDateTimeIntervalSub(void *hndl, OCIError *err, OCIDateTime *datetime,
10938 OCIInterval *inter, OCIDateTime *outdatetime);
10939
10940sword OCIIntervalSubtract(void *hndl, OCIError *err, OCIInterval *minuend,
10941 OCIInterval *subtrahend, OCIInterval *result );
10942
10943sword OCIIntervalAdd(void *hndl, OCIError *err, OCIInterval *addend1,
10944 OCIInterval *addend2, OCIInterval *result );
10945
10946sword OCIIntervalMultiply(void *hndl, OCIError *err, const OCIInterval *inter,
10947 OCINumber *nfactor, OCIInterval *result );
10948
10949sword OCIIntervalDivide(void *hndl, OCIError *err, OCIInterval *dividend,
10950 OCINumber *divisor, OCIInterval *result );
10951
10952sword OCIIntervalCompare(void *hndl, OCIError *err, OCIInterval *inter1,
10953 OCIInterval *inter2, sword *result );
10954
10955sword OCIIntervalFromNumber(void *hndl, OCIError *err, OCIInterval *inter,
10956 OCINumber *number);
10957
10958sword OCIIntervalFromText( void *hndl, OCIError *err, const OraText *inpstr,
10959 size_t str_len, OCIInterval *result );
10960
10961sword OCIIntervalToText( void *hndl, OCIError *err, const OCIInterval *inter,
10962 ub1 lfprec, ub1 fsprec,
10963 OraText *buffer, size_t buflen, size_t *resultlen );
10964
10965sword OCIIntervalToNumber(void *hndl, OCIError *err,const OCIInterval *inter,
10966 OCINumber *number);
10967
10968sword OCIIntervalCheck(void *hndl, OCIError *err, const OCIInterval *interval,
10969 ub4 *valid );
10970
10971sword OCIIntervalAssign(void *hndl, OCIError *err, const OCIInterval *ininter,
10972 OCIInterval *outinter );
10973
10974sword OCIIntervalSetYearMonth(void *hndl, OCIError *err, sb4 yr, sb4 mnth,
10975 OCIInterval *result );
10976
10977sword OCIIntervalGetYearMonth(void *hndl, OCIError *err, sb4 *yr, sb4 *mnth,
10978 const OCIInterval *result );
10979
10980sword OCIIntervalSetDaySecond(void *hndl, OCIError *err, sb4 dy, sb4 hr,
10981 sb4 mm, sb4 ss, sb4 fsec, OCIInterval *result );
10982
10983sword OCIIntervalGetDaySecond(void *hndl, OCIError *err, sb4 *dy, sb4 *hr,
10984 sb4 *mm, sb4 *ss, sb4 *fsec, const OCIInterval *result );
10985
10986sword OCIDateTimeToArray(void *hndl, OCIError *err,
10987 const OCIDateTime *datetime, const OCIInterval *reftz,
10988 ub1 *outarray, ub4 *len, ub1 fsprec);
10989
10990sword OCIDateTimeFromArray(void *hndl, OCIError *err, ub1 *inarray, ub4 len,
10991 ub1 type, OCIDateTime *datetime,
10992 const OCIInterval *reftz, ub1 fsprec);
10993
10994sword OCIDateTimeGetTimeZoneName(void *hndl, OCIError *err,
10995 const OCIDateTime *datetime,
10996 ub1 *buf, ub4 *buflen);
10997
10998sword OCIIntervalFromTZ(void *hndl, OCIError *err, const oratext *inpstring,
10999 size_t str_len, OCIInterval *result);
11000
11001/*----------------- End Datetime interface Extensions -----------------------*/
11002
11003/*----------------- Connection Pooling prototypes ---------------------------*/
11004sword OCIConnectionPoolCreate(OCIEnv *envhp, OCIError *errhp, OCICPool *poolhp,
11005 OraText **poolName, sb4 *poolNameLen,
11006 const OraText *dblink, sb4 dblinkLen,
11007 ub4 connMin, ub4 connMax, ub4 connIncr,
11008 const OraText *poolUserName, sb4 poolUserLen,
11009 const OraText *poolPassword, sb4 poolPassLen,
11010 ub4 mode);
11011
11012sword OCIConnectionPoolDestroy(OCICPool *poolhp,
11013 OCIError *errhp, ub4 mode);
11014
11015/*----------------- End Connection Pooling prototypes -----------------------*/
11016
11017/*-------------------- Session Pooling prototypes ---------------------------*/
11018
11019sword OCISessionPoolCreate (OCIEnv *envhp, OCIError *errhp, OCISPool *spoolhp,
11020 OraText **poolName, ub4 *poolNameLen,
11021 const OraText *connStr, ub4 connStrLen,
11022 ub4 sessMin, ub4 sessMax, ub4 sessIncr,
11023 OraText *userid, ub4 useridLen,
11024 OraText *password, ub4 passwordLen,
11025 ub4 mode);
11026
11027sword OCISessionPoolDestroy (OCISPool *spoolhp,
11028 OCIError *errhp,
11029 ub4 mode);
11030
11031sword OCISessionGet (OCIEnv *envhp, OCIError *errhp, OCISvcCtx **svchp,
11032 OCIAuthInfo *authhp,
11033 OraText *poolName, ub4 poolName_len,
11034 const OraText *tagInfo, ub4 tagInfo_len,
11035 OraText **retTagInfo, ub4 *retTagInfo_len,
11036 boolean *found, ub4 mode);
11037
11038sword OCISessionRelease (OCISvcCtx *svchp, OCIError *errhp,
11039 OraText *tag, ub4 tag_len,
11040 ub4 mode);
11041
11042/*-------------------- End Session Pooling prototypes -----------------------*/
11043
11044/* --------------------- OCI Application Context --------------------------*/
11045
11046
11047sword OCIAppCtxSet(void * sesshndl, void *nsptr, ub4 nsptrlen,
11048 void *attrptr, ub4 attrptrlen,
11049 void *valueptr, ub4 valueptrlen,
11050 OCIError *errhp, ub4 mode);
11051
11052sword OCIAppCtxClearAll(void *sesshndl, void *nsptr, ub4 nsptrlen,
11053 OCIError *errhp, ub4 mode);
11054
11055/*-------------------------------- OCIMemStats ------------------------------*/
11056sword OCIMemStats(void *hndlp, OCIError *errhp, OCIEnv **envhp,
11057 ub4 mode, ub4 mode1, oratext *tabname);
11058
11059/*-------------------------------- OCIPing ----------------------------------*/
11060sword OCIPing (OCISvcCtx *svchp, OCIError *errhp, ub4 mode);
11061
11062/*----------------- Kerberos Authentication prototypes ----------------------*/
11063
11064sword OCIKerbAttrSet(OCISession *trgthndlp, ub4 cred_use, ub1 *ftgt_ticket,
11065 ub4 ticket_len, ub1 *session_key, ub4 skey_len,
11066 ub2 ftgt_keytype, ub4 ftgt_ticket_flags,
11067 sb4 ftgt_auth_time, sb4 ftgt_start_time,
11068 sb4 ftgt_end_time, sb4 ftgt_renew_time,
11069 oratext *ftgt_client_principal,
11070 ub4 ftgt_client_principal_len, oratext *ftgt_client_realm,
11071 ub4 ftgt_client_realm_len, OCIError *errhp);
11072
11073/*------------------- End Kerberos Authentication prototypes ----------------*/
11074
11075/*------------------- Database Startup/Shutdown prototypes ------------------*/
11076
11077sword OCIDBStartup (OCISvcCtx *svchp,
11078 OCIError *errhp,
11079 OCIAdmin *admhp,
11080 ub4 mode,
11081 ub4 flags);
11082
11083sword OCIDBShutdown(OCISvcCtx *svchp,
11084 OCIError *errhp,
11085 OCIAdmin *admhp,
11086 ub4 mode);
11087
11088/*------------------ End Database Startup/Shutdown prototypes ---------------*/
11089
11090/*----------------------- OCIClientVersion ------------------------------*/
11091void OCIClientVersion(sword *major_version,
11092 sword *minor_version,
11093 sword *update_num,
11094 sword *patch_num,
11095 sword *port_update_num);
11096/*----------------------- End OCIClientVersion --------------------------*/
11097
11098/*----------------------- HA Event prototypes ------------------------------*/
11099
11100sword OCIInitEventHandle(OCIError *errhp,
11101 OCIEvent *event,
11102 text *str,
11103 ub4 size);
11104
11105/*----------------------- End HA Event prototypes --------------------------*/
11106
11107/*---------------------------------------------------------------------------
11108 PRIVATE FUNCTIONS
11109 ---------------------------------------------------------------------------*/
11110
11111 /* the following functions are depracated and should not be used */
11112#ifdef NEVER
11113sword OCIStmtBindByPos (OCIStmt *stmtp, OCIBind *bindp, OCIError *errhp,
11114 ub4 position, void *valuep, sb4 value_sz,
11115 ub2 dty, void *indp, ub2 *alenp, ub2 *rcodep,
11116 ub4 maxarr_len, ub4 *curelep, ub4 mode);
11117
11118
11119sword OCIStmtBindByName (OCIStmt *stmtp, OCIBind *bindp, OCIError *errhp,
11120 const OraText *placeholder, sb4 placeh_len, void *valuep,
11121 sb4 value_sz, ub2 dty, void *indp, ub2 *alenp,
11122 ub2 *rcodep, ub4 maxarr_len, ub4 *curelep, ub4 mode);
11123
11124sword ocidefn (OCIStmt *stmtp, OCIDefine *defnp, OCIError *errhp,
11125 ub4 position, void *valuep, sb4 value_sz, ub2 dty,
11126 void *indp, ub2 *rlenp, ub2 *rcodep, ub4 mode);
11127#endif /* NEVER */
11128
11129#endif /* OCIAP_ORACLE */