orl.inc 178 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911
  1. {
  2. Automatically converted by H2Pas 1.0.0 from orl.h
  3. The following command line parameters were used:
  4. -p
  5. -D
  6. -l
  7. jojo.so
  8. orl.h
  9. }
  10. {$PACKRECORDS C}
  11. { Copyright (c) 1993, 2003, Oracle Corporation. All rights reserved. }
  12. {
  13. Author: Srinath Krishnaswamy
  14. Date: 11/24/93
  15. Source documents: "Functional Specification for C Language Mapping of
  16. OTS Types, Object Management Subsystem", "Oracle C
  17. Coding Standards version 2.2", and the header file
  18. template
  19. Rule sets: the generic and .h file rule sets
  20. Quality status: not exited
  21. Identification tag: [ one or more letters to identify the .h file ]
  22. Revision code: 11/24/93
  23. NAME
  24. ORL - ORacle's external C Language interface to primitive OTS types
  25. DESCRIPTION
  26. This header file contains C langauge interface to the OTS primitive
  27. types. The interface includes C mapping of OTS primitive types and
  28. the prototype of the pre-defined operations on the primitive types.
  29. ***********************************************************************
  30. *** NOTE: The OCI functions for objects requires the ***
  31. *** application to be running in OBJECT mode. That is, during ***
  32. *** process initialization OCIInitialize(), the mode ***
  33. *** specified should be OBJECT mode. ***
  34. ** OCIInitialize(OCI_OBJECT, ..); ***
  35. ***********************************************************************
  36. RELATED DOCUMENTS
  37. [1] Krishnaswamy, Srinath and Nguyen, Tin A., "Functional Specification
  38. for C Language Mapping of OTS Types, Object Management Subsystem",
  39. March 1994.
  40. [2] Nguyen, Tin A., "The Open Type System", Oracle Corporation,
  41. February 1994.
  42. [3] Klein, Jonathan D., "Large Field Management", Oracle Corporation,
  43. October 1993.
  44. PUBLIC FUNCTIONS
  45. OCI - OCI functions to manipulate Oracle Number, float and decimal
  46. ARITHMETIC
  47. OCINumberInc - OCINumber INCrement (optimized)
  48. OCINumberDec - OCINumber DECrement (optimized)
  49. OCINumberAdd - OCINumber ADD numbers
  50. OCINumberSub - OCINumber SUBtract numbers
  51. OCINumberMul - OCINumber MULtiply numbers
  52. OCINumberDiv - OCINumber DIVide numbers
  53. OCINumberMod - OCINumber MODulo division
  54. OCINumberIntPower - OCINumber integer PoWeR
  55. OCINumberShift - OCINumber decimal ShiFT number
  56. OCINumberNeg - OCINumber NEGate number
  57. OCINumberAbs - OCINumber ABSolute value
  58. OCINumberCeil - OCINumber CEiling of number
  59. OCINumberFloor - OCINumber FLooR of number
  60. OCINumberSqrt - OCINumber SQuare Root of number
  61. OCINumberSign - OCINumber get SIGN of number
  62. NATIVE TYPE CONVERSION
  63. OCINumberToInt - OCINumber convert number TO machine-format Integer
  64. OCINumberFromInt - OCINumber convert machine-format Integer TO Number
  65. OCINumberToReal - OCINumber convert number TO machine-format Real
  66. OCINumberToRealArray - OCINumber convert array of numbers TO
  67. machine-format Real
  68. OCINumberFromReal - OCINumber convert machine-format Real TO Number
  69. TEXT STRING CONVERSION
  70. OCINumberToText - OCINumber convert number TO String
  71. OCINumberFromText - OCINumber convert String TO Number
  72. COMPARISON
  73. OCINumberCmp - OCINumber CoMPare numbers
  74. OCINumberIsZero - OCINumber comparison with ZERo
  75. OCINumberIsInt - OCINumber Is an Integer
  76. ASSIGNMENT
  77. OCINumberAssign - OCINumber ASsiGn number
  78. OCINumberSetZero - OCINumber Set number to Zero value
  79. OCINumberSetPi - OCINumber Set number to Pi
  80. ROUNDING
  81. OCINumberTrunc - OCINumber TRUncate an Oracle number
  82. OCINumberRound - OCINumber ROUnd number
  83. OCINumberPrec - OCINumber round to Precision digits
  84. TRANSCENDENTAL
  85. OCINumberSin - OCINumber SINe
  86. OCINumberArcSin - OCINumber Arc SINe
  87. OCINumberHypSin - OCINumber SiNe Hyperbolic
  88. OCINumberCos - OCINumber COSine
  89. OCINumberArcCos - OCINumber Arc COSine
  90. OCINumberHypCos - OCINumber CoSine Hyperbolic
  91. OCINumberTan - OCINumber TANgent
  92. OCINumberArcTan - OCINumber Arc TANgent
  93. OCINumberArcTan2 - OCINumber Arc TaNgent 2
  94. OCINumberHypTan - OCINumber TaNgent Hyperbolic
  95. OCINumberPower - OCINumber arbitrary Base EXponentiation
  96. OCINumberExp - OCINumber EXPonentiation to base e
  97. OCINumberLn - OCINumber Logarithm Natural
  98. OCINumberLog - OCINumber LOGarithm to arbitrary base
  99. OCIDate - OCI functions to manipulate OCI Date
  100. OCIDateToExternal - OCIDate convert date to external form
  101. OCIDateFromExternal - OCIDate convert external form of date into OCIDate
  102. OCIDateAssign - OCIDate Assignment
  103. OCIDateToText - OCIDate convert date TO String
  104. OCIDateFromText - OCIDate convert String TO Date
  105. OCIDateZoneToZone - OCIDate convert date from one time
  106. Zone TO another Zone
  107. OCIDateCompare - OCIDate CoMPare dates
  108. OCIDateAddMonths - OCIDate ADd or subtract Months
  109. OCIDateAddDays - OCIDate ADd or subtract Days
  110. OCIDateLastDay - OCIDate get date of LaST day of month
  111. OCIDateDaysBetween - OCIDate get number of days BeTWeen two dates
  112. OCIDateNextDay - OCIDate get date of Next DaY
  113. OCIDateCheck - OCIDate CHecK if the given date is valid
  114. OCIDateSysDate - OCIDate get current SYStem date and time
  115. OCIString - OCI String functions to manipulate Variable-length string
  116. OCIStringAssign - OCIString Assign string to string
  117. OCIStringAssignText - OCIString Assign Text string to string
  118. OCIStringResize - OCIString ReSiZe string
  119. OCIStringSize - OCIString get String Size
  120. OCIStringPtr - OCIString get String PoinTeR
  121. OCIStringAllocSize - OCIString get Allocated SiZe
  122. OCIRaw - OCI Raw functions to manipulate variable-length raW
  123. OCIRawAssignRaw - OCIRaw Assign Raw (of type OCIRaw*) to raw
  124. (of type OCIRaw*)
  125. OCIRawResize - OCIRaw Resize raw
  126. OCIRawSize - OCIRaw get Raw Size
  127. OCIRawPtr - OCIRaw get Raw data Pointer
  128. OCIRawAllocSize - OCIRaw get Allocated Size
  129. OCIColl - OCI Collection generic functions. These functions can be
  130. used to manipulate both variable-length array (varray) and
  131. nested table.
  132. OCICollSize - OCIColl return current SIZe of the given collection
  133. (in number of elements)
  134. OCICollMax - OCIColl return the MAXimum number of elements in the
  135. collection (i.e. upper-bound)
  136. OCICollGetElem - OCIColl GET pointer to the element at the given
  137. position
  138. OCICollAssignElem - OCIColl assign to element at given index
  139. OCICollAssign - OCIColl ASsiGn collection; perform deep-copy of source
  140. collection to target collection
  141. OCICollAppend - OCIColl aPPend the given element to the end of the
  142. collection
  143. OCICollTrim - OCIColl trim (delete) the given number of elements
  144. from the end of the collection
  145. OCICollIsLocator - OCIColl indicates whether a collection is locator
  146. based or not.
  147. OCIIterCreate - OCIColl Create an ITerator to scan the collection
  148. elements
  149. OCIIterDelete - OCIColl Delete ITerator
  150. OCIIterInit - OCIColl Initialize ITerator to scan the given collection
  151. OCIIterGetCurrent - OCIColl Iterator based, get CURrent
  152. collection element
  153. OCIIterNext - OCIColl Iterator based, get NeXT collection element
  154. OCIIterPrev - OCIColl Iterator based, get PReVious collection element
  155. OCITable - OCI functions to manipulate nested Table. The OCIColl*() and
  156. OCITable*() functions can be used to manipulate nested table
  157. OCITableDelete(i) - OCITable if element(i) exists then the element is
  158. marked as deleted else the function returns false. So
  159. delete's create "holes".
  160. OCITableExists(i) - OCITable return true iff an element at
  161. position i EXIsts
  162. OCITableFirst - OCITable return the smallest value of i for which
  163. exists(i) is true.
  164. OCITableLast - OCITable return the largest value of i for which
  165. exists(i) is true.
  166. OCITableNext(i) - OCITable return pointer to the smallest position j,
  167. greater than i, such that OCITableExists(j) is true
  168. OCITablePrev(i) - OCITable return pointer to the largest position j,
  169. less than i, such that OCITableExists(j) is true
  170. OCITableSize - OCITable return current SIZe of the given nested table not
  171. including deleted elements
  172. OCIRef - OCI functions to manipulate object Reference
  173. OCIRefClear - OCIRef CLeaR or nullify a ref
  174. OCIRefAssign - OCIRef ASsiGn a ref to another
  175. OCIRefIsEqual - OCIRef compare two refs for EQUality
  176. OCIRefIsNull - OCIRef test if a ref is NULl
  177. OCIRefFromHex - OCIRef convert a Hexadecimal string TO a Ref
  178. OCIRefToHex - OCIRef convert a ref to a Hexadecimal string
  179. OCIRefHexSize - OCIRef get size of buffer in bytes to store hexadecimal
  180. string
  181. OBSOLETE: to be replaced by functions from oci.h:
  182. ORLL - ORL functions to manipulate lob Locators
  183. orllasg - ORLL AsiGn one locator to another
  184. orllequ - ORLL compare two locators for EQUality
  185. orlliini - ORLL Is the locator INItialized?
  186. orllgsz - ORLL Get locator SiZe
  187. orllgcid - ORLL Get Character set ID
  188. NOTE: The following are specific to FILE lobs:
  189. orllsnm - ORLL Set directory alias and file NaMe in the locator
  190. orllgnm - ORLL Get directory alias and file NaMe from the locator
  191. EXAMPLES
  192. Examples are given in the description of each function where
  193. relevant.
  194. NOTES
  195. This file has been subsetted to contain ONLY the routines that will
  196. be in the first release.
  197. QUESTIONS
  198. MODIFIED
  199. srseshad 03/12/03 - convert oci public api to ansi
  200. rpingte 11/21/02 - Add OCICollGetElemArray and OCINumberToRealArray
  201. aahluwal 06/03/02 - bug 2360115
  202. gayyappa 02/01/02 - fix 2210776 : change Dom to DOM
  203. whe 09/25/01 - add OCIXMLType & OCIDomDocument opaque types
  204. bpalaval 02/09/01 - Change text to oratext.
  205. rkasamse 09/20/99 - lint changes
  206. whe 09/01/99 - 976457:check __cplusplus for C++ code
  207. hsbedi 08/11/99 - Add macro
  208. rxgovind 10/14/98 - make non exposed calls (OCIRowType etc) private
  209. rxgovind 06/09/98 - update OCIRowTypeCreate
  210. nmantrav 05/11/98 - add OCIRowTypeGetCount
  211. rxgovind 03/29/98 - add OCIRowType and OCIRowData interfaces
  212. jwijaya 05/06/98 - add OCICollIsLocator
  213. rxgovind 03/18/98 - opaque types: move to kolo.h
  214. etucker 02/02/98 - add comments for Dec and Inc
  215. etucker 01/29/98 - Finish core5 integration
  216. rxgovind 11/11/97 - opaque types
  217. etucker 10/28/97 - add ORLN functions for SDK
  218. cxcheng 07/28/97 - remove OCILobLocator #define
  219. skmishra 05/13/97 - stdcc compatibility changes
  220. skrishna 04/25/97 - rename OCINumber*(): Exp Power TanHyp Zero Init
  221. TanToArc Sqr Truncate and Compare
  222. skotsovo 03/31/97 - remove OCILobLocatorSize
  223. skrishna 03/25/97 - remove orld2i and orldi2d
  224. skrishna 03/18/97 - fix ifdef for supporting ansi and k&r proto-types
  225. cxcheng 02/06/97 - take out short name support except with SLSHORTNAME
  226. skrishna 01/06/97 - update OCITableSize() comments
  227. skrishna 12/27/96 - fix OCIDateGet/OCIDateSet
  228. skrishna 12/12/96 - update OCICollGelElem comments
  229. skrishna 11/07/96 - OCICollGetElem: interface change
  230. skrishna 11/05/96 - add OCIDate Get/Set and OCIDateAssign
  231. cxcheng 10/31/96 - change OCINumberTanHyp to OCINumberHypTan
  232. cxcheng 10/30/96 - #define orll short names to long names
  233. dchatter 10/26/96 - fix some OCI file long names
  234. cxcheng 10/24/96 - remove unnecessary comment in front
  235. cxcheng 10/14/96 - disable long name mapping for LOB functions
  236. skrishna 10/13/96 - continue beautification
  237. skotsovo 10/16/96 - update ocilob names
  238. cxcheng 10/09/96 - add structure members in #define for date/time
  239. cxcheng 10/09/96 - more lint fixes
  240. skrishna 10/09/96 - continue beautification
  241. cxcheng 10/09/96 - more fixes
  242. skrishna 10/09/96 - change fixed-char rep. to orlvstr*
  243. jwijaya 10/08/96 - continue beautification
  244. jwijaya 10/07/96 - beautify
  245. cxcheng 10/07/96 - more changes
  246. cxcheng 10/04/96 - replace short names with long names
  247. skrishna 10/01/96 - orlcsiz, orltsiz: change prototype to take errhdl
  248. skrishna 09/23/96 - fix lint errors
  249. skotsovo 09/23/96 - remove orllmkcur().
  250. jwijaya 09/17/96 - comments on null ref
  251. skrishna 09/19/96 - change orlraw format
  252. skotsovo 09/19/96 - add orlliini and remove orllnul
  253. skrishna 08/14/96 - orlvstr: change format to ub4 followed by text
  254. jboonleu 08/06/96 - update comment
  255. skotsovo 08/08/96 - revert to locators instead of descriptors as input t
  256. jboonleu 07/23/96 - remove orlrcur
  257. skrishna 07/06/96 - add orltsiz
  258. skrishna 07/05/96 - add orld2i and orldi2d
  259. jwijaya 07/03/96 - add ANSI prototypes
  260. skrishna 06/27/96 - document default string format in orlds2d & orld2s
  261. skrishna 06/25/96 - change max date value
  262. skrishna 06/18/96 - modify orld2s() comments
  263. skotsovo 06/13/96 - orll functions take lob descriptors instead of locat
  264. rxgovind 06/05/96 - change prototype of orlrcur to take ocienvh
  265. skrishna 05/30/96 - support collection trimming
  266. skrishna 05/30/96 - remove orlralo/fre and orllalo/fre instead use
  267. orionew/fre
  268. skrishna 05/28/96 - add orlt*() and modify orla*()
  269. skotsovo 05/23/96 - add orlbl typedefs for pro*c
  270. jboonleu 05/14/96 - add orlrcur
  271. rxgovind 05/08/96 - changes for 3gl callbacks
  272. skotsovo 05/01/96 - in orllasg, no need to alloc orlbl*
  273. skrishna 04/21/96 - merge changes from 960418 object branch into big
  274. skrishna 04/17/96 - rename orlrcpy to orlrasg
  275. skrishna 04/12/96 - add orlr2h and orlrh2r functions
  276. skotsovo 04/15/96 - add fnt to make the lob locator current
  277. skrishna 04/08/96 - change orl*() to take ocienvh* and ocierrh* instead
  278. of oroenv*
  279. skotsovo 03/22/96 - add locator functions
  280. skotsovo 03/22/96 - add locator functions
  281. skrishna 02/27/96 - remove mlslabel interface
  282. skotsovo 02/20/96 - remove orlbty and use dty type instead.
  283. skotsovo 02/14/96 - add text file lobs.
  284. skrishna 01/31/96 - update comments of orln2r, orldchk, orlds2d & orld2s
  285. skrishna 01/31/96 - change orld2s() and orln2s() to return string length
  286. skrishna 01/21/96 - remove old raw interface
  287. skrishna 12/14/95 - add raw interface
  288. skotsovo 01/03/96 - change LOB offsets and lengths from ub4 to ubig_ora
  289. to support 64 bit machines.
  290. skotsovo 10/30/95 - add orlblsiz() to get lob locator size
  291. skrishna 10/24/95 - move ref functions from ori and update the ref
  292. functions to support variable-length ref
  293. cxcheng 10/20/95 - add more comments on number versions
  294. cxcheng 10/13/95 - add more number functions
  295. cxcheng 08/29/95 - Support for segmented varrays
  296. cxcheng 08/18/95 - modifiy orlmls structure
  297. skrishna 06/06/95 - rename orln, orld, orlvs and orlva to orlnum,
  298. orldat, orlvstr and orlvary respectively
  299. skrishna 11/15/94 - remove orlnget() function
  300. skrishna 09/20/94 - modify orldbtw() to return number of days only
  301. skrishna 08/24/94 - change format string length type from ub4 to ub1
  302. skrishna 07/19/94 - Rename orln2c & orlnc2n to orln2s & orlns2n
  303. skrishna 06/29/94 - Add blob interface; add examples
  304. skrishna 06/23/94 - Update comments and format
  305. skrishna 05/19/94 - update varray append comments
  306. skrishna 05/05/94 - Subsetting
  307. skrishna 11/24/93 - Creation
  308. }
  309. {--------------------------------------------------------------------------- }
  310. { SHORT NAMES SUPPORT SECTION }
  311. {--------------------------------------------------------------------------- }
  312. {$ifdef SLSHORTNAME}
  313. { the following are short names that are only supported on IBM mainframes
  314. with the SLSHORTNAME defined.
  315. With this all subsequent long names will actually be substituted with
  316. the short names here }
  317. const
  318. OCIArray = orlvary;
  319. OCIColl = orlcol;
  320. OCICollAppend = orlcapp;
  321. OCICollAssign = orlcasg;
  322. OCICollAssignElem = orlcase;
  323. OCICollGetElem = orlcget;
  324. OCICollGetElemArray = orlcgeta;
  325. OCICollMax = orlcmax;
  326. OCICollSize = orlcsiz;
  327. OCICollTrim = orlctrm;
  328. OCICollIsLocator = orlcilc;
  329. OCIDate = orldat;
  330. OCIDateAddDays = orldadd;
  331. OCIDateAddMonths = orldadm;
  332. OCIDateCheck = orldchk;
  333. OCIDateCompare = orldcmp;
  334. OCIDateDD = day_orldat;
  335. OCIDateDaysBetween = orldbtw;
  336. OCIDateFromText = orlds2d;
  337. OCIDateLastDay = orldlst;
  338. OCIDateMM = mon_orldat;
  339. OCIDateNextDay = orldndy;
  340. OCIDateSysDate = orldsys;
  341. OCIDateTime = time_orldat;
  342. OCIDateYYYY = gye_orldat;
  343. OCIDateZoneToZone = orldz2z;
  344. OCIIter = orlcitr;
  345. OCIIterCreate = orlccit;
  346. OCIIterDelete = orlcdit;
  347. OCIIterGetCurrent = orlcicur;
  348. OCIIterInit = orlciit;
  349. OCIIterNext = orlcinxt;
  350. OCIIterPrev = orlciprv;
  351. OCINumber = orlnum;
  352. OCINumberAbs = orlnabs;
  353. OCINumberAdd = orlnadd;
  354. OCINumberArcCos = orlnacos;
  355. OCINumberArcSin = orlnasin;
  356. OCINumberArcTan = orlnatan;
  357. OCINumberAssign = orlnasg;
  358. OCINumberCeil = orlncel;
  359. OCINumberCos = orlncos;
  360. OCINumberDiv = orlndiv;
  361. OCINumberPower = orlnbex;
  362. OCINumberFloor = orlnflr;
  363. OCINumberFromInt = orlni2n;
  364. OCINumberFromReal = orlnr2n;
  365. OCINumberFromText = orlns2n;
  366. OCINumberHypCos = orlncsh;
  367. OCINumberHypSin = orlnsnh;
  368. OCINumberSetZero = orlnini;
  369. OCINumberSetPi = orlnspi;
  370. OCINumberInc = orlninc;
  371. OCINumberDec = orlndec;
  372. OCINumberIntPower = orlnpwr;
  373. OCINumberLn = orlnln;
  374. OCINumberLog = orlnlog;
  375. OCINumberMod = orlnmod;
  376. OCINumberMul = orlnmul;
  377. OCINumberNeg = orlnneg;
  378. OCINumberPart = orlnpart;
  379. OCINumberExp = orlnexp;
  380. OCINumberRound = orlnrou;
  381. OCINumberPrec = orlnpre;
  382. OCINumberShift = orlnsft;
  383. OCINumberSign = orlnsgn;
  384. OCINumberSin = orlnsin;
  385. OCINumberSqrt = orlnsqr;
  386. OCINumberSub = orlnsub;
  387. OCINumberTan = orlntan;
  388. OCINumberHypTan = orlntnh;
  389. OCINumberArcTan2 = orlnatn2;
  390. OCINumberToInt = orln2i;
  391. OCINumberToReal = orln2r;
  392. OCINumberToRealArray = orln2ra;
  393. OCINumberToText = orln2s;
  394. OCINumberTrunc = orlntru;
  395. OCINumberCmp = orlncmp;
  396. OCINumberIsZero = orlnzer;
  397. OCINumberIsInt = orlnint;
  398. OCIRaw = orlraw;
  399. OCIRawAllocSize = orlwasz;
  400. OCIRawAssignBytes = orlwabr;
  401. OCIRawAssignRaw = orlwarr;
  402. OCIRawPtr = orlwgrp;
  403. OCIRawResize = orlwrsz;
  404. OCIRawSize = orlwgsz;
  405. OCIRefAssign = orlrasg;
  406. OCIRefClear = orlrclr;
  407. OCIRefFromHex = orlrh2r;
  408. OCIRefHexSize = orlrhsz;
  409. OCIRefIsEqual = orlrequ;
  410. OCIRefIsNull = orlrnul;
  411. OCIRefToHex = orlr2h;
  412. OCIString = orlvstr;
  413. OCIStringAllocSize = orlvasz;
  414. OCIStringAssign = orlvass;
  415. OCIStringAssignText = orlvats;
  416. OCIStringPtr = orlvgsp;
  417. OCIStringResize = orlvrsz;
  418. OCIStringSize = orlvgsz;
  419. OCITable = orltbl;
  420. OCITableDelete = orltdel;
  421. OCITableExists = orltexi;
  422. OCITableFirst = orltfst;
  423. OCITableLast = orltlst;
  424. OCITableNext = orltnxt;
  425. OCITablePrev = orltprv;
  426. OCITableSize = orltsiz;
  427. OCITime = orldtm;
  428. OCITimeHH = orldtmhh;
  429. OCITimeMI = orldtmmm;
  430. OCITimeSS = orldtmss;
  431. OCI_LOBMODE_READONLY = ORLBMORO;
  432. OCI_LOBMODE_READWRITE = ORLBMORW;
  433. {$endif}
  434. { SLSHORTNAME }
  435. {*************************************************************************** }
  436. { NUMBER/FLOAT/DECIMAL TYPE }
  437. {*************************************************************************** }
  438. const
  439. OCI_NUMBER_SIZE = 22;
  440. type
  441. POCINumber = ^OCINumber;
  442. OCINumber = record
  443. OCINumberPart : array[0..(OCI_NUMBER_SIZE)-1] of ub1;
  444. end;
  445. {
  446. * OCINumber - OCI Number mapping in c
  447. *
  448. * The OTS types: NUMBER, NUMERIC, INT, SHORTINT, REAL, DOUBLE PRECISION,
  449. * FLOAT and DECIMAL are represented by OCINumber.
  450. * The contents of OCINumber is opaque to clients.
  451. *
  452. * For binding variables of type OCINumber in OCI calls (OCIBindByName(),
  453. * OCIBindByPos(), and OCIDefineByPos()) use the type code SQLT_VNU.
  454. }
  455. {
  456. EXAMPLE
  457. The following example shows how to manipulate an attribute of type
  458. oracle number.
  459. struct person
  460. OCINumber sal;
  461. ;
  462. typedef struct person person;
  463. OCIError *err;
  464. person* joe;
  465. person* tom;
  466. person* debbie;
  467. OCINumber *joesal;
  468. OCINumber *tomsal;
  469. OCINumber *debsal;
  470. sword status;
  471. int inum;
  472. double dnum;
  473. OCINumber ornum;
  474. char buffer[21];
  475. ub4 buflen;
  476. sword result;
  477. /o See oci.h for an example of how to initialize OCIError.
  478. o For this example, assume the OCIEnv and OCIError has been
  479. o initialized.
  480. o/
  481. /o Pin joe, tom and debbie person objects in the object cache. See ori.h
  482. o for an example on pinning objects. For this example, assume that
  483. o joe, tom and debbie are pointing to pinned objects.
  484. o/
  485. joesal = &joe->sal;
  486. tomsal = &tom->sal;
  487. debsal = &debbie->sal;
  488. /o initialize joe's salary to be $12,000 o/
  489. inum = 12000;
  490. status = OCINumberFromInt(err, &inum, sizeof(inum), OCI_NUMBER_SIGNED,
  491. joesal);
  492. if (status != OCI_SUCCESS)
  493. /o goto to handle error from OCINumberFromInt o/;
  494. /o initialize tom's salary to be same as joe o/
  495. OCINumberAssign(err, joesal, tomsal);
  496. /o initialize debbie's salary to be 20% more than joe's o/
  497. dnum = 1.2;
  498. status = OCINumberFromReal(err, &dnum, sizeof(double), &ornum);
  499. if (status != OCI_SUCCESS)
  500. /o goto to handle error from OCINumberFromReal o/;
  501. status = OCINumberMul(err, joesal, &ornum, debsal);
  502. if (status != OCI_SUCCESS) /o goto to handle error from OCINumberMul o/;
  503. /o give tom a 50% raise o/
  504. dnum = 1.5;
  505. status = OCINumberFromReal(err, &dnum, sizeof(double), &ornum);
  506. if (status != OCI_SUCCESS)
  507. /o goto to handle error from OCINumberFromReal o/;
  508. status = OCINumberMul(err, tomsal, &ornum, tomsal);
  509. if (status != OCI_SUCCESS) /o goto to handle error from OCINumberMul o/;
  510. /o double joe's salary o/
  511. status = OCINumberAdd(err, joesal, joesal, joesal);
  512. if (status != OCI_SUCCESS) /o goto to handle error from OCINumberAdd o/;
  513. /o get joe's salary in integer o/
  514. status = OCINumberToInt(err, joesal, sizeof(inum), OCI_NUMBER_SIGNED,
  515. &inum);
  516. if (status != OCI_SUCCESS)/o goto to handle error from OCINumberToInt o/;
  517. /o inum is set to 24000 o/
  518. /o get debbie's salary in double o/
  519. status = OCINumberToReal(err, debsal, sizeof(dnum), &dnum);
  520. if (status != OCI_SUCCESS)/o goto to handle error from OCINumberToReal o/;
  521. /o dnum is set to 14400 o/
  522. /o print tom's salary as DEM0001`8000.00 o/
  523. buflen = sizeof(buffer);
  524. status = OCINumberToText(err, tomsal, "C0999G9999D99", 13,
  525. "NLS_NUMERIC_CHARACTERS='.`' NLS_ISO_CURRENCY='Germany'", 54,
  526. &buflen, buffer);
  527. if (status != OCI_SUCCESS)/o goto to handle error from OCINumberToText o/;
  528. printf("tom's salary = %s\n", buffer);
  529. /o compare joe and tom's salary o/
  530. status = OCINumberCmp(err, joesal, tomsal, &result);
  531. if (status != OCI_SUCCESS) /o goto to handle error from OCINumberCmp o/;
  532. /o result is positive o/
  533. /o read debbie's new salary from string o/
  534. status = OCINumberFromText(err, "48`000.00", 9, "99G999D99", 9,
  535. "NLS_NUMERIC_CHARACTERS='.`'", 27, debsal);
  536. if (status != OCI_SUCCESS)
  537. /o goto to handle error from OCINumberFromText o/;
  538. /o debbie's salary is now 48000.00 o/
  539. }
  540. {----------------------------- OCINumberInc -------------------------------- }
  541. {$IFNDEF LinkDynamically}
  542. function OCINumberInc(err:POCIError; number:POCINumber):sword;cdecl;external ocilib name 'OCINumberInc';
  543. {$ELSE}
  544. var OCINumberInc : function (err:POCIError; number:POCINumber):sword;cdecl;
  545. {$ENDIF}
  546. {
  547. NAME: OCINumberInc - OCINumber INCrement numbers
  548. PARAMETERS:
  549. err (IN/OUT) - error handle. If there is an error, it is
  550. recorded in 'err' and this function returns OCI_ERROR.
  551. The error recorded in 'err' can be retrieved by calling
  552. OCIErrorGet().
  553. number (IN/OUT) a positive Oracle number to be incremented
  554. DESCRIPTION:
  555. Increment Oracle number in place. It is assumed that the input is
  556. an integer between 0 and 100^21-2. If the is input too large, it will
  557. be treated as 0 - the result will be an Oracle number 1. If the input
  558. is not a positive integer, the result will be unpredictable.
  559. RETURNS:
  560. OCI_SUCCESS if the function completes successfully.
  561. OCI_INVALID_HANDLE if 'err' is NULL.
  562. OCI_ERROR if
  563. any of the number arguments is null
  564. }
  565. {----------------------------- OCINumberDec -------------------------------- }
  566. {$IFNDEF LinkDynamically}
  567. function OCINumberDec(err:POCIError; number:POCINumber):sword;cdecl;external ocilib name 'OCINumberDec';
  568. {$ELSE}
  569. OCINumberDec : function (err:POCIError; number:POCINumber):sword;cdecl;
  570. {$ENDIF}
  571. {
  572. NAME: OCINumberDec - OCINumber DECrement numbers
  573. PARAMETERS:
  574. err (IN/OUT) - error handle. If there is an error, it is
  575. recorded in 'err' and this function returns OCI_ERROR.
  576. The error recorded in 'err' can be retrieved by calling
  577. OCIErrorGet().
  578. number (IN/OUT) - a positive Oracle number to be decremented
  579. DESCRIPTION:
  580. Decrement Oracle number in place. It is assumed that the input is an
  581. integer between 1 and 100^21-2. If the input is too large, it will be
  582. treated as 1 - the result will be an Oracle number 0. If the input is
  583. not a positive integer, the result will be unpredictable.
  584. RETURNS:
  585. OCI_SUCCESS if the function completes successfully.
  586. OCI_INVALID_HANDLE if 'err' is NULL.
  587. OCI_ERROR if
  588. any of the number arguments is null
  589. }
  590. {-------------------------- OCINumberSetZero ------------------------------- }
  591. {$IFNDEF LinkDynamically}
  592. procedure OCINumberSetZero(err:POCIError; num:POCINumber);cdecl;external ocilib name 'OCINumberSetZero';
  593. {$ELSE}
  594. OCINumberSetZero : procedure (err:POCIError; num:POCINumber);cdecl;
  595. {$ENDIF}
  596. {
  597. NAME: OCINumberSetZero - OCINumber Set number to Zero value
  598. PARAMETERS:
  599. err (IN/OUT) - pointer to OCI error handle
  600. num (OUT) - set to zero value
  601. DESCRIPTION:
  602. Initialize the given number to value 0.
  603. }
  604. {--------------------------- OCINumberSetPi -------------------------------- }
  605. {$IFNDEF LinkDynamically}
  606. procedure OCINumberSetPi(err:POCIError; num:POCINumber);cdecl;external ocilib name 'OCINumberSetPi';
  607. {$ELSE}
  608. OCINumberSetPi : procedure (err:POCIError; num:POCINumber);cdecl;
  609. {$ENDIF}
  610. {
  611. NAME: OCINumberSetPi - OCINumber Set number to Pi
  612. err (IN/OUT) - pointer to OCI error handle
  613. num (OUT) - set to zero value
  614. DESCRIPTION:
  615. Initialize the given number to value Pi.
  616. }
  617. {----------------------------- OCINumberAdd -------------------------------- }
  618. {$IFNDEF LinkDynamically}
  619. function OCINumberAdd(err:POCIError; number1:POCINumber; number2:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberAdd';
  620. {$ELSE}
  621. OCINumberAdd : function (err:POCIError; number1:POCINumber; number2:POCINumber; result:POCINumber):sword;cdecl;
  622. {$ENDIF}
  623. {
  624. NAME: OCINumberAdd - OCINumber ADD numbers
  625. PARAMETERS:
  626. err (IN/OUT) - error handle. If there is an error, it is
  627. recorded in 'err' and this function returns OCI_ERROR.
  628. The error recorded in 'err' can be retrieved by calling
  629. OCIErrorGet().
  630. number1, number2 (IN) - numbers to be added
  631. result (OUT) - result of adding 'number1' with 'number2'
  632. DESCRIPTION:
  633. Add 'number1' with 'number2' and return result in 'result'.
  634. RETURNS:
  635. OCI_SUCCESS if the function completes successfully.
  636. OCI_INVALID_HANDLE if 'err' is NULL.
  637. OCI_ERROR if
  638. any of the number arguments is null
  639. }
  640. {----------------------------- OCINumberSub -------------------------------- }
  641. {$IFNDEF LinkDynamically}
  642. function OCINumberSub(err:POCIError; number1:POCINumber; number2:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberSub';
  643. {$ELSE}
  644. OCINumberSub : function (err:POCIError; number1:POCINumber; number2:POCINumber; result:POCINumber):sword;cdecl;
  645. {$ENDIF}
  646. {
  647. NAME: OCINumberSub - OCINumber SUBtract numbers
  648. PARAMETERS:
  649. err (IN/OUT) - error handle. If there is an error, it is
  650. recorded in 'err' and this function returns OCI_ERROR.
  651. The error recorded in 'err' can be retrieved by calling
  652. OCIErrorGet().
  653. number1, number2 (IN) - 'number2' subtracted from 'number1'
  654. result (OUT) - subtraction result
  655. DESCRIPTION:
  656. Subtract 'number2' from 'number1' and return result in 'result'.
  657. RETURNS:
  658. OCI_SUCCESS if the function completes successfully.
  659. OCI_INVALID_HANDLE if 'err' is NULL.
  660. OCI_ERROR if
  661. any of the number arguments is null
  662. }
  663. {----------------------------- OCINumberMul -------------------------------- }
  664. {$IFNDEF LinkDynamically}
  665. function OCINumberMul(err:POCIError; number1:POCINumber; number2:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberMul';
  666. {$ELSE}
  667. OCINumberMul : function (err:POCIError; number1:POCINumber; number2:POCINumber; result:POCINumber):sword;cdecl;
  668. {$ENDIF}
  669. {
  670. NAME: OCINumberMul - OCINumber MULtiply numbers
  671. PARAMETERS:
  672. err (IN/OUT) - error handle. If there is an error, it is
  673. recorded in 'err' and this function returns OCI_ERROR.
  674. The error recorded in 'err' can be retrieved by calling
  675. OCIErrorGet().
  676. number1, number2 (IN) - numbers to be multiplied
  677. result (OUT) - multiplication result
  678. DESCRIPTION:
  679. Multiply 'number1' with 'number2' and return result in 'result'.
  680. RETURNS:
  681. OCI_SUCCESS if the function completes successfully.
  682. OCI_INVALID_HANDLE if 'err' is NULL.
  683. OCI_ERROR if
  684. any of the number arguments is null
  685. }
  686. {----------------------------- OCINumberDiv -------------------------------- }
  687. {$IFNDEF LinkDynamically}
  688. function OCINumberDiv(err:POCIError; number1:POCINumber; number2:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberDiv';
  689. {$ELSE}
  690. OCINumberDiv : function (err:POCIError; number1:POCINumber; number2:POCINumber; result:POCINumber):sword;cdecl;
  691. {$ENDIF}
  692. {
  693. NAME: OCINumberDiv - OCINumber DIVide numbers
  694. PARAMETERS:
  695. err (IN/OUT) - error handle. If there is an error, it is
  696. recorded in 'err' and this function returns OCI_ERROR.
  697. The error recorded in 'err' can be retrieved by calling
  698. OCIErrorGet().
  699. number1 (IN) - pointer to the numerator
  700. number2 (IN) - pointer to the denominator
  701. result (OUT) - division result
  702. DESCRIPTION:
  703. Divide 'number1' by 'number2' and return result in 'result'.
  704. RETURNS:
  705. OCI_SUCCESS if the function completes successfully.
  706. OCI_INVALID_HANDLE if 'err' is NULL.
  707. OCI_ERROR if
  708. any of the number arguments is null
  709. underflow errorr
  710. overflow errorr
  711. divide by zero errorr
  712. }
  713. {----------------------------- OCINumberMod -------------------------------- }
  714. {$IFNDEF LinkDynamically}
  715. function OCINumberMod(err:POCIError; number1:POCINumber; number2:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberMod';
  716. {$ELSE}
  717. OCINumberMod : function (err:POCIError; number1:POCINumber; number2:POCINumber; result:POCINumber):sword;cdecl;
  718. {$ENDIF}
  719. {
  720. NAME: OCINumberMod - OCINumber MODulous
  721. PARAMETERS:
  722. err (IN/OUT) - error handle. If there is an error, it is
  723. recorded in 'err' and this function returns OCI_ERROR.
  724. The error recorded in 'err' can be retrieved by calling
  725. OCIErrorGet().
  726. number1 (IN) - pointer to the numerator
  727. number2 (IN) - pointer to the denominator
  728. result (OUT) - remainder of the result
  729. DESCRIPTION:
  730. Finds the remainder of the division of two Oracle numbers.
  731. RETURNS:
  732. OCI_SUCCESS if the function completes successfully.
  733. OCI_INVALID_HANDLE if 'err' is NULL.
  734. OCI_ERROR if
  735. any of the number arguments is null
  736. divide by zero errorr
  737. }
  738. {------------------------ OCINumberIntPower -------------------------------- }
  739. {$IFNDEF LinkDynamically}
  740. function OCINumberIntPower(err:POCIError; base:POCINumber; exp:sword; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberIntPower';
  741. {$ELSE}
  742. OCINumberIntPower : function (err:POCIError; base:POCINumber; exp:sword; result:POCINumber):sword;cdecl;
  743. {$ENDIF}
  744. {
  745. NAME: OCINumberIntPower - OCINumber takes an arbitary base to an arbitary
  746. integer PoWeR
  747. PARAMETERS:
  748. err (IN/OUT) - error handle. If there is an error, it is
  749. recorded in 'err' and this function returns OCI_ERROR.
  750. The error recorded in 'err' can be retrieved by calling
  751. OCIErrorGet().
  752. base (IN) - base of the exponentiation
  753. exp (IN) - exponent to which the base is to be raised
  754. result (OUT) - output of exponentiation
  755. DESCRIPTION:
  756. Takes an arbitary base to an arbitary integer power.
  757. RETURNS:
  758. OCI_SUCCESS if the function completes successfully.
  759. OCI_INVALID_HANDLE if 'err' is NULL.
  760. OCI_ERROR if
  761. any of the number arguments is null
  762. }
  763. {-------------------------- OCINumberShift --------------------------------- }
  764. {$IFNDEF LinkDynamically}
  765. function OCINumberShift(err:POCIError; number:POCINumber; nDig:sword; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberShift';
  766. {$ELSE}
  767. OCINumberShift : function (err:POCIError; number:POCINumber; nDig:sword; result:POCINumber):sword;cdecl;
  768. {$ENDIF}
  769. {
  770. NAME: OCINumberShift - OCINumber multiplies by a power of 10.
  771. PARAMETERS:
  772. err (IN/OUT) - error handle. If there is an error, it is
  773. recorded in 'err' and this function returns OCI_ERROR.
  774. The error recorded in 'err' can be retrieved by calling
  775. OCIErrorGet().
  776. number (IN) - Oracle Number to be shifted.
  777. nDig (IN) - number of decimal places to shift.
  778. result (OUT) - shift result.
  779. DESCRIPTION:
  780. Multiplies number by 10^NDig and sets product to the result.
  781. RETURNS:
  782. OCI_SUCCESS if the function completes successfully.
  783. OCI_INVALID_HANDLE if 'err' is NULL.
  784. OCI_ERROR if
  785. any of the number arguments is null
  786. }
  787. {----------------------------- OCINumberNeg -------------------------------- }
  788. {$IFNDEF LinkDynamically}
  789. function OCINumberNeg(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberNeg';
  790. {$ELSE}
  791. OCINumberNeg : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  792. {$ENDIF}
  793. {
  794. NAME: OCINumberNeg - OCINumber NEGate number
  795. PARAMETERS:
  796. err (IN/OUT) - error handle. If there is an error, it is
  797. recorded in 'err' and this function returns OCI_ERROR.
  798. The error recorded in 'err' can be retrieved by calling
  799. OCIErrorGet().
  800. number (IN) - number to be negated
  801. result (OUT) - will contain negated value of 'number'
  802. DESCRIPTION:
  803. Negates an Oracle number.
  804. RETURNS:
  805. OCI_SUCCESS if the function completes successfully.
  806. OCI_INVALID_HANDLE if 'err' is NULL.
  807. OCI_ERROR if
  808. any of the number arguments is null
  809. }
  810. {------------------------- OCINumberToText --------------------------------- }
  811. {$IFNDEF LinkDynamically}
  812. function OCINumberToText(err:POCIError; number:POCINumber; fmt:Poratext; fmt_length:ub4; nls_params:Poratext;
  813. nls_p_length:ub4; buf_size:Pub4; buf:Poratext):sword;cdecl;external ocilib name 'OCINumberToText';
  814. {$ELSE}
  815. OCINumberToText : function (err:POCIError; number:POCINumber; fmt:Poratext; fmt_length:ub4; nls_params:Poratext;
  816. nls_p_length:ub4; buf_size:Pub4; buf:Poratext):sword;cdecl;
  817. {$ENDIF}
  818. {
  819. NAME: OCINumberToText - OCINumber convert number TO String
  820. PARAMETERS:
  821. err (IN/OUT) - error handle. If there is an error, it is
  822. recorded in 'err' and this function returns OCI_ERROR.
  823. The error recorded in 'err' can be retrieved by calling
  824. OCIErrorGet().
  825. number (IN) - Oracle number to be converted
  826. fmt (IN) - conversion format
  827. fmt_length (IN) - length of the 'fmt' parameter
  828. nls_params (IN) - nls format specification, if null string
  829. i.e. (oratext *)0, then the default parameters for the
  830. session is used
  831. nls_p_length (IN) - length of the 'nls_params' parameter
  832. buf_size (IN/OUT) - size of the buffer must be passed as input by
  833. the caller, this function will return the length of the
  834. resulting string in bytes via this parameter. The length
  835. does not include the terminating null ('\0').
  836. buf (OUT) - buffer into which the converted string is placed. The
  837. resulting string is null terminated.
  838. DESCRIPTION:
  839. Converts the given number to a character string
  840. according to the specified format. Refer to "TO_NUMBER" conversion
  841. function described in "Oracle SQL Language Reference Manual" for a
  842. description of format and NLS parameters.
  843. The converted number string is stored in the buffer 'buf', up to
  844. a max of '*buf_size' bytes. Length of the resulting string is
  845. returned via 'buf_size'.
  846. RETURNS:
  847. OCI_SUCCESS if the function completes successfully.
  848. OCI_INVALID_HANDLE if 'err' is NULL.
  849. OCI_ERROR if
  850. 'number' or 'buf' is null
  851. buffer too small
  852. invalid format
  853. invalid nls format
  854. number to text translation for the given format causes overflow
  855. }
  856. {-------------------------- OCINumberFromText ------------------------------ }
  857. {$IFNDEF LinkDynamically}
  858. function OCINumberFromText(err:POCIError; str:Poratext; str_length:ub4; fmt:Poratext; fmt_length:ub4;
  859. nls_params:Poratext; nls_p_length:ub4; number:POCINumber):sword;cdecl;external ocilib name 'OCINumberFromText';
  860. {$ELSE}
  861. OCINumberFromText : function (err:POCIError; str:Poratext; str_length:ub4; fmt:Poratext; fmt_length:ub4;
  862. nls_params:Poratext; nls_p_length:ub4; number:POCINumber):sword;cdecl;
  863. {$ENDIF}
  864. {
  865. NAME: OCINumberFromText - OCINumber convert String TO Number
  866. PARAMETERS:
  867. err (IN/OUT) - error handle. If there is an error, it is
  868. recorded in 'err' and this function returns OCI_ERROR.
  869. The error recorded in 'err' can be retrieved by calling
  870. OCIErrorGet().
  871. str (IN) - input string to be converted to Oracle number
  872. str_length (IN) - size of the input string
  873. fmt (IN) - conversion format
  874. fmt_length (IN) - length of the 'fmt' parameter
  875. nls_params (IN) - nls format specification, if null string
  876. i.e. (oratext *)0, then the default parameters for the
  877. session is used
  878. nls_p_length (IN) - length of the 'nls_params' parameter
  879. number (OUT) - given string converted to number
  880. DESCRIPTION:
  881. Converts the given string to a number
  882. according to the specified format. Refer to "TO_NUMBER" conversion
  883. function described in "Oracle SQL Language Reference Manual" for a
  884. description of format and NLS parameters.
  885. RETURNS:
  886. OCI_SUCCESS if the function completes successfully.
  887. OCI_INVALID_HANDLE if 'err' is NULL.
  888. OCI_ERROR if
  889. 'number' or 'str' is null
  890. 'str_length' is 0
  891. invalid format
  892. invalid nls format
  893. invalid input string
  894. }
  895. {-------------------------- OCINumberToInt --------------------------------- }
  896. { Unsigned type -- ubX }
  897. const
  898. OCI_NUMBER_UNSIGNED = 0;
  899. { Signed type -- sbX }
  900. OCI_NUMBER_SIGNED = 2;
  901. {$IFNDEF LinkDynamically}
  902. function OCINumberToInt(err:POCIError; number:POCINumber; rsl_length:uword; rsl_flag:uword; rsl:Pdvoid):sword;cdecl;external ocilib name 'OCINumberToInt';
  903. {$ELSE}
  904. var OCINumberToInt : function (err:POCIError; number:POCINumber; rsl_length:uword; rsl_flag:uword; rsl:Pdvoid):sword;cdecl;
  905. {$ENDIF}
  906. {
  907. NAME: OCINumberToInt - OCINumber convert number TO Integer
  908. PARAMETERS:
  909. err (IN/OUT) - error handle. If there is an error, it is
  910. recorded in 'err' and this function returns OCI_ERROR.
  911. The error recorded in 'err' can be retrieved by calling
  912. OCIErrorGet().
  913. number (IN) - number to be converted
  914. rsl_length (IN) - size of the desired result
  915. rsl_s_flag (IN) - flag denoting the desired sign of the output; valid
  916. values are OCI_NUMBER_UNSIGNED, OCI_NUMBER_SIGNED
  917. rsl (OUT) - pointer to space for the result
  918. DESCRIPTION:
  919. Native type conversion function.
  920. Converts the given Oracle number into an xbx (e.g. ub2, ub4, sb2 etc.)
  921. RETURNS:
  922. OCI_SUCCESS if the function completes successfully.
  923. OCI_INVALID_HANDLE if 'err' is NULL.
  924. OCI_ERROR if
  925. 'number' or 'rsl' is null
  926. integer value of 'number' is too big -- overflow
  927. integer value of 'number' is too small -- underflow
  928. invalid sign flag value ('rsl_s_flag')
  929. }
  930. {--------------------------- OCINumberFromInt ------------------------------ }
  931. {$IFNDEF LinkDynamically}
  932. function OCINumberFromInt(err:POCIError; inum:Pdvoid; inum_length:uword; inum_s_flag:uword; number:POCINumber):sword;cdecl;external ocilib name 'OCINumberFromInt';
  933. {$ELSE}
  934. OCINumberFromInt : function (err:POCIError; inum:Pdvoid; inum_length:uword; inum_s_flag:uword; number:POCINumber):sword;cdecl;
  935. {$ENDIF}
  936. {
  937. NAME: OCINumberFromInt - OCINumber convert Integer TO Number
  938. PARAMETERS:
  939. err (IN/OUT) - error handle. If there is an error, it is
  940. recorded in 'err' and this function returns OCI_ERROR.
  941. The error recorded in 'err' can be retrieved by calling
  942. OCIErrorGet().
  943. inum (IN) - pointer to the integer to be converted
  944. inum_length (IN) - size of the integer
  945. inum_s_flag (IN) - flag that designates the sign of the integer; valid
  946. values are OCI_NUMBER_UNSIGNED, OCI_NUMBER_SIGNED
  947. number (OUT) - given integer converted to Oracle number
  948. DESCRIPTION:
  949. Native type conversion function. Converts any Oracle standard
  950. machine-native integer type (xbx) to an Oracle number.
  951. RETURNS:
  952. OCI_SUCCESS if the function completes successfully.
  953. OCI_INVALID_HANDLE if 'err' is NULL.
  954. OCI_ERROR if
  955. 'number' or 'inum' is null
  956. integer too BIG -- the number is too large to fit into an Oracle
  957. number
  958. invalid sign flag value ('inum_s_flag')
  959. }
  960. {------------------------- OCINumberToReal --------------------------------- }
  961. {$IFNDEF LinkDynamically}
  962. function OCINumberToReal(err:POCIError; number:POCINumber; rsl_length:uword; rsl:Pdvoid):sword;cdecl;external ocilib name 'OCINumberToReal';
  963. {$ELSE}
  964. OCINumberToReal : function (err:POCIError; number:POCINumber; rsl_length:uword; rsl:Pdvoid):sword;cdecl;
  965. {$ENDIF}
  966. {
  967. NAME: OCINumberToReal - OCINumber convert number TO Real
  968. PARAMETERS:
  969. err (IN/OUT) - error handle. If there is an error, it is
  970. recorded in 'err' and this function returns OCI_ERROR.
  971. The error recorded in 'err' can be retrieved by calling
  972. OCIErrorGet().
  973. number (IN) - number to be converted
  974. rsl_length (IN) - is the size of the desired result,
  975. sizeof( float | double | long double)
  976. rsl (OUT) - pointer to space for storing the result
  977. DESCRIPTION:
  978. Native type conversion function. Converts an Oracle number into a
  979. machine-native real type. This function only converts numbers up to
  980. LDBL_DIG, DBL_DIG, or FLT_DIG digits of precision and removes
  981. trailing zeroes. The above constants are defined in float.h
  982. RETURNS:
  983. OCI_SUCCESS if the function completes successfully.
  984. OCI_INVALID_HANDLE if 'err' is NULL.
  985. OCI_ERROR if
  986. 'number' or 'rsl' is null
  987. 'rsl_length' is 0
  988. }
  989. {------------------------- OCINumberToRealArray ---------------------------- }
  990. {$IFNDEF LinkDynamically}
  991. function OCINumberToRealArray(err:POCIError; var number:POCINumber; elems:uword; rsl_length:uword; rsl:Pdvoid):sword;cdecl;external ocilib name 'OCINumberToRealArray';
  992. {$ELSE}
  993. OCINumberToRealArray : function (err:POCIError; var number:POCINumber; elems:uword; rsl_length:uword; rsl:Pdvoid):sword;cdecl;
  994. {$ENDIF}
  995. {
  996. NAME: OCINumberToRealArray - OCINumber convert array of numbers TO Real
  997. PARAMETERS:
  998. err (IN/OUT) - error handle. If there is an error, it is
  999. recorded in 'err' and this function returns OCI_ERROR.
  1000. The error recorded in 'err' can be retrieved by calling
  1001. OCIErrorGet().
  1002. number (IN) - Pointer to array of number to be converted
  1003. elems (IN) - Upper bound of number array
  1004. rsl_length (IN) - is the size of the desired result,
  1005. sizeof( float | double | long double)
  1006. rsl (OUT) - pointer to array of space for storing the result
  1007. DESCRIPTION:
  1008. Native type conversion function. Converts an Oracle number into a
  1009. machine-native real type. This function only converts numbers up to
  1010. LDBL_DIG, DBL_DIG, or FLT_DIG digits of precision and removes
  1011. trailing zeroes. The above constants are defined in float.h
  1012. RETURNS:
  1013. OCI_SUCCESS if the function completes successfully.
  1014. OCI_INVALID_HANDLE if 'err' is NULL.
  1015. OCI_ERROR if
  1016. 'number' or 'rsl' is null
  1017. 'rsl_length' is 0
  1018. }
  1019. {-------------------------- OCINumberFromReal ------------------------------ }
  1020. {$IFNDEF LinkDynamically}
  1021. function OCINumberFromReal(err:POCIError; rnum:Pdvoid; rnum_length:uword; number:POCINumber):sword;cdecl;external ocilib name 'OCINumberFromReal';
  1022. {$ELSE}
  1023. OCINumberFromReal : function (err:POCIError; rnum:Pdvoid; rnum_length:uword; number:POCINumber):sword;cdecl;
  1024. {$ENDIF}
  1025. {
  1026. NAME: OCINumberFromReal - OCINumber convert Real TO Number
  1027. PARAMETERS:
  1028. err (IN/OUT) - error handle. If there is an error, it is
  1029. recorded in 'err' and this function returns OCI_ERROR.
  1030. The error recorded in 'err' can be retrieved by calling
  1031. OCIErrorGet().
  1032. rnum (IN) - pointer to the floating point number to be converted
  1033. rnum_length (IN) - size of the desired result, i.e.
  1034. sizeof(float | double | long double)
  1035. number (OUT) - given float converted to Oracle number
  1036. DESCRIPTION:
  1037. Native type conversion function. Converts a machine-native floating
  1038. point type to an Oracle number.
  1039. RETURNS:
  1040. OCI_SUCCESS if the function completes successfully.
  1041. OCI_INVALID_HANDLE if 'err' is NULL.
  1042. OCI_ERROR if
  1043. 'number' or 'rnum' is null
  1044. 'rnum_length' is 0
  1045. }
  1046. {----------------------------- OCINumberCmp -------------------------------- }
  1047. {$IFNDEF LinkDynamically}
  1048. function OCINumberCmp(err:POCIError; number1:POCINumber; number2:POCINumber; result:Psword):sword;cdecl;external ocilib name 'OCINumberCmp';
  1049. {$ELSE}
  1050. OCINumberCmp : function (err:POCIError; number1:POCINumber; number2:POCINumber; result:Psword):sword;cdecl;
  1051. {$ENDIF}
  1052. {
  1053. NAME: OCINumberCmp - OCINumber CoMPare numbers
  1054. PARAMETERS:
  1055. err (IN/OUT) - error handle. If there is an error, it is
  1056. recorded in 'err' and this function returns OCI_ERROR.
  1057. The error recorded in 'err' can be retrieved by calling
  1058. OCIErrorGet().
  1059. number1, number2 (IN) - numbers to be compared
  1060. result (OUT) - 0 if equal, negative if number1 < number2,
  1061. positive if number1 > number2
  1062. DESCRIPTION:
  1063. The function OCINumberCmp compares two numbers.
  1064. RETURNS:
  1065. OCI_SUCCESS if the function completes successfully.
  1066. OCI_INVALID_HANDLE if 'err' is NULL.
  1067. OCI_ERROR if
  1068. 'number1' or 'number2' or 'result' is null
  1069. }
  1070. {---------------------------- OCINumberSign -------------------------------- }
  1071. {$IFNDEF LinkDynamically}
  1072. function OCINumberSign(err:POCIError; number:POCINumber; result:Psword):sword;cdecl;external ocilib name 'OCINumberSign';
  1073. {$ELSE}
  1074. OCINumberSign : function (err:POCIError; number:POCINumber; result:Psword):sword;cdecl;
  1075. {$ENDIF}
  1076. {
  1077. NAME: OCINumberSign - OCINumber obtains SiGN of an Oracle number
  1078. PARAMETERS:
  1079. err (IN/OUT) - error handle. If there is an error, it is
  1080. recorded in 'err' and this function returns OCI_ERROR.
  1081. The error recorded in 'err' can be retrieved by calling
  1082. OCIErrorGet().
  1083. number (IN) - number whose sign is returned
  1084. result (OUT) - 0 if number == 0, -1 if number < 0,
  1085. 1 if number > 0
  1086. DESCRIPTION:
  1087. Obtains sign of an Oracle number
  1088. RETURNS:
  1089. OCI_SUCCESS if the function completes successfully.
  1090. OCI_INVALID_HANDLE if 'err' is NULL.
  1091. OCI_ERROR if
  1092. 'number' or 'result' is null
  1093. }
  1094. {---------------------------- OCINumberIsZero ------------------------------ }
  1095. {$IFNDEF LinkDynamically}
  1096. function OCINumberIsZero(err:POCIError; number:POCINumber; result:Pboolean):sword;cdecl;external ocilib name 'OCINumberIsZero';
  1097. {$ELSE}
  1098. OCINumberIsZero : function (err:POCIError; number:POCINumber; result:Pboolean):sword;cdecl;
  1099. {$ENDIF}
  1100. {
  1101. NAME: OCINumberIsZero - OCINumber comparison with ZERo
  1102. PARAMETERS:
  1103. err (IN/OUT) - error handle. If there is an error, it is
  1104. recorded in 'err' and this function returns OCI_ERROR.
  1105. The error recorded in 'err' can be retrieved by calling
  1106. OCIErrorGet().
  1107. number (IN) - numbers to be compared
  1108. result (OUT) - set to TRUE if equal to zero else FALSE
  1109. DESCRIPTION:
  1110. Test if the given number is equal to zero.
  1111. RETURNS:
  1112. OCI_SUCCESS if the function completes successfully.
  1113. OCI_INVALID_HANDLE if 'err' is NULL.
  1114. OCI_ERROR if
  1115. 'number' or 'result' is null
  1116. }
  1117. {---------------------------- OCINumberIsInt ------------------------------- }
  1118. {$IFNDEF LinkDynamically}
  1119. function OCINumberIsInt(err:POCIError; number:POCINumber; result:Pboolean):sword;cdecl;external ocilib name 'OCINumberIsInt';
  1120. {$ELSE}
  1121. OCINumberIsInt : function (err:POCIError; number:POCINumber; result:Pboolean):sword;cdecl;
  1122. {$ENDIF}
  1123. {
  1124. NAME: OCINumberIsInt - OCINumber Is Integer value.
  1125. PARAMETERS:
  1126. err (IN/OUT) - error handle. If there is an error, it is
  1127. recorded in 'err' and this function returns OCI_ERROR.
  1128. The error recorded in 'err' can be retrieved by calling
  1129. OCIErrorGet().
  1130. number (IN) - number to be tested
  1131. result (OUT) - set to TRUE if integer value else FALSE
  1132. DESCRIPTION:
  1133. Test if the given number is an integer value.
  1134. RETURNS:
  1135. OCI_SUCCESS if the function completes successfully.
  1136. OCI_INVALID_HANDLE if 'err' is NULL.
  1137. OCI_ERROR if
  1138. 'number' or 'result' is null
  1139. }
  1140. {-------------------------- OCINumberAssign -------------------------------- }
  1141. {$IFNDEF LinkDynamically}
  1142. function OCINumberAssign(err:POCIError; from:POCINumber; cto:POCINumber):sword;cdecl;external ocilib name 'OCINumberAssign';
  1143. {$ELSE}
  1144. OCINumberAssign : function (err:POCIError; from:POCINumber; cto:POCINumber):sword;cdecl;
  1145. {$ENDIF}
  1146. {
  1147. NAME: OCINumberAssign - OCINumber ASsiGn number
  1148. PARAMETERS:
  1149. err (IN/OUT) - error handle. If there is an error, it is
  1150. recorded in 'err' and this function returns OCI_ERROR.
  1151. The error recorded in 'err' can be retrieved by calling
  1152. OCIErrorGet().
  1153. from (IN) - number to be assigned
  1154. to (OUT) - number copied into
  1155. DESCRIPTION:
  1156. Assign number 'from' to 'to'.
  1157. RETURNS:
  1158. OCI_SUCCESS if the function completes successfully.
  1159. OCI_INVALID_HANDLE if 'err' is NULL.
  1160. OCI_ERROR if
  1161. 'from' or 'to' is null
  1162. }
  1163. {----------------------------- OCINumberAbs -------------------------------- }
  1164. {$IFNDEF LinkDynamically}
  1165. function OCINumberAbs(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberAbs';
  1166. {$ELSE}
  1167. OCINumberAbs : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1168. {$ENDIF}
  1169. {
  1170. NAME: OCINumberAbs - OCINumber compute ABSolute value
  1171. PARAMETERS:
  1172. err (IN/OUT) - error handle. If there is an error, it is
  1173. recorded in 'err' and this function returns OCI_ERROR.
  1174. The error recorded in 'err' can be retrieved by calling
  1175. OCIErrorGet().
  1176. number (IN) - input number
  1177. result (OUT) - output which will contain the absolue value of the
  1178. input number
  1179. DESCRIPTION:
  1180. Computes the absolute value of an Oracle number.
  1181. RETURNS:
  1182. OCI_SUCCESS if the function completes successfully.
  1183. OCI_INVALID_HANDLE if 'err' is NULL.
  1184. OCI_ERROR if
  1185. any of the number arguments is null
  1186. }
  1187. {---------------------------- OCINumberCeil -------------------------------- }
  1188. {$IFNDEF LinkDynamically}
  1189. function OCINumberCeil(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberCeil';
  1190. {$ELSE}
  1191. OCINumberCeil : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1192. {$ENDIF}
  1193. {
  1194. NAME: OCINumberCeil - OCINumber compute the CEiL value of an Oracle number
  1195. PARAMETERS:
  1196. err (IN/OUT) - error handle. If there is an error, it is
  1197. recorded in 'err' and this function returns OCI_ERROR.
  1198. The error recorded in 'err' can be retrieved by calling
  1199. OCIErrorGet().
  1200. number (IN) - input number
  1201. result (OUT) - output which will contain the ceil value of the
  1202. input number
  1203. DESCRIPTION:
  1204. Computes the ceil value of an Oracle number.
  1205. RETURNS:
  1206. OCI_SUCCESS if the function completes successfully.
  1207. OCI_INVALID_HANDLE if 'err' is NULL.
  1208. OCI_ERROR if
  1209. any of the number arguments is null
  1210. }
  1211. {--------------------------- OCINumberFloor -------------------------------- }
  1212. {$IFNDEF LinkDynamically}
  1213. function OCINumberFloor(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberFloor';
  1214. {$ELSE}
  1215. OCINumberFloor : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1216. {$ENDIF}
  1217. {
  1218. NAME: OCINumberFloor - OCINumber compute the FLooR value of an Oracle number
  1219. PARAMETERS:
  1220. err (IN/OUT) - error handle. If there is an error, it is
  1221. recorded in 'err' and this function returns OCI_ERROR.
  1222. The error recorded in 'err' can be retrieved by calling
  1223. OCIErrorGet().
  1224. number (IN) - input number
  1225. result (OUT) - output which will contain the floor value of the
  1226. input number
  1227. DESCRIPTION:
  1228. Computes the floor value of an Oracle number.
  1229. RETURNS:
  1230. OCI_SUCCESS if the function completes successfully.
  1231. OCI_INVALID_HANDLE if 'err' is NULL.
  1232. OCI_ERROR if
  1233. any of the number arguments is null
  1234. }
  1235. {----------------------------- OCINumberSqrt ------------------------------- }
  1236. {$IFNDEF LinkDynamically}
  1237. function OCINumberSqrt(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberSqrt';
  1238. {$ELSE}
  1239. OCINumberSqrt : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1240. {$ENDIF}
  1241. {
  1242. NAME: OCINumberSqrt - OCINumber compute the SQuare Root of an Oracle number
  1243. PARAMETERS:
  1244. err (IN/OUT) - error handle. If there is an error, it is
  1245. recorded in 'err' and this function returns OCI_ERROR.
  1246. The error recorded in 'err' can be retrieved by calling
  1247. OCIErrorGet().
  1248. number (IN) - input number
  1249. result (OUT) - output which will contain the square root of the
  1250. input number
  1251. DESCRIPTION:
  1252. Computes the square root of an Oracle number.
  1253. RETURNS:
  1254. OCI_SUCCESS if the function completes successfully.
  1255. OCI_INVALID_HANDLE if 'err' is NULL.
  1256. OCI_ERROR if
  1257. any of the number arguments is null
  1258. 'number' is negative
  1259. }
  1260. {--------------------------- OCINumberTrunc -------------------------------- }
  1261. {$IFNDEF LinkDynamically}
  1262. function OCINumberTrunc(err:POCIError; number:POCINumber; decplace:sword; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberTrunc';
  1263. {$ELSE}
  1264. OCINumberTrunc : function (err:POCIError; number:POCINumber; decplace:sword; result:POCINumber):sword;cdecl;
  1265. {$ENDIF}
  1266. {
  1267. NAME: OCINumberTrunc - OCINumber TRUncate an Oracle number at a
  1268. specified decimal place
  1269. PARAMETERS:
  1270. err (IN/OUT) - error handle. If there is an error, it is
  1271. recorded in 'err' and this function returns OCI_ERROR.
  1272. The error recorded in 'err' can be retrieved by calling
  1273. OCIErrorGet().
  1274. number (IN) - input number
  1275. decplace (IN) - number of decimal digits to the right of the
  1276. decimal point to truncate at. Negative values are allowed.
  1277. result (OUT) - output of truncation
  1278. DESCRIPTION:
  1279. Truncate an Oracle number at a specified decimal place
  1280. RETURNS:
  1281. OCI_SUCCESS if the function completes successfully.
  1282. OCI_INVALID_HANDLE if 'err' is NULL.
  1283. OCI_ERROR if
  1284. any of the number arguments is null
  1285. }
  1286. {----------------------------- OCINumberPower ------------------------------ }
  1287. {$IFNDEF LinkDynamically}
  1288. function OCINumberPower(err:POCIError; base:POCINumber; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberPower';
  1289. {$ELSE}
  1290. OCINumberPower : function (err:POCIError; base:POCINumber; number:POCINumber; result:POCINumber):sword;cdecl;
  1291. {$ENDIF}
  1292. {
  1293. NAME: OCINumberPower - OCINumber takes an arbitary Base to an
  1294. arbitary Power
  1295. PARAMETERS:
  1296. err (IN/OUT) - error handle. If there is an error, it is
  1297. recorded in 'err' and this function returns OCI_ERROR.
  1298. The error recorded in 'err' can be retrieved by calling
  1299. OCIErrorGet().
  1300. base (IN) - base of the exponentiation
  1301. number (IN) - exponent to which the base is to be raised
  1302. result (OUT) - output of exponentiation
  1303. DESCRIPTION:
  1304. Takes an arbitary base to an arbitary power.
  1305. RETURNS:
  1306. OCI_SUCCESS if the function completes successfully.
  1307. OCI_INVALID_HANDLE if 'err' is NULL.
  1308. OCI_ERROR if
  1309. any of the number arguments is null
  1310. }
  1311. {--------------------------- OCINumberRound -------------------------------- }
  1312. {$IFNDEF LinkDynamically}
  1313. function OCINumberRound(err:POCIError; number:POCINumber; decplace:sword; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberRound';
  1314. {$ELSE}
  1315. OCINumberRound : function (err:POCIError; number:POCINumber; decplace:sword; result:POCINumber):sword;cdecl;
  1316. {$ENDIF}
  1317. {
  1318. NAME: OCINumberRound - OCINumber ROUnds an Oracle number to a specified
  1319. decimal place
  1320. PARAMETERS:
  1321. err (IN/OUT) - error handle. If there is an error, it is
  1322. recorded in 'err' and this function returns OCI_ERROR.
  1323. The error recorded in 'err' can be retrieved by calling
  1324. OCIErrorGet().
  1325. number (IN) - round this number and return result in 'result'
  1326. decplace (IN) - number of decimal digits to the right of the
  1327. decimal point to round to. Negative values are allowed.
  1328. result (OUT) - output of rounding
  1329. DESCRIPTION:
  1330. Rounds an Oracle number to a specified decimal place
  1331. RETURNS:
  1332. OCI_SUCCESS if the function completes successfully.
  1333. OCI_INVALID_HANDLE if 'err' is NULL.
  1334. OCI_ERROR if
  1335. any of the number arguments is null
  1336. }
  1337. {--------------------------- OCINumberPrec --------------------------------- }
  1338. {$IFNDEF LinkDynamically}
  1339. function OCINumberPrec(err:POCIError; number:POCINumber; nDigs:eword; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberPrec';
  1340. {$ELSE}
  1341. OCINumberPrec : function (err:POCIError; number:POCINumber; nDigs:eword; result:POCINumber):sword;cdecl;
  1342. {$ENDIF}
  1343. {
  1344. NAME: OCINumberPrec - Rounds an Oracle number to a specified number of
  1345. decimal digits.
  1346. PARAMETERS:
  1347. err (IN/OUT) - error handle. If there is an error, it is
  1348. recorded in 'err' and this function returns OCI_ERROR.
  1349. The error recorded in 'err' can be retrieved by calling
  1350. OCIErrorGet().
  1351. number (IN) - number for which to set precision.
  1352. nDig (IN) - number of decimal digits desired in the result.
  1353. result (OUT) - result.
  1354. DESCRIPTION:
  1355. Performs a floating point round with respect to the number
  1356. of digits.
  1357. RETURNS:
  1358. OCI_SUCCESS if the function completes successfully.
  1359. OCI_INVALID_HANDLE if 'err' is NULL.
  1360. OCI_ERROR if
  1361. any of the number arguments is null
  1362. }
  1363. {----------------------------- OCINumberSin -------------------------------- }
  1364. {$IFNDEF LinkDynamically}
  1365. function OCINumberSin(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberSin';
  1366. {$ELSE}
  1367. OCINumberSin : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1368. {$ENDIF}
  1369. {
  1370. NAME: OCINumberSin - OCINumber takes the SINe of an Oracle number
  1371. PARAMETERS:
  1372. err (IN/OUT) - error handle. If there is an error, it is
  1373. recorded in 'err' and this function returns OCI_ERROR.
  1374. The error recorded in 'err' can be retrieved by calling
  1375. OCIErrorGet().
  1376. number (IN) - argument of the sine in radians
  1377. result (OUT) - result of the sine
  1378. DESCRIPTION:
  1379. Takes the sine in radians of an Oracle number.
  1380. RETURNS:
  1381. OCI_SUCCESS if the function completes successfully.
  1382. OCI_INVALID_HANDLE if 'err' is NULL.
  1383. OCI_ERROR if
  1384. any of the number arguments is null
  1385. }
  1386. {-------------------------- OCINumberArcSin -------------------------------- }
  1387. {$IFNDEF LinkDynamically}
  1388. function OCINumberArcSin(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberArcSin';
  1389. {$ELSE}
  1390. OCINumberArcSin : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1391. {$ENDIF}
  1392. {
  1393. NAME: OCINumberArcSin - OCINumber takes the Arc SINe of an Oracle number
  1394. PARAMETERS:
  1395. err (IN/OUT) - error handle. If there is an error, it is
  1396. recorded in 'err' and this function returns OCI_ERROR.
  1397. The error recorded in 'err' can be retrieved by calling
  1398. OCIErrorGet().
  1399. number (IN) - argument of the arc sine
  1400. result (OUT) - result of the arc sine in radians
  1401. DESCRIPTION:
  1402. Takes the arc sine in radians of an Oracle number.
  1403. RETURNS:
  1404. OCI_SUCCESS if the function completes successfully.
  1405. OCI_INVALID_HANDLE if 'err' is NULL.
  1406. OCI_ERROR if
  1407. any of the number arguments is null
  1408. 'number' is < -1 or 'number' is > 1.
  1409. }
  1410. {-------------------------- OCINumberHypSin -------------------------------- }
  1411. {$IFNDEF LinkDynamically}
  1412. function OCINumberHypSin(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberHypSin';
  1413. {$ELSE}
  1414. OCINumberHypSin : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1415. {$ENDIF}
  1416. {
  1417. NAME: OCINumberHypSin - OCINumber takes the SiNe Hyperbolic of an
  1418. Oracle number
  1419. PARAMETERS:
  1420. err (IN/OUT) - error handle. If there is an error, it is
  1421. recorded in 'err' and this function returns OCI_ERROR.
  1422. The error recorded in 'err' can be retrieved by calling
  1423. OCIErrorGet().
  1424. number (IN) - argument of the sine hyperbolic
  1425. result (OUT) - result of the sine hyperbolic
  1426. DESCRIPTION:
  1427. Takes the hyperbolic sine of an Oracle number.
  1428. RETURNS:
  1429. OCI_SUCCESS if the function completes successfully.
  1430. OCI_INVALID_HANDLE if 'err' is NULL.
  1431. OCI_ERROR if
  1432. any of the number arguments is null
  1433. NOTES:
  1434. An Oracle number overflow causes an unpredictable result value.
  1435. }
  1436. {----------------------------- OCINumberCos -------------------------------- }
  1437. {$IFNDEF LinkDynamically}
  1438. function OCINumberCos(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberCos';
  1439. {$ELSE}
  1440. OCINumberCos : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1441. {$ENDIF}
  1442. {
  1443. NAME: OCINumberCos - OCINumber takes the COSine of an Oracle number
  1444. PARAMETERS:
  1445. err (IN/OUT) - error handle. If there is an error, it is
  1446. recorded in 'err' and this function returns OCI_ERROR.
  1447. The error recorded in 'err' can be retrieved by calling
  1448. OCIErrorGet().
  1449. number (IN) - argument of the cosine in radians
  1450. result (OUT) - result of the cosine
  1451. DESCRIPTION:
  1452. Takes the cosine in radians of an Oracle number.
  1453. RETURNS:
  1454. OCI_SUCCESS if the function completes successfully.
  1455. OCI_INVALID_HANDLE if 'err' is NULL.
  1456. OCI_ERROR if
  1457. any of the number arguments is null
  1458. }
  1459. {-------------------------- OCINumberArcCos -------------------------------- }
  1460. {$IFNDEF LinkDynamically}
  1461. function OCINumberArcCos(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberArcCos';
  1462. {$ELSE}
  1463. OCINumberArcCos : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1464. {$ENDIF}
  1465. {
  1466. NAME: OCINumberArcCos - OCINumber takes the Arc COSine of an Oracle number
  1467. PARAMETERS:
  1468. err (IN/OUT) - error handle. If there is an error, it is
  1469. recorded in 'err' and this function returns OCI_ERROR.
  1470. The error recorded in 'err' can be retrieved by calling
  1471. OCIErrorGet().
  1472. number (IN) - argument of the arc cosine
  1473. result (OUT) - result of the arc cosine in radians
  1474. DESCRIPTION:
  1475. Takes the arc cosine in radians of an Oracle number.
  1476. RETURNS:
  1477. OCI_SUCCESS if the function completes successfully.
  1478. OCI_INVALID_HANDLE if 'err' is NULL.
  1479. OCI_ERROR if
  1480. any of the number arguments is null
  1481. 'number' is < -1 or 'number' is > 1.
  1482. }
  1483. {-------------------------- OCINumberHypCos -------------------------------- }
  1484. {$IFNDEF LinkDynamically}
  1485. function OCINumberHypCos(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberHypCos';
  1486. {$ELSE}
  1487. OCINumberHypCos : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1488. {$ENDIF}
  1489. {
  1490. NAME: OCINumberHypCos - OCINumber takes the CoSine Hyperbolic of an
  1491. Oracle number
  1492. PARAMETERS:
  1493. err (IN/OUT) - error handle. If there is an error, it is
  1494. recorded in 'err' and this function returns OCI_ERROR.
  1495. The error recorded in 'err' can be retrieved by calling
  1496. OCIErrorGet().
  1497. number (IN) - argument of the cosine hyperbolic
  1498. result (OUT) - result of the cosine hyperbolic
  1499. DESCRIPTION:
  1500. Takes the hyperbolic cosine of an Oracle number.
  1501. RETURNS:
  1502. OCI_SUCCESS if the function completes successfully.
  1503. OCI_INVALID_HANDLE if 'err' is NULL.
  1504. OCI_ERROR if
  1505. any of the number arguments is null
  1506. NOTES:
  1507. An Oracle number overflow causes an unpredictable result value.
  1508. }
  1509. {----------------------------- OCINumberTan -------------------------------- }
  1510. {$IFNDEF LinkDynamically}
  1511. function OCINumberTan(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberTan';
  1512. {$ELSE}
  1513. OCINumberTan : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1514. {$ENDIF}
  1515. {
  1516. NAME: OCINumberTan - OCINumber takes the TANgent of an Oracle number
  1517. PARAMETERS:
  1518. err (IN/OUT) - error handle. If there is an error, it is
  1519. recorded in 'err' and this function returns OCI_ERROR.
  1520. The error recorded in 'err' can be retrieved by calling
  1521. OCIErrorGet().
  1522. number (IN) - argument of the tangent in radians
  1523. result (OUT) - result of the tangent
  1524. DESCRIPTION:
  1525. Takes the tangent in radians of an Oracle number.
  1526. RETURNS:
  1527. OCI_SUCCESS if the function completes successfully.
  1528. OCI_INVALID_HANDLE if 'err' is NULL.
  1529. OCI_ERROR if
  1530. any of the number arguments is null
  1531. }
  1532. {-------------------------- OCINumberArcTan -------------------------------- }
  1533. {$IFNDEF LinkDynamically}
  1534. function OCINumberArcTan(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberArcTan';
  1535. {$ELSE}
  1536. OCINumberArcTan : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1537. {$ENDIF}
  1538. {
  1539. NAME: OCINumberArcTan - OCINumber takes the Arc TANgent of an Oracle number
  1540. PARAMETERS:
  1541. err (IN/OUT) - error handle. If there is an error, it is
  1542. recorded in 'err' and this function returns OCI_ERROR.
  1543. The error recorded in 'err' can be retrieved by calling
  1544. OCIErrorGet().
  1545. number (IN) - argument of the arc tangent
  1546. result (OUT) - result of the arc tangent in radians
  1547. DESCRIPTION:
  1548. Takes the arc tangent in radians of an Oracle number.
  1549. RETURNS:
  1550. OCI_SUCCESS if the function completes successfully.
  1551. OCI_INVALID_HANDLE if 'err' is NULL.
  1552. OCI_ERROR if
  1553. any of the number arguments is null
  1554. }
  1555. {------------------------ OCINumberArcTan2 --------------------------------- }
  1556. {$IFNDEF LinkDynamically}
  1557. function OCINumberArcTan2(err:POCIError; number1:POCINumber; number2:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberArcTan2';
  1558. {$ELSE}
  1559. OCINumberArcTan2 : function (err:POCIError; number1:POCINumber; number2:POCINumber; result:POCINumber):sword;cdecl;
  1560. {$ENDIF}
  1561. {
  1562. NAME: OCINumberArcTan2 - OCINumber takes the ATan2 of 2 Oracle numbers
  1563. PARAMETERS:
  1564. err (IN/OUT) - error handle. If there is an error, it is
  1565. recorded in 'err' and this function returns OCI_ERROR.
  1566. The error recorded in 'err' can be retrieved by calling
  1567. OCIErrorGet().
  1568. number1 (IN) - first argument of atan2(y,x) function which
  1569. corresponds to 'y' parameter in the function
  1570. number2 (IN) - second argument of atan2(y,x) function which
  1571. corresponds to 'x' parameter in the function
  1572. result (OUT) - result of the atan2() in radians
  1573. DESCRIPTION:
  1574. Takes the atan2(number1, number2).
  1575. RETURNS:
  1576. OCI_SUCCESS if the function completes successfully.
  1577. OCI_INVALID_HANDLE if 'err' is NULL.
  1578. OCI_ERROR if
  1579. any of the number arguments is null
  1580. 'number2' is 0
  1581. }
  1582. {----------------------------- OCINumberHypTan ----------------------------- }
  1583. {$IFNDEF LinkDynamically}
  1584. function OCINumberHypTan(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberHypTan';
  1585. {$ELSE}
  1586. OCINumberHypTan : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1587. {$ENDIF}
  1588. {
  1589. NAME: OCINumberHypTan - OCINumber takes the TaNgent Hyperbolic of an Oracle
  1590. number
  1591. PARAMETERS:
  1592. err (IN/OUT) - error handle. If there is an error, it is
  1593. recorded in 'err' and this function returns OCI_ERROR.
  1594. The error recorded in 'err' can be retrieved by calling
  1595. OCIErrorGet().
  1596. number (IN) - argument of the tangent hyperbolic
  1597. result (OUT) - result of the tangent hyperbolic
  1598. DESCRIPTION:
  1599. Takes the hyperbolic tangent of an Oracle number.
  1600. RETURNS:
  1601. OCI_SUCCESS if the function completes successfully.
  1602. OCI_INVALID_HANDLE if 'err' is NULL.
  1603. OCI_ERROR if
  1604. any of the number arguments is null
  1605. NOTES:
  1606. An Oracle number overflow causes an unpredictable result value.
  1607. }
  1608. {--------------------------- OCINumberExp ---------------------------------- }
  1609. {$IFNDEF LinkDynamically}
  1610. function OCINumberExp(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberExp';
  1611. {$ELSE}
  1612. OCINumberExp : function (err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1613. {$ENDIF}
  1614. {
  1615. NAME: OCINumberExp - OCINumber EXPonential
  1616. PARAMETERS:
  1617. err (IN/OUT) - error handle. If there is an error, it is
  1618. recorded in 'err' and this function returns OCI_ERROR.
  1619. The error recorded in 'err' can be retrieved by calling
  1620. OCIErrorGet().
  1621. number (IN) - e raised to this Oracle number power
  1622. result (OUT) - output of exponentiation
  1623. DESCRIPTION:
  1624. Raises e to the specified Oracle number power
  1625. RETURNS:
  1626. OCI_SUCCESS if the function completes successfully.
  1627. OCI_INVALID_HANDLE if 'err' is NULL.
  1628. OCI_ERROR if
  1629. any of the number arguments is null
  1630. }
  1631. {----------------------------- OCINumberLn --------------------------------- }
  1632. {$IFNDEF LinkDynamically}
  1633. function OCINumberLn(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberLn';
  1634. {$ELSE}
  1635. OCINumberLn : function(err:POCIError; number:POCINumber; result:POCINumber):sword;cdecl;
  1636. {$ENDIF}
  1637. {
  1638. NAME: OCINumberLn - OCINumber Logarithm Natural
  1639. PARAMETERS:
  1640. err (IN/OUT) - error handle. If there is an error, it is
  1641. recorded in 'err' and this function returns OCI_ERROR.
  1642. The error recorded in 'err' can be retrieved by calling
  1643. OCIErrorGet().
  1644. number (IN) - logarithm of this number is computed
  1645. result (OUT) - logarithm result
  1646. DESCRIPTION:
  1647. Takes the logarithm of the given Oracle number with respect
  1648. to the given base.
  1649. RETURNS:
  1650. OCI_SUCCESS if the function completes successfully.
  1651. OCI_INVALID_HANDLE if 'err' is NULL.
  1652. OCI_ERROR if
  1653. any of the number arguments is null
  1654. 'number' is <= 0
  1655. }
  1656. {----------------------------- OCINumberLog -------------------------------- }
  1657. {$IFNDEF LinkDynamically}
  1658. function OCINumberLog(err:POCIError; base:POCINumber; number:POCINumber; result:POCINumber):sword;cdecl;external ocilib name 'OCINumberLog';
  1659. {$ELSE}
  1660. OCINumberLog : function (err:POCIError; base:POCINumber; number:POCINumber; result:POCINumber):sword;cdecl;
  1661. {$ENDIF}
  1662. {
  1663. NAME: OCINumberLog - OCINumber LOGarithm any base
  1664. PARAMETERS:
  1665. err (IN/OUT) - error handle. If there is an error, it is
  1666. recorded in 'err' and this function returns OCI_ERROR.
  1667. The error recorded in 'err' can be retrieved by calling
  1668. OCIErrorGet().
  1669. base (IN) - base of the logarithm
  1670. number (IN) - opearnd
  1671. result (OUT) - logarithm result
  1672. DESCRIPTION:
  1673. Takes the logarithm with the specified base of an Oracle number.
  1674. RETURNS:
  1675. OCI_SUCCESS if the function completes successfully.
  1676. OCI_INVALID_HANDLE if 'err' is NULL.
  1677. OCI_ERROR if
  1678. any of the number arguments is null
  1679. 'number' is <= 0
  1680. 'base' is <= 0
  1681. }
  1682. {*************************************************************************** }
  1683. { ORACLE DATE TYPE }
  1684. {*************************************************************************** }
  1685. { hours; range is 0 <= hours <=23 }
  1686. { minutes; range is 0 <= minutes <= 59 }
  1687. { seconds; range is 0 <= seconds <= 59 }
  1688. type
  1689. POCITime = ^OCITime;
  1690. OCITime = record
  1691. OCITimeHH : ub1;
  1692. OCITimeMI : ub1;
  1693. OCITimeSS : ub1;
  1694. end;
  1695. {
  1696. * OCITime - OCI TiMe portion of date
  1697. *
  1698. * This structure should be treated as an opaque structure as the format
  1699. * of this structure may change. Use OCIDateGetTime/OCIDateSetTime
  1700. * to manipulate time portion of OCIDate.
  1701. }
  1702. { gregorian year; range is -4712 <= year <= 9999 }
  1703. { month; range is 1 <= month < 12 }
  1704. { day; range is 1 <= day <= 31 }
  1705. { time }
  1706. POCIDate = ^OCIDate;
  1707. OCIDate = record
  1708. OCIDateYYYY : sb2;
  1709. OCIDateMM : ub1;
  1710. OCIDateDD : ub1;
  1711. OCIDateTime : OCITime;
  1712. end;
  1713. {
  1714. * OCIDate - OCI oracle Date representation in C
  1715. *
  1716. * OCIDate represents the C mapping of Oracle date.
  1717. *
  1718. * This structure should be treated as an opaque structure as the format
  1719. * of this structure may change. Use OCIDateGetDate/OCIDateSetDate
  1720. * to access/initialize OCIDate.
  1721. *
  1722. * For binding variables of type OCIDate in OCI calls (OCIBindByName(),
  1723. * OCIBindByPos(), and OCIDefineByPos()) use the type code SQLT_ODT.
  1724. }
  1725. {
  1726. EXAMPLE
  1727. The following example shows how to manipulate an attribute of type
  1728. oracle date.
  1729. #define FMT "Month dd, YYYY, HH:MI A.M."
  1730. #define LANG "American"
  1731. struct person
  1732. OCIDate start_date;
  1733. ;
  1734. typedef struct person person;
  1735. OCIError *err;
  1736. person *joe;
  1737. sword status; /o error status o/
  1738. /o See oci.h for an example of how to initialize OCIError.
  1739. o For this example, assume the OCIEnv and OCIError has been
  1740. o initialized.
  1741. o/
  1742. /o Pin joe person object in the object cache. See ori.h
  1743. o for an example on pinning objects. For this example, assume that
  1744. o joe is pointing to the pinned object.
  1745. o/
  1746. /o set the start date of joe o/
  1747. OCIDateSetTime(&joe->start_date, 8, 0, 0);
  1748. OCIDateSetDate(&joe->start_date, 1990, 10, 5);
  1749. /o check if the date is valid o/
  1750. uword invalid;
  1751. if (OCIDateCheck(err, &joe->start_date, &invalid) != OCI_SUCCESS)
  1752. /o error handling code o/
  1753. if (invalid)
  1754. /o error handling code o/
  1755. /o convert date for display purposes o/
  1756. char str[100];
  1757. ub4 strlen = sizeof(str);
  1758. if (OCIDateToText(err, &joe->start_date, FMT, sizeof(FMT)-1, LANG,
  1759. sizeof(LANG)-1, &strlen, str) != OCI_SUCCESS)
  1760. /o error handling code o/
  1761. }
  1762. {--------------------------- OCIDateGetTime -------------------------------- }
  1763. { void OCIDateGetTime(/o_ CONST OCIDate *date, ub1 *hour, ub1 *min,
  1764. ub1 *sec _o/); }
  1765. (* error
  1766. { \
  1767. in declaration at line 1787 *)
  1768. (* error
  1769. *hour = (date)->OCIDateTime.OCITimeHH; \
  1770. error
  1771. *min = (date)->OCIDateTime.OCITimeMI; \
  1772. in declaration at line 1788
  1773. error
  1774. *min = (date)->OCIDateTime.OCITimeMI; \
  1775. error
  1776. *sec = (date)->OCIDateTime.OCITimeSS; \
  1777. in declaration at line 1789
  1778. error
  1779. *sec = (date)->OCIDateTime.OCITimeSS; \
  1780. error
  1781. } *)
  1782. {
  1783. NAME: OCIDateGetTime - OCIDate Get Time portion of date
  1784. PARAMETERS:
  1785. date (IN) - Oracle date whose time data is retrieved
  1786. hour (OUT) - hour value returned
  1787. min (OUT) - minute value returned
  1788. sec (OUT) - second value returned
  1789. DESCRIPTION:
  1790. Return time inforamtion stored in the given date. The time
  1791. information returned is: hour, minute and seconds.
  1792. RETURNS:
  1793. NONE
  1794. }
  1795. {--------------------------- OCIDateGetDate -------------------------------- }
  1796. { void OCIDateGetDate(/o_ CONST OCIDate *date, sb2 *year, ub1 *month,
  1797. ub1 *day _o/); }
  1798. (*in declaration at line 1810 *)
  1799. (* error
  1800. *year = (date)->OCIDateYYYY; \
  1801. error
  1802. *month = (date)->OCIDateMM; \
  1803. in declaration at line 1811
  1804. error
  1805. *month = (date)->OCIDateMM; \
  1806. error
  1807. *day = (date)->OCIDateDD; \
  1808. in declaration at line 1812 *)
  1809. (* error
  1810. *day = (date)->OCIDateDD; \
  1811. error
  1812. }
  1813. {
  1814. NAME: OCIDateGetDate - OCIDate Get Date (year, month, day) portion of date
  1815. PARAMETERS:
  1816. date (IN) - Oracle date whose year, month, day data is retrieved
  1817. year (OUT) - year value returned
  1818. month (OUT) - month value returned
  1819. day (OUT) - day value returned
  1820. DESCRIPTION:
  1821. Return year, month, day inforamtion stored in the given date.
  1822. RETURNS:
  1823. NONE
  1824. }
  1825. {--------------------------- OCIDateSetTime -------------------------------- }
  1826. { void OCIDateSetTime(/o_ OCIDate *date, ub1 hour, ub1 min,
  1827. ub1 sec _o/); }
  1828. in declaration at line 1832
  1829. error
  1830. (date)->OCIDateTime.OCITimeHH = hour; \
  1831. error
  1832. (date)->OCIDateTime.OCITimeMI = min; \
  1833. in declaration at line 1833
  1834. error
  1835. (date)->OCIDateTime.OCITimeMI = min; \
  1836. error
  1837. (date)->OCIDateTime.OCITimeSS = sec; \
  1838. in declaration at line 1834
  1839. error
  1840. (date)->OCIDateTime.OCITimeSS = sec; \
  1841. error
  1842. }
  1843. {
  1844. NAME: OCIDateSetTime - OCIDate Set Time portion of date
  1845. PARAMETERS:
  1846. date (OUT) - Oracle date whose time data is set
  1847. hour (IN) - hour value to be set
  1848. min (IN) - minute value to be set
  1849. sec (IN) - second value to be set
  1850. DESCRIPTION:
  1851. Set the date with the given time inforamtion.
  1852. RETURNS:
  1853. NONE
  1854. }
  1855. {--------------------------- OCIDateSetDate -------------------------------- }
  1856. { void OCIDateSetDate(/o_ OCIDate *date, sb2 year, ub1 month, ub1 day _o/); }
  1857. in declaration at line 1853 *)
  1858. (* error
  1859. (date)->OCIDateYYYY = year; \
  1860. error
  1861. (date)->OCIDateMM = month; \
  1862. in declaration at line 1854
  1863. error
  1864. (date)->OCIDateMM = month; \
  1865. error
  1866. (date)->OCIDateDD = day; \
  1867. in declaration at line 1855
  1868. error
  1869. (date)->OCIDateDD = day; \
  1870. error
  1871. } *)
  1872. {
  1873. NAME: OCIDateSetDate - OCIDate Set Date (year, month, day) portion of date
  1874. PARAMETERS:
  1875. date (IN) - Oracle date whose year, month, day data is set
  1876. year (OUT) - year value to be set
  1877. month (OUT) - month value to be set
  1878. day (OUT) - day value to be set
  1879. DESCRIPTION:
  1880. Set the date with the given year, month, day inforamtion.
  1881. RETURNS:
  1882. NONE
  1883. }
  1884. {--------------------------- OCIDateAssign --------------------------------- }
  1885. (*in declaration at line 1873 *)
  1886. {
  1887. NAME: OCIDateAssign - OCIDate Assignment
  1888. PARAMETERS:
  1889. err (IN/OUT) - error handle. If there is an error, it is
  1890. recorded in 'err' and this function returns OCI_ERROR.
  1891. The error recorded in 'err' can be retrieved by calling
  1892. OCIErrorGet().
  1893. from (IN) - date to be assigned
  1894. to (OUT) - lhs of assignment
  1895. DESCRIPTION:
  1896. Performs date assignment.
  1897. RETURNS:
  1898. OCI_SUCCESS
  1899. }
  1900. {--------------------------- OCIDateToText --------------------------------- }
  1901. {$IFNDEF LinkDynamically}
  1902. function OCIDateToText(err:POCIError; date:POCIDate; fmt:Poratext; fmt_length:ub1; lang_name:Poratext;
  1903. lang_length:ub4; buf_size:Pub4; buf:Poratext):sword;cdecl;external ocilib name 'OCIDateToText';
  1904. {$ELSE}
  1905. var OCIDateToText : function (err:POCIError; date:POCIDate; fmt:Poratext; fmt_length:ub1; lang_name:Poratext;
  1906. lang_length:ub4; buf_size:Pub4; buf:Poratext):sword;cdecl;
  1907. {$ENDIF}
  1908. {
  1909. NAME: OCIDateToText - OCIDate convert date TO String
  1910. PARAMETERS:
  1911. err (IN/OUT) - error handle. If there is an error, it is
  1912. recorded in 'err' and this function returns OCI_ERROR.
  1913. The error recorded in 'err' can be retrieved by calling
  1914. OCIErrorGet().
  1915. date (IN) - Oracle date to be converted
  1916. fmt (IN) - conversion format, if null string pointer (oratext*)0, then
  1917. the date is converted to a character string in the
  1918. date format "DD-MON-YY".
  1919. fmt_length (IN) - length of the 'fmt' parameter
  1920. lang_name (IN) - specifies the language in which the names and
  1921. abbreviations of months and days are returned;
  1922. default language of session is used if 'lang_name'
  1923. is null i.e. (oratext *)0
  1924. lang_length (IN) - length of the 'nls_params' parameter
  1925. buf_size (IN/OUT) - size of the buffer; size of the resulting string
  1926. is returned via this parameter
  1927. buf (OUT) - buffer into which the converted string is placed
  1928. DESCRIPTION:
  1929. Converts the given date to a string according to the specified format.
  1930. Refer to "TO_DATE" conversion function described in
  1931. "Oracle SQL Language Reference Manual" for a description of format
  1932. and NLS arguments. The converted null-terminated date string is
  1933. stored in the buffer 'buf'.
  1934. An error is reported upon overflow, e.g. trying to convert a number
  1935. of value 10 using format '9' causes an overflow.
  1936. RETURNS:
  1937. OCI_SUCCESS if the function completes successfully.
  1938. OCI_INVALID_HANDLE if 'err' is NULL.
  1939. OCI_ERROR if
  1940. buffer too small
  1941. invalid format
  1942. unknown language
  1943. overflow error
  1944. }
  1945. {---------------------------- OCIDateFromText ------------------------------ }
  1946. {$IFNDEF LinkDynamically}
  1947. function OCIDateFromText(err:POCIError; date_str:Poratext; d_str_length:ub4; fmt:Poratext; fmt_length:ub1;
  1948. lang_name:Poratext; lang_length:ub4; date:POCIDate):sword;cdecl;external ocilib name 'OCIDateFromText';
  1949. {$ELSE}
  1950. OCIDateFromText : function (err:POCIError; date_str:Poratext; d_str_length:ub4; fmt:Poratext; fmt_length:ub1;
  1951. lang_name:Poratext; lang_length:ub4; date:POCIDate):sword;cdecl;
  1952. {$ENDIF}
  1953. {
  1954. NAME: OCIDateFromText - OCIDate convert String TO Date
  1955. PARAMETERS:
  1956. err (IN/OUT) - error handle. If there is an error, it is
  1957. recorded in 'err' and this function returns OCI_ERROR.
  1958. The error recorded in 'err' can be retrieved by calling
  1959. OCIErrorGet().
  1960. date_str (IN) - input string to be converted to Oracle date
  1961. d_str_length (IN) - size of the input string, if the length is -1
  1962. then 'date_str' is treated as a null terminated string
  1963. fmt (IN) - conversion format; if 'fmt' is a null pointer, then
  1964. the string is expected to be in 'DD-MON-YY' format.
  1965. fmt_length (IN) - length of the 'fmt' parameter
  1966. lang_name (IN) - language in which the names and abbreviations of
  1967. days and months are specified, if null i.e. (oratext *)0,
  1968. the default language of session is used,
  1969. lang_length (IN) - length of the 'lang_name' parameter
  1970. date (OUT) - given string converted to date
  1971. DESCRIPTION:
  1972. Converts the given string to Oracle date
  1973. according to the specified format. Refer to "TO_DATE" conversion
  1974. function described in "Oracle SQL Language Reference Manual" for a
  1975. description of format.
  1976. RETURNS:
  1977. OCI_SUCCESS if the function completes successfully.
  1978. OCI_INVALID_HANDLE if 'err' is NULL.
  1979. OCI_ERROR if
  1980. invalid format
  1981. unknown language
  1982. invalid input string
  1983. <to be discovered>
  1984. }
  1985. {----------------------------- OCIDateCompare ------------------------------ }
  1986. {$IFNDEF LinkDynamically}
  1987. function OCIDateCompare(err:POCIError; date1:POCIDate; date2:POCIDate; result:Psword):sword;cdecl;external ocilib name 'OCIDateCompare';
  1988. {$ELSE}
  1989. OCIDateCompare : function (err:POCIError; date1:POCIDate; date2:POCIDate; result:Psword):sword;cdecl;
  1990. {$ENDIF}
  1991. {
  1992. NAME: OCIDateCompare - OCIDate CoMPare dates
  1993. PARAMETERS:
  1994. err (IN/OUT) - error handle. If there is an error, it is
  1995. recorded in 'err' and this function returns OCI_ERROR.
  1996. The error recorded in 'err' can be retrieved by calling
  1997. OCIErrorGet().
  1998. date1, date2 (IN) - dates to be compared
  1999. result (OUT) - comparison result, 0 if equal, -1 if date1 < date2,
  2000. 1 if date1 > date2
  2001. DESCRIPTION:
  2002. The function OCIDateCompare compares two dates. It returns -1 if date1
  2003. is smaller than date2, 0 if they are equal, and 1 if date1 is greater
  2004. than date2.
  2005. RETURNS:
  2006. OCI_SUCCESS if the function completes successfully.
  2007. OCI_INVALID_HANDLE if 'err' is NULL.
  2008. OCI_ERROR if
  2009. invalid date
  2010. <to be discovered>
  2011. }
  2012. {------------------------- OCIDateAddMonths -------------------------------- }
  2013. {$IFNDEF LinkDynamically}
  2014. function OCIDateAddMonths(err:POCIError; date:POCIDate; num_months:sb4; result:POCIDate):sword;cdecl;external ocilib name 'OCIDateAddMonths';
  2015. {$ELSE}
  2016. OCIDateAddMonths : function (err:POCIError; date:POCIDate; num_months:sb4; result:POCIDate):sword;cdecl;
  2017. {$ENDIF}
  2018. {
  2019. NAME: OCIDateAddMonths - OCIDate ADd or subtract Months
  2020. PARAMETERS:
  2021. err (IN/OUT) - error handle. If there is an error, it is
  2022. recorded in 'err' and this function returns OCI_ERROR.
  2023. The error recorded in 'err' can be retrieved by calling
  2024. OCIErrorGet().
  2025. date (IN) - 'num_months' added or subtracted from 'date'
  2026. num_months (IN) - number of months to be added or subtracted
  2027. (a negative value will be subtracted)
  2028. result (IN/OUT) - result of adding or subtracting to 'date'
  2029. DESCRIPTION:
  2030. The function OCIDateAddDays adds or subtracts num_months from the
  2031. date 'date'.
  2032. If the input 'date' is the last day of a month, then
  2033. appropriate adjustments are made to ensure that the output date is
  2034. also the last day of the month. For example, Feb. 28 + 1 month =
  2035. March 31, and November 30 - 3 months = August 31. Otherwise the
  2036. 'result' date has the same day component as 'date'.
  2037. RETURNS:
  2038. OCI_SUCCESS if the function completes successfully.
  2039. OCI_INVALID_HANDLE if 'err' is NULL.
  2040. OCI_ERROR if
  2041. invalid date
  2042. <to be discovered>
  2043. }
  2044. {--------------------------- OCIDateAddDays -------------------------------- }
  2045. {$IFNDEF LinkDynamically}
  2046. function OCIDateAddDays(err:POCIError; date:POCIDate; num_days:sb4; result:POCIDate):sword;cdecl;external ocilib name 'OCIDateAddDays';
  2047. {$ELSE}
  2048. OCIDateAddDays : function (err:POCIError; date:POCIDate; num_days:sb4; result:POCIDate):sword;cdecl;
  2049. {$ENDIF}
  2050. {
  2051. NAME: OCIDateAddDays - OCIDate ADd or subtract Days
  2052. PARAMETERS:
  2053. err (IN/OUT) - error handle. If there is an error, it is
  2054. recorded in 'err' and this function returns OCI_ERROR.
  2055. The error recorded in 'err' can be retrieved by calling
  2056. OCIErrorGet().
  2057. date (IN) - 'num_days' added or subtracted from 'date'
  2058. num_days (IN) - number of days to be added or subtracted
  2059. (a negative value will be subtracted)
  2060. result (IN/OUT) - result of adding or subtracting to 'date'
  2061. DESCRIPTION:
  2062. The function OCIDateAddDays adds or subtracts num_days from the
  2063. date 'date'.
  2064. RETURNS:
  2065. OCI_SUCCESS if the function completes successfully.
  2066. OCI_INVALID_HANDLE if 'err' is NULL.
  2067. OCI_ERROR if
  2068. invalid date
  2069. <to be discovered>
  2070. }
  2071. {--------------------------- OCIDateLastDay -------------------------------- }
  2072. {$IFNDEF LinkDynamically}
  2073. function OCIDateLastDay(err:POCIError; date:POCIDate; last_day:POCIDate):sword;cdecl;external ocilib name 'OCIDateLastDay';
  2074. {$ELSE}
  2075. OCIDateLastDay : function (err:POCIError; date:POCIDate; last_day:POCIDate):sword;cdecl;
  2076. {$ENDIF}
  2077. {
  2078. NAME: OCIDateLastDay - OCIDate get date of the LaST day of the month
  2079. PARAMETERS:
  2080. err (IN/OUT) - error handle. If there is an error, it is
  2081. recorded in 'err' and this function returns OCI_ERROR.
  2082. The error recorded in 'err' can be retrieved by calling
  2083. OCIErrorGet().
  2084. date (IN) - input date
  2085. last_day (OUT) - last day of the month in date 'date'
  2086. DESCRIPTION:
  2087. The function OCIDateLastDay returns the date of the last day of the
  2088. month in date 'date'.
  2089. RETURNS:
  2090. OCI_SUCCESS if the function completes successfully.
  2091. OCI_INVALID_HANDLE if 'err' is NULL.
  2092. OCI_ERROR if
  2093. invalid date
  2094. <to be discovered>
  2095. }
  2096. {----------------------- OCIDateDaysBetween -------------------------------- }
  2097. {$IFNDEF LinkDynamically}
  2098. function OCIDateDaysBetween(err:POCIError; date1:POCIDate; date2:POCIDate; num_days:Psb4):sword;cdecl;external ocilib name 'OCIDateDaysBetween';
  2099. {$ELSE}
  2100. OCIDateDaysBetween : function (err:POCIError; date1:POCIDate; date2:POCIDate; num_days:Psb4):sword;cdecl;
  2101. {$ENDIF}
  2102. {
  2103. NAME: OCIDateDaysBetween - OCIDate get number of days BeTWeen two dates
  2104. PARAMETERS:
  2105. err (IN/OUT) - error handle. If there is an error, it is
  2106. recorded in 'err' and this function returns OCI_ERROR.
  2107. The error recorded in 'err' can be retrieved by calling
  2108. OCIErrorGet().
  2109. date1, date2 (IN) - input dates
  2110. num_days (OUT) - number of days between date1 and date2
  2111. DESCRIPTION:
  2112. The function OCIDateDaysBetween returns the number of days between
  2113. date1 and date2. The time is ignored in this computation.
  2114. RETURNS:
  2115. OCI_SUCCESS if the function completes successfully.
  2116. OCI_INVALID_HANDLE if 'err' is NULL.
  2117. OCI_ERROR if
  2118. invalid date
  2119. <to be discovered>
  2120. }
  2121. {------------------------ OCIDateZoneToZone -------------------------------- }
  2122. {$IFNDEF LinkDynamically}
  2123. function OCIDateZoneToZone(err:POCIError; date1:POCIDate; zon1:Poratext; zon1_length:ub4; zon2:Poratext;
  2124. zon2_length:ub4; date2:POCIDate):sword;cdecl;external ocilib name 'OCIDateZoneToZone';
  2125. {$ELSE}
  2126. OCIDateZoneToZone : function (err:POCIError; date1:POCIDate; zon1:Poratext; zon1_length:ub4; zon2:Poratext;
  2127. zon2_length:ub4; date2:POCIDate):sword;cdecl;
  2128. {$ENDIF}
  2129. {
  2130. NAME: OCIDateZoneToZone - OCIDate convert date from one Zone TO another Zone
  2131. PARAMETERS:
  2132. err (IN/OUT) - error handle. If there is an error, it is
  2133. recorded in 'err' and this function returns OCI_ERROR.
  2134. The error recorded in 'err' can be retrieved by calling
  2135. OCIErrorGet().
  2136. date1 (IN) - date to be converted
  2137. zon1 (IN) - zone of input date
  2138. zon1_length (IN) - length in bytes of string 'zon1'
  2139. zon2 (IN) - zone to be converted to
  2140. zon2_length (IN) - length in bytes of string 'zon2'
  2141. date2 (OUT) - converted date (in 'zon2')
  2142. DESCRIPTION:
  2143. Converts date from one time zone to another. Given date 'date1'
  2144. in time zone 'zon1' returns date 'date2' in time zone 'zon2'.
  2145. RETURNS:
  2146. OCI_SUCCESS if the function completes successfully.
  2147. OCI_INVALID_HANDLE if 'err' is NULL.
  2148. OCI_ERROR if
  2149. invlid date
  2150. invald input time zone
  2151. invald output time zone
  2152. <to be discovered>
  2153. }
  2154. {--------------------------- OCIDateNextDay -------------------------------- }
  2155. {$IFNDEF LinkDynamically}
  2156. function OCIDateNextDay(err:POCIError; date:POCIDate; day_p:Poratext; day_length:ub4; next_day:POCIDate):sword;cdecl;external ocilib name 'OCIDateNextDay';
  2157. {$ELSE}
  2158. OCIDateNextDay : function (err:POCIError; date:POCIDate; day_p:Poratext; day_length:ub4; next_day:POCIDate):sword;cdecl;
  2159. {$ENDIF}
  2160. {
  2161. NAME: OCIDateNextDay - OCIDate get date of Next DaY
  2162. PARAMETERS:
  2163. err (IN/OUT) - error handle. If there is an error, it is
  2164. recorded in 'err' and this function returns OCI_ERROR.
  2165. The error recorded in 'err' can be retrieved by calling
  2166. OCIErrorGet().
  2167. date (IN) - returned date should be later than this date
  2168. day (IN) - first day of week named by this is returned
  2169. day_length (IN) - length in bytes of string 'day'
  2170. next_day (OUT) - first day of the week named by 'day' later than 'date'
  2171. DESCRIPTION:
  2172. Returns the date of the first day of the
  2173. week named by 'day' that is later than date 'date'.
  2174. RETURNS:
  2175. OCI_SUCCESS if the function completes successfully.
  2176. OCI_INVALID_HANDLE if 'err' is NULL.
  2177. OCI_ERROR if
  2178. invalid date
  2179. invalid day
  2180. <to be discovered>
  2181. }
  2182. {----------------------------- OCIDateCheck -------------------------------- }
  2183. { Listing of error bits used by OCIDateCheck() }
  2184. { Bad DAy }
  2185. const
  2186. OCI_DATE_INVALID_DAY = $1;
  2187. { Bad DAy Low/high bit (1=low) }
  2188. OCI_DATE_DAY_BELOW_VALID = $2;
  2189. { Bad MOnth }
  2190. OCI_DATE_INVALID_MONTH = $4;
  2191. { Bad MOnth Low/high bit (1=low) }
  2192. OCI_DATE_MONTH_BELOW_VALID = $8;
  2193. { Bad YeaR }
  2194. OCI_DATE_INVALID_YEAR = $10;
  2195. { Bad YeaR Low/high bit (1=low) }
  2196. OCI_DATE_YEAR_BELOW_VALID = $20;
  2197. { Bad HouR }
  2198. OCI_DATE_INVALID_HOUR = $40;
  2199. { Bad HouR Low/high bit (1=low) }
  2200. OCI_DATE_HOUR_BELOW_VALID = $80;
  2201. { Bad MiNute }
  2202. OCI_DATE_INVALID_MINUTE = $100;
  2203. OCI_DATE_MINUTE_BELOW_VALID = $200;
  2204. { Bad MiNute Low/high bit (1=low) }
  2205. { Bad SeCond }
  2206. OCI_DATE_INVALID_SECOND = $400;
  2207. OCI_DATE_SECOND_BELOW_VALID = $800;
  2208. { bad second Low/high bit (1=low) }
  2209. OCI_DATE_DAY_MISSING_FROM_1582 = $1000;
  2210. { Day is one of those "missing" from 1582 }
  2211. { Year may not equal zero }
  2212. OCI_DATE_YEAR_ZERO = $2000;
  2213. { Bad date format input }
  2214. OCI_DATE_INVALID_FORMAT = $8000;
  2215. {$IFNDEF LinkDynamically}
  2216. function OCIDateCheck(err:POCIError; date:POCIDate; valid:Puword):sword;cdecl;external ocilib name 'OCIDateCheck';
  2217. {$ELSE}
  2218. var OCIDateCheck : function(err:POCIError; date:POCIDate; valid:Puword):sword;cdecl;
  2219. {$ENDIF}
  2220. {
  2221. NAME: OCIDateCheck - OCIDate CHecK if the given date is valid
  2222. PARAMETERS:
  2223. err (IN/OUT) - error handle. If there is an error, it is
  2224. recorded in 'err' and this function returns OCI_ERROR.
  2225. The error recorded in 'err' can be retrieved by calling
  2226. OCIErrorGet().
  2227. date (IN) - date to be checked
  2228. valid (OUT) - returns zero for a valid date, otherwise
  2229. the ORed combination of all error bits specified below:
  2230. Macro name Bit number Error
  2231. ---------- ---------- -----
  2232. OCI_DATE_INVALID_DAY 0x1 Bad day
  2233. OCI_DATE_DAY_BELOW_VALID 0x2 Bad DAy Low/high bit (1=low)
  2234. OCI_DATE_INVALID_MONTH 0x4 Bad MOnth
  2235. OCI_DATE_MONTH_BELOW_VALID 0x8 Bad MOnth Low/high bit (1=low)
  2236. OCI_DATE_INVALID_YEAR 0x10 Bad YeaR
  2237. OCI_DATE_YEAR_BELOW_VALID 0x20 Bad YeaR Low/high bit (1=low)
  2238. OCI_DATE_INVALID_HOUR 0x40 Bad HouR
  2239. OCI_DATE_HOUR_BELOW_VALID 0x80 Bad HouR Low/high bit (1=low)
  2240. OCI_DATE_INVALID_MINUTE 0x100 Bad MiNute
  2241. OCI_DATE_MINUTE_BELOW_VALID 0x200 Bad MiNute Low/high bit (1=low)
  2242. OCI_DATE_INVALID_SECOND 0x400 Bad SeCond
  2243. OCI_DATE_SECOND_BELOW_VALID 0x800 bad second Low/high bit (1=low)
  2244. OCI_DATE_DAY_MISSING_FROM_1582 0x1000 Day is one of those "missing"
  2245. from 1582
  2246. OCI_DATE_YEAR_ZERO 0x2000 Year may not equal zero
  2247. OCI_DATE_INVALID_FORMAT 0x8000 Bad date format input
  2248. So, for example, if the date passed in was 2/0/1990 25:61:10 in
  2249. (month/day/year hours:minutes:seconds format), the erroor returned
  2250. would be OCI_DATE_INVALID_DAY | OCI_DATE_DAY_BELOW_VALID |
  2251. OCI_DATE_INVALID_HOUR | OCI_DATE_INVALID_MINUTE
  2252. DESCRIPTION:
  2253. Check if the given date is valid.
  2254. RETURNS:
  2255. OCI_SUCCESS if the function completes successfully.
  2256. OCI_INVALID_HANDLE if 'err' is NULL.
  2257. OCI_ERROR if
  2258. 'date' and 'valid' pointers are NULL pointers
  2259. }
  2260. {--------------------------- OCIDateSysDate -------------------------------- }
  2261. {$IFNDEF LinkDynamically}
  2262. function OCIDateSysDate(err:POCIError; sys_date:POCIDate):sword;cdecl;external ocilib name 'OCIDateSysDate';
  2263. {$ELSE}
  2264. OCIDateSysDate : function (err:POCIError; sys_date:POCIDate):sword;cdecl;
  2265. {$ENDIF}
  2266. {
  2267. NAME: OCIDateSysDate - OCIDate get current SYStem date and time
  2268. PARAMETERS:
  2269. err (IN/OUT) - error handle. If there is an error, it is
  2270. recorded in 'err' and this function returns OCI_ERROR.
  2271. The error recorded in 'err' can be retrieved by calling
  2272. OCIErrorGet().
  2273. sys_date (OUT) - current system date and time
  2274. DESCRIPTION:
  2275. Returns the current system date and time.
  2276. RETURNS:
  2277. OCI_SUCCESS if the function completes successfully.
  2278. OCI_INVALID_HANDLE if 'err' is NULL.
  2279. OCI_ERROR if
  2280. <to be discovered>
  2281. }
  2282. {*************************************************************************** }
  2283. { FIXED-LENGTH STRING - CHAR (N) }
  2284. {*************************************************************************** }
  2285. {
  2286. * An ADT attribute declared as "x CHAR(n)" is mapped to "OCIString *x;".
  2287. * The representation of OCIString * is shown below.
  2288. }
  2289. {*************************************************************************** }
  2290. { VARIABLE-LENGTH STRING }
  2291. {*************************************************************************** }
  2292. {
  2293. * The variable-length string is represented in C as a pointer to OCIString
  2294. * structure. The OCIString structure is opaque to the user. Functions are
  2295. * provided to allow the user to manipulate a variable-length string.
  2296. *
  2297. * A variable-length string can be declared as:
  2298. *
  2299. * OCIString *vstr;
  2300. *
  2301. * For binding variables of type OCIString* in OCI calls (OCIBindByName(),
  2302. * OCIBindByPos() and OCIDefineByPos()) use the external type code SQLT_VST.
  2303. }
  2304. type
  2305. POCIString = pointer;
  2306. {-------------------------- OCIStringAssign -------------------------------- }
  2307. {$IFNDEF LinkDynamically}
  2308. function OCIStringAssign(env:POCIEnv; err:POCIError; rhs:POCIString; var lhs:POCIString):sword;cdecl;external ocilib name 'OCIStringAssign';
  2309. {$ELSE}
  2310. var OCIStringAssign : function (env:POCIEnv; err:POCIError; rhs:POCIString; var lhs:POCIString):sword;cdecl;
  2311. {$ENDIF}
  2312. {
  2313. NAME: OCIStringAssign - OCIString Assign String to String
  2314. PARAMETERS:
  2315. env (IN/OUT) - OCI environment handle initialized in object mode.
  2316. err (IN/OUT) - error handle. If there is an error, it is
  2317. recorded in 'err' and this function returns OCI_ERROR.
  2318. The error recorded in 'err' can be retrieved by calling
  2319. OCIErrorGet().
  2320. rhs (IN) - RHS of the assignment, the type of rhs is also OCIString
  2321. lhs (IN/OUT) - LHS of the assignment
  2322. DESCRIPTION:
  2323. Assign 'rhs' string to 'lhs' string. The 'lhs' string may be
  2324. resized depending upon the size of the 'rhs'. The assigned string is
  2325. null-terminated. The 'length' field will not include the extra byte
  2326. needed for null termination.
  2327. RETURNS:
  2328. OCI_SUCCESS if the function completes successfully.
  2329. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2330. OCI_ERROR if
  2331. out of space error
  2332. }
  2333. {---------------------- OCIStringAssignText -------------------------------- }
  2334. {$IFNDEF LinkDynamically}
  2335. function OCIStringAssignText(env:POCIEnv; err:POCIError; rhs:Poratext; rhs_len:ub4; var lhs:POCIString):sword;cdecl;external ocilib name 'OCIStringAssignText';
  2336. {$ELSE}
  2337. OCIStringAssignText : function (env:POCIEnv; err:POCIError; rhs:Poratext; rhs_len:ub4; var lhs:POCIString):sword;cdecl;
  2338. {$ENDIF}
  2339. {
  2340. NAME: OCIStringAssignText - OCIString Assign Text string to String
  2341. PARAMETERS:
  2342. env (IN/OUT) - OCI environment handle initialized in object mode.
  2343. err (IN/OUT) - error handle. If there is an error, it is
  2344. recorded in 'err' and this function returns OCI_ERROR.
  2345. The error recorded in 'err' can be retrieved by calling
  2346. OCIErrorGet().
  2347. rhs (IN) - RHS of the assignment, the type of rhs is a text string
  2348. rhs_len (IN) - length of the 'rhs' string
  2349. lhs (IN/OUT) - LHS of the assignment
  2350. DESCRIPTION:
  2351. Assign 'rhs' string to 'lhs' string. The 'lhs' string may be
  2352. resized depending upon the size of the 'rhs'. The assigned string is
  2353. null-terminated. The 'length' field will not include the extra byte
  2354. needed for null termination.
  2355. RETURNS:
  2356. OCI_SUCCESS if the function completes successfully.
  2357. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2358. OCI_ERROR if
  2359. out of space error
  2360. }
  2361. {-------------------------- OCIStringResize -------------------------------- }
  2362. {$IFNDEF LinkDynamically}
  2363. function OCIStringResize(env:POCIEnv; err:POCIError; new_size:ub4; var str:POCIString):sword;cdecl;external ocilib name 'OCIStringResize';
  2364. {$ELSE}
  2365. OCIStringResize : function (env:POCIEnv; err:POCIError; new_size:ub4; var str:POCIString):sword;cdecl;
  2366. {$ENDIF}
  2367. {
  2368. NAME: OCIStringResize - OCIString ReSiZe string memory
  2369. PARAMETERS:
  2370. env (IN/OUT) - OCI environment handle initialized in object mode.
  2371. err (IN/OUT) - error handle. If there is an error, it is
  2372. recorded in 'err' and this function returns OCI_ERROR.
  2373. The error recorded in 'err' can be retrieved by calling
  2374. OCIErrorGet().
  2375. new_size (IN) - new memory size of the string in bytes
  2376. str (IN/OUT) - allocated memory for the string is freed from the
  2377. OOCI heap
  2378. DESCRIPTION:
  2379. This function resizes the memory of the given variable-length string in
  2380. the object cache. The contents of the string are NOT preserved.
  2381. This function may allocate the string in a new memory region in
  2382. which case the original memory occupied by the given string will
  2383. be freed. If the input string is null (str == NULL), then this
  2384. function will allocate memory for the string.
  2385. If the new_size is 0, then this function frees the memory occupied
  2386. by 'str' and a null pointer value is returned.
  2387. NOTE: The caller must compute 'new_size' taking into account space
  2388. for the null character ('\0').
  2389. RETURNS:
  2390. OCI_SUCCESS if the function completes successfully.
  2391. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2392. OCI_ERROR if
  2393. out of space error
  2394. }
  2395. {---------------------------- OCIStringSize -------------------------------- }
  2396. {$IFNDEF LinkDynamically}
  2397. function OCIStringSize(env:POCIEnv; vs:POCIString):ub4;cdecl;external ocilib name 'OCIStringSize';
  2398. {$ELSE}
  2399. OCIStringSize : function (env:POCIEnv; vs:POCIString):ub4;cdecl;
  2400. {$ENDIF}
  2401. {
  2402. NAME: OCIStringSize - OCIString Get String siZe
  2403. PARAMETERS:
  2404. env(IN) - pointer to OCI environment handle
  2405. vs (IN) - string whose size is returned
  2406. DESCRIPTION:
  2407. Return the size of the given string.
  2408. RETURNS:
  2409. size of the string in bytes is returned
  2410. }
  2411. {----------------------------- OCIStringPtr -------------------------------- }
  2412. {$IFNDEF LinkDynamically}
  2413. function OCIStringPtr(env:POCIEnv; vs:POCIString):Poratext;cdecl;external ocilib name 'OCIStringPtr';
  2414. {$ELSE}
  2415. OCIStringPtr : function (env:POCIEnv; vs:POCIString):Poratext;cdecl;
  2416. {$ENDIF}
  2417. {
  2418. NAME: OCIStringPtr - OCIString Get String Pointer
  2419. PARAMETERS:
  2420. env(IN) - pointer to OCI environment handle
  2421. vs (IN) - pointer to the text of this string is returned
  2422. DESCRIPTION:
  2423. Return the pointer to the text of the given string.
  2424. RETURNS:
  2425. pointer to the text of the string is returned
  2426. }
  2427. {----------------------- OCIStringAllocSize -------------------------------- }
  2428. {$IFNDEF LinkDynamically}
  2429. function OCIStringAllocSize(env:POCIEnv; err:POCIError; vs:POCIString; allocsize:Pub4):sword;cdecl;external ocilib name 'OCIStringAllocSize';
  2430. {$ELSE}
  2431. OCIStringAllocSize : function (env:POCIEnv; err:POCIError; vs:POCIString; allocsize:Pub4):sword;cdecl;
  2432. {$ENDIF}
  2433. {
  2434. NAME: OCIStringAllocSize - OCIString get Allocated SiZe of string memory
  2435. in bytes
  2436. PARAMETERS:
  2437. env (IN/OUT) - OCI environment handle initialized in object mode.
  2438. err (IN/OUT) - error handle. If there is an error, it is
  2439. recorded in 'err' and this function returns OCI_ERROR.
  2440. The error recorded in 'err' can be retrieved by calling
  2441. OCIErrorGet().
  2442. vs (IN) - string whose allocated size in bytes is returned
  2443. allocsize (OUT) - allocated size of string memory in bytes is returned
  2444. DESCRIPTION:
  2445. Return the allocated size of the string memory in bytes. The
  2446. allocated size is >= actual string size.
  2447. REQUIRES:
  2448. vs is a non-null pointer
  2449. RETURNS:
  2450. OCI_SUCCESS if the function completes successfully.
  2451. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2452. OCI_ERROR on error
  2453. }
  2454. {*************************************************************************** }
  2455. { VARIABLE-LENGTH RAW }
  2456. {*************************************************************************** }
  2457. {
  2458. * The variable-length raw is represented in C as a pointer to OCIRaw
  2459. * structure. The OCIRaw structure is opaque to the user. Functions are
  2460. * provided to allow the user to manipulate a variable-length raw.
  2461. *
  2462. * A variable-length raw can be declared as:
  2463. *
  2464. * OCIRaw *raw;
  2465. *
  2466. * For binding variables of type OCIRaw* in OCI calls (OCIBindByName(),
  2467. * OCIBindByPos() and OCIDefineByPos()) use the external type code SQLT_LVB.
  2468. }
  2469. type
  2470. POCIRaw = pointer;
  2471. {-------------------------- OCIRawAssignRaw -------------------------------- }
  2472. {$IFNDEF LinkDynamically}
  2473. function OCIRawAssignRaw(env:POCIEnv; err:POCIError; rhs:POCIRaw; var lhs:POCIRaw):sword;cdecl;external ocilib name 'OCIRawAssignRaw';
  2474. {$ELSE}
  2475. var OCIRawAssignRaw : function (env:POCIEnv; err:POCIError; rhs:POCIRaw; var lhs:POCIRaw):sword;cdecl;
  2476. {$ENDIF}
  2477. {
  2478. NAME: OCIRawAssignRaw - OCIRaw Assign Raw (of type OCIRaw*) to
  2479. Raw (of type OCIRaw*)
  2480. PARAMETERS:
  2481. env (IN/OUT) - OCI environment handle initialized in object mode.
  2482. err (IN/OUT) - error handle. If there is an error, it is
  2483. recorded in 'err' and this function returns OCI_ERROR.
  2484. The error recorded in 'err' can be retrieved by calling
  2485. OCIErrorGet().
  2486. rhs (IN) - RHS of the assignment, the type of rhs is also OCIRaw
  2487. lhs (IN/OUT) - LHS of the assignment
  2488. DESCRIPTION:
  2489. Assign 'rhs' raw to 'lhs' raw. The 'lhs' raw may be
  2490. resized depending upon the size of the 'rhs'.
  2491. RETURNS:
  2492. OCI_SUCCESS if the function completes successfully.
  2493. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2494. OCI_ERROR if
  2495. out of space error
  2496. }
  2497. {------------------------ OCIRawAssignBytes -------------------------------- }
  2498. {$IFNDEF LinkDynamically}
  2499. function OCIRawAssignBytes(env:POCIEnv; err:POCIError; rhs:Pub1; rhs_len:ub4; var lhs:POCIRaw):sword;cdecl;external ocilib name 'OCIRawAssignBytes';
  2500. {$ELSE}
  2501. OCIRawAssignBytes : function (env:POCIEnv; err:POCIError; rhs:Pub1; rhs_len:ub4; var lhs:POCIRaw):sword;cdecl;
  2502. {$ENDIF}
  2503. {
  2504. NAME: OCIRawAssignBytes - OCIRaw Assign raw Bytes (of type ub1*) to Raw
  2505. (of type OCIRaw*)
  2506. PARAMETERS:
  2507. env (IN/OUT) - OCI environment handle initialized in object mode.
  2508. err (IN/OUT) - error handle. If there is an error, it is
  2509. recorded in 'err' and this function returns OCI_ERROR.
  2510. The error recorded in 'err' can be retrieved by calling
  2511. OCIErrorGet().
  2512. rhs (IN) - RHS of the assignment, the type of rhs is ub1 *
  2513. rhs_len (IN) - length of the 'rhs' raw
  2514. lhs (IN/OUT) - LHS of the assignment
  2515. DESCRIPTION:
  2516. Assign 'rhs' raw to 'lhs' raw. The 'lhs' raw may be
  2517. resized depending upon the size of the 'rhs'.
  2518. RETURNS:
  2519. OCI_SUCCESS if the function completes successfully.
  2520. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2521. OCI_ERROR if
  2522. out of space error
  2523. }
  2524. {---------------------------- OCIRawResize --------------------------------- }
  2525. {$IFNDEF LinkDynamically}
  2526. function OCIRawResize(env:POCIEnv; err:POCIError; new_size:ub4; var raw:POCIRaw):sword;cdecl;external ocilib name 'OCIRawResize';
  2527. {$ELSE}
  2528. OCIRawResize : function (env:POCIEnv; err:POCIError; new_size:ub4; var raw:POCIRaw):sword;cdecl;
  2529. {$ENDIF}
  2530. {
  2531. NAME: OCIRawResize - OCIRaw ReSiZe memory of variable-length raw
  2532. PARAMETERS:
  2533. env (IN/OUT) - OCI environment handle initialized in object mode.
  2534. err (IN/OUT) - error handle. If there is an error, it is
  2535. recorded in 'err' and this function returns OCI_ERROR.
  2536. The error recorded in 'err' can be retrieved by calling
  2537. OCIErrorGet().
  2538. new_size (IN) - new size of the raw data in bytes
  2539. raw (IN) - variable-length raw pointer; the raw is
  2540. resized to 'new_size'
  2541. DESCRIPTION:
  2542. This function resizes the memory of the given variable-length raw in
  2543. the object cache.
  2544. The previous contents of the raw are NOT preserved.
  2545. This function may allocate the raw in a new memory region in
  2546. which case the original memory occupied by the given raw will
  2547. be freed. If the input raw is null (raw == NULL), then this
  2548. function will allocate memory for the raw data.
  2549. If the new_size is 0, then this function frees the memory occupied
  2550. by 'raw' and a null pointer value is returned.
  2551. RETURNS:
  2552. OCI_SUCCESS if the function completes successfully.
  2553. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2554. OCI_ERROR if
  2555. out of space error
  2556. }
  2557. {------------------------------- OCIRawSize -------------------------------- }
  2558. {$IFNDEF LinkDynamically}
  2559. function OCIRawSize(env:POCIEnv; raw:POCIRaw):ub4;cdecl;external ocilib name 'OCIRawSize';
  2560. {$ELSE}
  2561. OCIRawSize : function (env:POCIEnv; raw:POCIRaw):ub4;cdecl;
  2562. {$ENDIF}
  2563. {
  2564. NAME: OCIRawSize - OCIRaw Get Raw siZe
  2565. PARAMETERS:
  2566. env (IN) - pointer to OCI environment handle
  2567. raw (INT) - raw whose size is returned
  2568. DESCRIPTION:
  2569. Return the size of the given raw.
  2570. RETURNS:
  2571. size of the raw in bytes is returned
  2572. }
  2573. {--------------------------------- OCIRawPtr ------------------------------- }
  2574. {$IFNDEF LinkDynamically}
  2575. function OCIRawPtr(env:POCIEnv; raw:POCIRaw):Pub1;cdecl;external ocilib name 'OCIRawPtr';
  2576. {$ELSE}
  2577. OCIRawPtr : function(env:POCIEnv; raw:POCIRaw):Pub1;cdecl;
  2578. {$ENDIF}
  2579. {
  2580. NAME: OCIRawPtr - OCIRaw Get Raw data Pointer
  2581. PARAMETERS:
  2582. env (IN) - pointer to OCI environment handle
  2583. raw (IN) - pointer to the data of this raw is returned
  2584. DESCRIPTION:
  2585. Return the pointer to the data of the given raw.
  2586. RETURNS:
  2587. pointer to the data of the raw is returned
  2588. }
  2589. {------------------------------ OCIRawAllocSize ---------------------------- }
  2590. {$IFNDEF LinkDynamically}
  2591. function OCIRawAllocSize(env:POCIEnv; err:POCIError; raw:POCIRaw; allocsize:Pub4):sword;cdecl;external ocilib name 'OCIRawAllocSize';
  2592. {$ELSE}
  2593. OCIRawAllocSize : function (env:POCIEnv; err:POCIError; raw:POCIRaw; allocsize:Pub4):sword;cdecl;
  2594. {$ENDIF}
  2595. {
  2596. NAME: OCIRawAllocSize - OCIRaw get Allocated SiZe of raw memory in bytes
  2597. PARAMETERS:
  2598. env (IN/OUT) - OCI environment handle initialized in object mode.
  2599. err (IN/OUT) - error handle. If there is an error, it is
  2600. recorded in 'err' and this function returns OCI_ERROR.
  2601. The error recorded in 'err' can be retrieved by calling
  2602. OCIErrorGet().
  2603. raw (IN) - raw whose allocated size in bytes is returned
  2604. allocsize (OUT) - allocated size of raw memory in bytes is returned
  2605. DESCRIPTION:
  2606. Return the allocated size of the raw memory in bytes. The
  2607. allocated size is >= actual raw size.
  2608. REQUIRES:
  2609. raw is a non-null pointer
  2610. RETURNS:
  2611. OCI_SUCCESS if the function completes successfully.
  2612. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2613. OCI_ERROR upon error
  2614. }
  2615. {*************************************************************************** }
  2616. { OBJECT REFERENCE OPERATIONS }
  2617. {*************************************************************************** }
  2618. {
  2619. * See the definition of OCIRef in oro.h.
  2620. *
  2621. * For binding variables of type OCIRef* in OCI calls (OCIBindByName(),
  2622. * OCIBindByPos() and OCIDefineByPos()) use the code SQLT_REF.
  2623. *
  2624. }
  2625. {---------------------------- OCIRefClear ---------------------------------- }
  2626. {$IFNDEF LinkDynamically}
  2627. procedure OCIRefClear(env:POCIEnv; ref:POCIRef);cdecl;external ocilib name 'OCIRefClear';
  2628. {$ELSE}
  2629. OCIRefClear : procedure (env:POCIEnv; ref:POCIRef);cdecl;
  2630. {$ENDIF}
  2631. {
  2632. NAME: OCIRefClear - OCIRef CLeaR or nullify a ref
  2633. PARAMETERS:
  2634. env (IN) - pointer to OCI environment handle
  2635. ref (IN/OUT) - ref to clear
  2636. DESCRIPTION:
  2637. Clear or nullify the given ref. A ref is considered to be a null ref
  2638. if it does not contain a valid OID (and thus doesn't point to an
  2639. object). Logically, a null ref is a dangling ref.
  2640. Note that a null ref is still a valid SQL value and is not SQL-ly null.
  2641. It can be used as a valid non-null constant ref value for NOT NULL
  2642. column or attribute of a row in a table.
  2643. If a null pointer value is passed as a ref,
  2644. then this function is a no-op.
  2645. }
  2646. {--------------------------- OCIRefAssign ---------------------------------- }
  2647. {$IFNDEF LinkDynamically}
  2648. function OCIRefAssign(env:POCIEnv; err:POCIError; source:POCIRef; var target:POCIRef):sword;cdecl;external ocilib name 'OCIRefAssign';
  2649. {$ELSE}
  2650. OCIRefAssign : function (env:POCIEnv; err:POCIError; source:POCIRef; var target:POCIRef):sword;cdecl;
  2651. {$ENDIF}
  2652. {
  2653. NAME: OCIRefAssign - OCIRef CoPY a ref to another
  2654. PARAMETERS:
  2655. env (IN/OUT) - OCI environment handle initialized in object mode.
  2656. err (IN/OUT) - error handle. If there is an error, it is
  2657. recorded in 'err' and this function returns OCI_ERROR.
  2658. The error recorded in 'err' can be retrieved by calling
  2659. OCIErrorGet().
  2660. source (IN) - ref to copy from
  2661. target (IN/OUT) - ref to copy to
  2662. DESCRIPTION:
  2663. Copy 'source' ref to 'target' ref; both then reference the same
  2664. object. If the target ref pointer is null (i.e. *target == NULL)
  2665. then the copy function will allocate memory for the target ref
  2666. in OOCI heap prior to the copy.
  2667. RETURNS:
  2668. OCI_SUCCESS if the function completes successfully.
  2669. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2670. OCI_ERROR if
  2671. 1) out of memory
  2672. }
  2673. {-------------------------- OCIRefIsEqual ---------------------------------- }
  2674. {$IFNDEF LinkDynamically}
  2675. function OCIRefIsEqual(env:POCIEnv; x:POCIRef; y:POCIRef):boolean;cdecl;external ocilib name 'OCIRefIsEqual';
  2676. {$ELSE}
  2677. OCIRefIsEqual : function (env:POCIEnv; x:POCIRef; y:POCIRef):boolean;cdecl;
  2678. {$ENDIF}
  2679. {
  2680. NAME: OCIRefIsEqual - OCIRef compare two refs for EQUality
  2681. PARAMETERS:
  2682. env (IN) - pointer to OCI environment handle
  2683. x (IN) - ref to compare
  2684. y (IN) - ref to compare
  2685. DESCRIPTION:
  2686. Compare the given refs for equality.
  2687. Two refs are equal if and only if:
  2688. - they are both referencing the same persistent object, or
  2689. - they are both referencing the same transient object.
  2690. NOTE THAT TWO NULL REFS ARE CONSIDERED NOT EQUAL BY THIS FUNCTION.
  2691. RETURNS:
  2692. TRUE if the two refs are equal
  2693. FALSE if the two refs are not equal, or X is NULL, or Y is NULL
  2694. }
  2695. {--------------------------- OCIRefIsNull ---------------------------------- }
  2696. {$IFNDEF LinkDynamically}
  2697. function OCIRefIsNull(env:POCIEnv; ref:POCIRef):boolean;cdecl;external ocilib name 'OCIRefIsNull';
  2698. {$ELSE}
  2699. OCIRefIsNull : function (env:POCIEnv; ref:POCIRef):boolean;cdecl;
  2700. {$ENDIF}
  2701. {
  2702. NAME: OCIRefIsNull - OCIRef test if a ref is NULl
  2703. PARAMETERS:
  2704. env (IN) - pointer to OCI environment handle
  2705. ref (IN) - ref to test for null
  2706. DESCRIPTION:
  2707. Return TRUE if the given ref is null; otherwise, return FALSE.
  2708. A ref is null if and only if:
  2709. - it is supposed to be referencing a persistent object, but
  2710. its OID is null, or
  2711. - it is supposed to be referencing a transient object, but it is
  2712. currently not pointing to an object.
  2713. A ref is a dangling ref if the object that it points to does not
  2714. exist.
  2715. RETURNS:
  2716. TRUE if the given ref is NULL
  2717. FALSE if the given ref is not NULL
  2718. }
  2719. {-------------------------- OCIRefHexSize ---------------------------------- }
  2720. {$IFNDEF LinkDynamically}
  2721. function OCIRefHexSize(env:POCIEnv; ref:POCIRef):ub4;cdecl;external ocilib name 'OCIRefHexSize';
  2722. {$ELSE}
  2723. OCIRefHexSize : function (env:POCIEnv; ref:POCIRef):ub4;cdecl;
  2724. {$ENDIF}
  2725. {
  2726. NAME: OCIRefHexSize - OCIRef Hexadecimal buffer SiZe in bytes
  2727. PARAMETERS:
  2728. env (IN) - pointer to OCI environment handle
  2729. ref (IN) - ref whose size in hexadecimal representation in bytes is
  2730. returned
  2731. DESCRIPTION:
  2732. Return the size of the buffer in bytes required for the hexadecimal
  2733. representation of the ref. A buffer of at-least this size must be
  2734. passed to ref-to-hex (OCIRefToHex) conversion function.
  2735. RETURNS:
  2736. size of hexadecimal representation of ref
  2737. }
  2738. {-------------------------- OCIRefFromHex --------------------------------- }
  2739. {$IFNDEF LinkDynamically}
  2740. function OCIRefFromHex(env:POCIEnv; err:POCIError; svc:POCISvcCtx; hex:Poratext; length:ub4;
  2741. var ref:POCIRef):sword;cdecl;external ocilib name 'OCIRefFromHex';
  2742. {$ELSE}
  2743. OCIRefFromHex : function (env:POCIEnv; err:POCIError; svc:POCISvcCtx; hex:Poratext; length:ub4;
  2744. var ref:POCIRef):sword;cdecl;
  2745. {$ENDIF}
  2746. {
  2747. NAME:
  2748. OCIRefFromHex - OCIRef convert a Hexadecimal string TO a Ref
  2749. PARAMETERS:
  2750. env (IN/OUT) - OCI environment handle initialized in object mode
  2751. err (IN/OUT) - error handle. If there is an error, it is
  2752. recorded in 'err' and this function returns OCI_ERROR.
  2753. The error recorded in 'err' can be retrieved by
  2754. calling OCIErrorGet().
  2755. svc (IN) - OCI service context handle; if the resulting ref is
  2756. initialized with this service context
  2757. hex (IN) - hexadecimal string (that was produced by 'OCIRefToHex()"
  2758. previously) to be convert into a ref
  2759. length (IN) - length of the hexadecimal string
  2760. ref (IN/OUT) - ref is initialized with the given value ('hex').
  2761. If *ref is null, then space for the ref is allocated in the
  2762. object cache, otherwise the memory occupied by the given ref
  2763. is re-used.
  2764. DESCRIPTION:
  2765. Convert the given hexadecimal string into a ref. This function
  2766. ensures that the resulting ref is well formed. It does NOT ensure
  2767. that the object pointed to by the resulting ref exists or not.
  2768. RETURNS:
  2769. OCI_SUCCESS if the function completes successfully.
  2770. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2771. OCI_ERROR if
  2772. }
  2773. {--------------------------- OCIRefToHex ----------------------------------- }
  2774. {$IFNDEF LinkDynamically}
  2775. function OCIRefToHex(env:POCIEnv; err:POCIError; ref:POCIRef; hex:Poratext; hex_length:Pub4):sword;cdecl;external ocilib name 'OCIRefToHex';
  2776. {$ELSE}
  2777. OCIRefToHex : function (env:POCIEnv; err:POCIError; ref:POCIRef; hex:Poratext; hex_length:Pub4):sword;cdecl;
  2778. {$ENDIF}
  2779. {
  2780. NAME:
  2781. OCIRefToHex - OCIRef convert ref to a Hexadecimal string
  2782. PARAMETERS:
  2783. env (IN/OUT) - OCI environment handle initialized in object mode
  2784. err (IN/OUT) - error handle. If there is an error, it is
  2785. recorded in 'err' and this function returns OCI_ERROR.
  2786. The error recorded in 'err' can be retrieved by
  2787. calling OCIErrorGet().
  2788. ref (IN) - ref to be converted into a hexadecimal string; if the
  2789. ref is a null ref (i.e. OCIRefIsNull(ref) == TRUE) then
  2790. a zero hex_length value is returned
  2791. hex (OUT) - buffer that is large enough to contain the resulting
  2792. hexadecimal string; the contents of the string is opaque
  2793. to the caller
  2794. hex_length (IN/OUT) - on input specifies the size of the 'hex' buffer,
  2795. on output specifies the actual size of the hexadecimal
  2796. string being returned in 'hex'
  2797. DESCRIPTION:
  2798. Convert the given ref into a hexadecimal string, and return the length
  2799. of the string. The resulting string is opaque to the caller.
  2800. RETURNS:
  2801. OCI_SUCCESS if the function completes successfully.
  2802. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2803. OCI_ERROR if
  2804. the given buffer is not big enough to hold the resulting string
  2805. }
  2806. {*************************************************************************** }
  2807. { COLLECTION FUNCTIONS }
  2808. {*************************************************************************** }
  2809. {
  2810. The generic collection is represented by the type 'OCIColl'. The following
  2811. operations OCIColl*() are provided on a generic collection:
  2812. - get current size of collection
  2813. - get upper bound of collection
  2814. - get pointer to an element given its index
  2815. - set element at given index (assign element)
  2816. - append an element
  2817. - trim the given number of elements from the end of the collection
  2818. - collection assignment
  2819. The following iterator based scanning functions are also provided on a
  2820. generic collection. These functions make use of an iterator which is
  2821. defined to be of type OCIIter.
  2822. - create an iterator for scanning collection
  2823. - destroy iterator
  2824. - reset iterator to the beginning of collection
  2825. - get pointer to current element pointed by iterator
  2826. - get pointer to next element
  2827. - get pointer to previous element
  2828. The collections variable-length array (varray) and nested table
  2829. are sub-types of generic collection. This means that the OCIColl*()
  2830. functions can also be used to manipulate varray and nested table.
  2831. The varray is represented by OCIArray type and nested table by OCITable.
  2832. Besides OCIColl*() functions no additional functions are provided for
  2833. manipulating varrays. The OCIColl*() functions are a complete set of
  2834. functions to manipulate varrays.
  2835. Besides OCIColl*() functions, the following functions OCITable*() can be
  2836. used to manipulate nested table. The OCITable*() functions operate on
  2837. nested tables only and should not be used on a varray.
  2838. - delete an element at index i. Note that the position
  2839. ordinals of the remaining elements of the table is not changed by the
  2840. delete operation. So delete creates "holes" in the table.
  2841. - check if an element exists at the given index i
  2842. - return the smallest value of i for which exists(i) is true
  2843. - return the largest value of i for which exists(i) is true
  2844. - return pointer to the smallest position j, greater than i, such that
  2845. OCITableExists(j) is true
  2846. - return pointer to the largest position j, less than i, such that
  2847. OCITableExists(j) is true
  2848. For binding variables of type OCIColl* or OCITable* in OCI calls
  2849. (OCIBindByName(), OCIBindByPos() and OCIDefineByPos()) use the external
  2850. type code SQLT_NTY.
  2851. }
  2852. { OCIColl - generic collection type }
  2853. type
  2854. POCIColl = pointer;
  2855. { OCIArray - varray collection type }
  2856. POCIArray = pointer;
  2857. // POCIArray = ^OCIArray;
  2858. // OCIArray = OCIColl;
  2859. { OCITable - nested table collection type }
  2860. POCITable = pointer;
  2861. // POCITable = ^OCITable;
  2862. // OCITable = OCIColl;
  2863. { OCIIter - collection iterator }
  2864. POCIIter = pointer;
  2865. {----------------------------- OCICollSize --------------------------------- }
  2866. {$IFNDEF LinkDynamically}
  2867. function OCICollSize(env:POCIEnv; err:POCIError; coll:POCIColl; size:Psb4):sword;cdecl;external ocilib name 'OCICollSize';
  2868. {$ELSE}
  2869. var OCICollSize : function (env:POCIEnv; err:POCIError; coll:POCIColl; size:Psb4):sword;cdecl;
  2870. {$ENDIF}
  2871. {
  2872. NAME: OCICollSize - OCIColl return current SIZe of the given collection
  2873. PARAMETERS:
  2874. env(IN) - pointer to OCI environment handle
  2875. err (IN/OUT) - error handle. If there is an error, it is
  2876. recorded in 'err' and this function returns OCI_ERROR.
  2877. The error recorded in 'err' can be retrieved by calling
  2878. OCIErrorGet().
  2879. coll (IN) - collection whose number of elements is returned
  2880. size (OUT) - current number of elements in the collection
  2881. DESCRIPTION:
  2882. Returns the current number of elements in the given collection.
  2883. For collections of type nested table wherein 'delete element'
  2884. operation is allowed, the count returned by OCICollSize() will
  2885. NOT be decremented upon deleting elements. For example:
  2886. OCICollSize(...);
  2887. // assume 'size' returned is equal to 5
  2888. OCITableDelete(...); // delete one element
  2889. OCICollSize(...);
  2890. // 'size' returned will still be 5
  2891. To get the count minus the deleted elements use OCITableSize().
  2892. Continuing the above example,
  2893. OCITableSize(...)
  2894. // 'size' returned will be equal to 4
  2895. Note, a trim operation (OCICollTrim) will decrement the count
  2896. by the number of trimmed elements. Continuing the above example,
  2897. OCICollTrim(..,1..); // trim one element
  2898. OCICollSize(...);
  2899. // 'size' returned will be equal to 4
  2900. RETURNS:
  2901. OCI_SUCCESS if the function completes successfully.
  2902. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2903. OCI_ERROR if
  2904. error during loading of collection into object cache
  2905. any of the input parameters is null
  2906. }
  2907. {------------------------------ OCICollMax --------------------------------- }
  2908. {$IFNDEF LinkDynamically}
  2909. function OCICollMax(env:POCIEnv; coll:POCIColl):sb4;cdecl;external ocilib name 'OCICollMax';
  2910. {$ELSE}
  2911. OCICollMax : function (env:POCIEnv; coll:POCIColl):sb4;cdecl;
  2912. {$ENDIF}
  2913. {
  2914. NAME: OCICollMax - OCIColl return MAXimum size (upper-bound) of the
  2915. given collection (in number of elements)
  2916. PARAMETERS:
  2917. env(IN) - pointer to OCI environment handle
  2918. coll (IN) - collection whose upper-bound in number of elements
  2919. is returned
  2920. DESCRIPTION:
  2921. Returns the max number of elements that the given collection can hold.
  2922. A value 0 indicates that the collection has no upper-bound.
  2923. REQUIRES:
  2924. coll must point to a valid collection descriptor
  2925. RETURNS:
  2926. upper-bound of the given collection
  2927. }
  2928. {-------------------------- OCICollGetElem --------------------------------- }
  2929. {$IFNDEF LinkDynamically}
  2930. function OCICollGetElem(env:POCIEnv; err:POCIError; coll:POCIColl; index:sb4; exists:Pboolean;
  2931. elem:PPdvoid; elemind:PPdvoid):sword;cdecl;external ocilib name 'OCICollGetElem';
  2932. {$ELSE}
  2933. OCICollGetElem : function (env:POCIEnv; err:POCIError; coll:POCIColl; index:sb4; exists:Pboolean;
  2934. elem:PPdvoid; elemind:PPdvoid):sword;cdecl;
  2935. {$ENDIF}
  2936. {
  2937. NAME: OCICollGetElem - OCIColl GET pointer to the element at the given index
  2938. PARAMETERS:
  2939. env (IN/OUT) - OCI environment handle initialized in object mode.
  2940. err (IN/OUT) - error handle. If there is an error, it is
  2941. recorded in 'err' and this function returns OCI_ERROR.
  2942. The error recorded in 'err' can be retrieved by calling
  2943. OCIErrorGet().
  2944. coll (IN) - pointer to the element in this collection is returned
  2945. index (IN) - index of the element whose pointer is returned
  2946. exists (OUT) - set to FALSE if element at the specified index does
  2947. not exist else TRUE
  2948. elem (OUT) - address of the desired element is returned
  2949. elemind (OUT) [optional] - address of the null indicator information
  2950. is returned; if (elemind == NULL) then the null indicator
  2951. information will NOT be returned
  2952. DESCRIPTION:
  2953. Get the address of the element at the given position. Optionally
  2954. this function also returns the address of the element's null indicator
  2955. information.
  2956. The following table describes for each collection element type
  2957. what the corresponding element pointer type is. The element pointer
  2958. is returned via the 'elem' parameter of OCICollGetElem().
  2959. Element Type *elem is set to
  2960. ----------------------- ---------------
  2961. Oracle Number (OCINumber) OCINumber*
  2962. Date (OCIDate) OCIDate*
  2963. Variable-length string (OCIString*) OCIString**
  2964. Variable-length raw (OCIRaw*) OCIRaw**
  2965. object reference (OCIRef*) OCIRef**
  2966. lob locator (OCILobLocator*) OCILobLocator**
  2967. object type (e.g. person) person*
  2968. The element pointer returned by OCICollGetElem() is in a form
  2969. such that it can not only be used to access the
  2970. element data but also is in a form that can be used as the target
  2971. (i.e left-hand-side) of an assignment statement.
  2972. For example, assume the user is iterating over the elements of
  2973. a collection whose element type is object reference (OCIRef*). A call
  2974. to OCICollGetElem() returns pointer to a reference handle
  2975. (i.e. OCIRef**). After getting, the pointer to the collection
  2976. element, the user may wish to modify it by assigning a new reference.
  2977. This can be accomplished via the ref assignment function shown below:
  2978. sword OCIRefAssign( OCIEnv *env, OCIError *err, CONST OCIRef *source,
  2979. OCIRef **target );
  2980. Note that the 'target' parameter of OCIRefAssign() is of type
  2981. 'OCIRef**'. Hence OCICollGetElem() returns 'OCIRef**'.
  2982. If '*target == NULL' a new ref will be allocated by OCIRefAssign()
  2983. and returned via the 'target' parameter.
  2984. Similarly, if the collection element was of type string (OCIString*),
  2985. OCICollGetElem() returns pointer to string handle
  2986. (i.e. OCIString**). If a new string is assigned, via
  2987. OCIStringAssign() or OCIStringAssignText() the type of the target
  2988. must be 'OCIString **'.
  2989. If the collection element is of type Oracle number, OCICollGetElem()
  2990. returns OCINumber*. The prototype of OCINumberAssign() is shown below:
  2991. sword OCINumberAssign(OCIError *err, CONST OCINumber *from,
  2992. OCINumber *to);
  2993. RETURNS:
  2994. OCI_SUCCESS if the function completes successfully.
  2995. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  2996. OCI_ERROR if
  2997. any of the input parameters is null
  2998. }
  2999. {------------------------- OCICollGetElemArray ----------------------------- }
  3000. {$IFNDEF LinkDynamically}
  3001. function OCICollGetElemArray(env:POCIEnv; err:POCIError; coll:POCIColl; index:sb4; exists:Pboolean;
  3002. elem:PPdvoid; elemind:PPdvoid; nelems:Puword):sword;cdecl;external ocilib name 'OCICollGetElemArray';
  3003. {$ELSE}
  3004. OCICollGetElemArray : function (env:POCIEnv; err:POCIError; coll:POCIColl; index:sb4; exists:Pboolean;
  3005. elem:PPdvoid; elemind:PPdvoid; nelems:Puword):sword;cdecl;
  3006. {$ENDIF}
  3007. {
  3008. NAME: OCICollGetElemArray - OCIColl GET pointers to elements from given index
  3009. PARAMETERS:
  3010. env (IN/OUT) - OCI environment handle initialized in object mode.
  3011. err (IN/OUT) - error handle. If there is an error, it is
  3012. recorded in 'err' and this function returns OCI_ERROR.
  3013. The error recorded in 'err' can be retrieved by calling
  3014. OCIErrorGet().
  3015. coll (IN) - pointers to the elements in this collection is returned
  3016. index (IN) - starting index of the element
  3017. exists (OUT) - set to FALSE if element at the specified index does
  3018. not exist else TRUE
  3019. elem (OUT) - address of the desired elements is returned
  3020. elemind (OUT) [optional] - address of the null indicators information
  3021. is returned; if (elemind == NULL) then the null indicator
  3022. information will NOT be returned
  3023. nelems(IN/OUT) - Upper bound of elem and/or elemind array
  3024. DESCRIPTION:
  3025. Get the address of the elements from the given position. Optionally
  3026. this function also returns the address of the element's null indicator
  3027. information.
  3028. The following table describes for each collection element type
  3029. what the corresponding element pointer type is. The element pointer
  3030. is returned via the 'elem' parameter of OCICollGetElem().
  3031. Element Type *elem is set to
  3032. ----------------------- ---------------
  3033. Oracle Number (OCINumber) OCINumber*
  3034. Date (OCIDate) OCIDate*
  3035. Variable-length string (OCIString*) OCIString**
  3036. Variable-length raw (OCIRaw*) OCIRaw**
  3037. object reference (OCIRef*) OCIRef**
  3038. lob locator (OCILobLocator*) OCILobLocator**
  3039. object type (e.g. person) person*
  3040. The element pointer returned by OCICollGetElem() is in a form
  3041. such that it can not only be used to access the
  3042. element data but also is in a form that can be used as the target
  3043. (i.e left-hand-side) of an assignment statement.
  3044. For example, assume the user is iterating over the elements of
  3045. a collection whose element type is object reference (OCIRef*). A call
  3046. to OCICollGetElem() returns pointer to a reference handle
  3047. (i.e. OCIRef**). After getting, the pointer to the collection
  3048. element, the user may wish to modify it by assigning a new reference.
  3049. This can be accomplished via the ref assignment function shown below:
  3050. sword OCIRefAssign( OCIEnv *env, OCIError *err, CONST OCIRef *source,
  3051. OCIRef **target );
  3052. Note that the 'target' parameter of OCIRefAssign() is of type
  3053. 'OCIRef**'. Hence OCICollGetElem() returns 'OCIRef**'.
  3054. If '*target == NULL' a new ref will be allocated by OCIRefAssign()
  3055. and returned via the 'target' parameter.
  3056. Similarly, if the collection element was of type string (OCIString*),
  3057. OCICollGetElem() returns pointer to string handle
  3058. (i.e. OCIString**). If a new string is assigned, via
  3059. OCIStringAssign() or OCIStringAssignText() the type of the target
  3060. must be 'OCIString **'.
  3061. If the collection element is of type Oracle number, OCICollGetElem()
  3062. returns OCINumber*. The prototype of OCINumberAssign() is shown below:
  3063. sword OCINumberAssign(OCIError *err, CONST OCINumber *from,
  3064. OCINumber *to);
  3065. RETURNS:
  3066. OCI_SUCCESS if the function completes successfully.
  3067. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3068. OCI_ERROR if
  3069. any of the input parameters is null
  3070. }
  3071. {----------------------- OCICollAssignElem --------------------------------- }
  3072. {$IFNDEF LinkDynamically}
  3073. function OCICollAssignElem(env:POCIEnv; err:POCIError; index:sb4; elem:Pdvoid; elemind:Pdvoid;
  3074. coll:POCIColl):sword;cdecl;external ocilib name 'OCICollAssignElem';
  3075. {$ELSE}
  3076. OCICollAssignElem : function (env:POCIEnv; err:POCIError; index:sb4; elem:Pdvoid; elemind:Pdvoid;
  3077. coll:POCIColl):sword;cdecl;
  3078. {$ENDIF}
  3079. {
  3080. NAME: OCICollAssignElem - OCIColl ASsign Element
  3081. PARAMETERS:
  3082. env (IN/OUT) - OCI environment handle initialized in object mode.
  3083. err (IN/OUT) - error handle. If there is an error, it is
  3084. recorded in 'err' and this function returns OCI_ERROR.
  3085. The error recorded in 'err' can be retrieved by calling
  3086. OCIErrorGet().
  3087. index (IN) - index of the element whose is assigned to
  3088. elem (IN) - element which is assigned from (source element)
  3089. elemind (IN) [optional] - pointer to the element's null indicator
  3090. information; if (elemind == NULL) then the null indicator
  3091. information of the assigned element will be set to non-null.
  3092. coll (IN/OUT) - collection to be updated
  3093. DESCRIPTION:
  3094. Assign the given element value 'elem' to the element at coll[index].
  3095. If the collection is of type nested table, the element at the given
  3096. index may not exist (i.e. may have been deleted). In this case, the
  3097. given element is inserted at index 'index'.
  3098. Otherwise, the element at index 'index' is updated with the value
  3099. of 'elem'.
  3100. Note that the given element is deep-copied and
  3101. 'elem' is strictly an input parameter.
  3102. RETURNS:
  3103. OCI_SUCCESS if the function completes successfully.
  3104. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3105. OCI_ERROR if
  3106. any of the input parameters is null
  3107. out of memory error
  3108. given index is out of bounds of the given collection
  3109. }
  3110. {--------------------------- OCICollAssign --------------------------------- }
  3111. {$IFNDEF LinkDynamically}
  3112. function OCICollAssign(env:POCIEnv; err:POCIError; rhs:POCIColl; lhs:POCIColl):sword;cdecl;external ocilib name 'OCICollAssign';
  3113. {$ELSE}
  3114. OCICollAssign : function (env:POCIEnv; err:POCIError; rhs:POCIColl; lhs:POCIColl):sword;cdecl;
  3115. {$ENDIF}
  3116. {
  3117. NAME: OCICollAssign - OCIColl ASsiGn collection
  3118. PARAMETERS:
  3119. env (IN/OUT) - OCI environment handle initialized in object mode.
  3120. err (IN/OUT) - error handle. If there is an error, it is
  3121. recorded in 'err' and this function returns OCI_ERROR.
  3122. The error recorded in 'err' can be retrieved by calling
  3123. OCIErrorGet().
  3124. rhs (IN) - collection to be assigned from
  3125. lhs (OUT) - collection to be assigned to
  3126. DESCRIPTION:
  3127. Assign 'rhs' to 'lhs'. The 'lhs' collection may be decreased or
  3128. increased depending upon the size of 'rhs'. If the 'lhs' contains
  3129. any elements then the elements will be deleted prior to the
  3130. assignment. This function performs a deep-copy. The memory for the
  3131. elements comes from the object cache.
  3132. An error is returned if the element types of the lhs and rhs
  3133. collections do not match. Also, an error is returned if the
  3134. upper-bound of the lhs collection is less than the current number of
  3135. elements in the rhs collection.
  3136. RETURNS:
  3137. OCI_SUCCESS if the function completes successfully.
  3138. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3139. OCI_ERROR if
  3140. any of the input parameters is null
  3141. out of memory error
  3142. type mis-match of lhs and rhs collections
  3143. upper-bound of lhs collection is less than the current number of
  3144. elements in the rhs collection
  3145. }
  3146. {--------------------------- OCICollAppend --------------------------------- }
  3147. {$IFNDEF LinkDynamically}
  3148. function OCICollAppend(env:POCIEnv; err:POCIError; elem:Pdvoid; elemind:Pdvoid; coll:POCIColl):sword;cdecl;external ocilib name 'OCICollAppend';
  3149. {$ELSE}
  3150. OCICollAppend : function (env:POCIEnv; err:POCIError; elem:Pdvoid; elemind:Pdvoid; coll:POCIColl):sword;cdecl;
  3151. {$ENDIF}
  3152. {
  3153. NAME: OCICollAppend - OCIColl APPend collection
  3154. PARAMETERS:
  3155. env (IN/OUT) - OCI environment handle initialized in object mode.
  3156. err (IN/OUT) - error handle. If there is an error, it is
  3157. recorded in 'err' and this function returns OCI_ERROR.
  3158. The error recorded in 'err' can be retrieved by calling
  3159. OCIErrorGet().
  3160. elem (IN) - pointer to the element which is appended to the end
  3161. of the given collection
  3162. elemind (IN) [optional] - pointer to the element's null indicator
  3163. information; if (elemind == NULL) then the null indicator
  3164. information of the appended element will be set to non-null.
  3165. coll (IN/OUT) - updated collection
  3166. DESCRIPTION:
  3167. Append the given element to the end of the given collection.
  3168. Appending an element is equivalent to:
  3169. - increasing the size of the collection by 1 element
  3170. - updating (deep-copying) the last element's data with the given
  3171. element's data
  3172. Note that the pointer to the given element 'elem' will not be saved
  3173. by this function. So 'elem' is strictly an input parameter.
  3174. An error is returned if the current size of the collection
  3175. is equal to the max size (upper-bound) of the collection prior to
  3176. appending the element.
  3177. RETURNS:
  3178. OCI_SUCCESS if the function completes successfully.
  3179. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3180. OCI_ERROR if
  3181. any of the input parameters is null
  3182. out of memory error
  3183. current size of collection == max size of the collection
  3184. }
  3185. {----------------------------- OCICollTrim --------------------------------- }
  3186. {$IFNDEF LinkDynamically}
  3187. function OCICollTrim(env:POCIEnv; err:POCIError; trim_num:sb4; coll:POCIColl):sword;cdecl;external ocilib name 'OCICollTrim';
  3188. {$ELSE}
  3189. OCICollTrim : function (env:POCIEnv; err:POCIError; trim_num:sb4; coll:POCIColl):sword;cdecl;
  3190. {$ENDIF}
  3191. {
  3192. NAME: OCICollTrim - OCIColl Trim elements from the end of the collection
  3193. PARAMETERS:
  3194. env (IN/OUT) - OCI environment handle initialized in object mode.
  3195. err (IN/OUT) - error handle. If there is an error, it is
  3196. recorded in 'err' and this function returns OCI_ERROR.
  3197. The error recorded in 'err' can be retrieved by calling
  3198. OCIErrorGet().
  3199. trim_num (IN) - number of elements to trim
  3200. coll (IN/OUT) - 'trim_num' of elements are removed (freed) from the
  3201. end of the collection
  3202. DESCRIPTION:
  3203. Trim the collection by the given number of elements. The elements are
  3204. removed from the end of the collection.
  3205. An error is returned if the 'trim_num' is greater than the current
  3206. size of the collection.
  3207. RETURNS:
  3208. OCI_SUCCESS if the function completes successfully.
  3209. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3210. OCI_ERROR if
  3211. any of the input parameters is null
  3212. 'trim_num' is greater than the current size of the collection.
  3213. }
  3214. {--------------------------- OCICollIsLocator ------------------------------ }
  3215. {$IFNDEF LinkDynamically}
  3216. function OCICollIsLocator(env:POCIEnv; err:POCIError; coll:POCIColl; result:Pboolean):sword;cdecl;external ocilib name 'OCICollIsLocator';
  3217. {$ELSE}
  3218. OCICollIsLocator : function (env:POCIEnv; err:POCIError; coll:POCIColl; result:Pboolean):sword;cdecl;
  3219. {$ENDIF}
  3220. {
  3221. Name: OCICollIsLocator - OCIColl indicates whether a collection is locator
  3222. based or not.
  3223. Parameters:
  3224. env(IN) - pointer to OCI environment handle
  3225. err (IN/OUT) - error handle. If there is an error, it is
  3226. recorded in 'err' and this function returns OCI_ERROR.
  3227. The error recorded in 'err' can be retrieved by calling
  3228. OCIErrorGet().
  3229. coll (IN) - collection item.
  3230. result (OUT) - TRUE if the collection item is a locator, FALSE
  3231. otherwise
  3232. Description:
  3233. Returns TRUE in the result OUT parameter if the collection item is a
  3234. locator, otherwise returns FALSE.
  3235. Returns:
  3236. OCI_SUCCESS if the function completes successfully.
  3237. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3238. }
  3239. {---------------------------- OCIIterCreate -------------------------------- }
  3240. {$IFNDEF LinkDynamically}
  3241. function OCIIterCreate(env:POCIEnv; err:POCIError; coll:POCIColl; var itr:POCIIter):sword;cdecl;external ocilib name 'OCIIterCreate';
  3242. {$ELSE}
  3243. OCIIterCreate : function (env:POCIEnv; err:POCIError; coll:POCIColl; var itr:POCIIter):sword;cdecl;
  3244. {$ENDIF}
  3245. {
  3246. NAME: OCIIterCreate - OCIColl Create an ITerator to scan the collection
  3247. elements
  3248. PARAMETERS:
  3249. env (IN/OUT) - OCI environment handle initialized in object mode.
  3250. err (IN/OUT) - error handle. If there is an error, it is
  3251. recorded in 'err' and this function returns OCI_ERROR.
  3252. The error recorded in 'err' can be retrieved by calling
  3253. OCIErrorGet().
  3254. coll (IN) - collection which will be scanned; the different
  3255. collection types are varray and nested table
  3256. itr (OUT) - address to the allocated collection iterator is
  3257. returned by this function
  3258. DESCRIPTION:
  3259. Create an iterator to scan the elements of the collection. The
  3260. iterator is created in the object cache. The iterator is initialized
  3261. to point to the beginning of the collection.
  3262. If the next function (OCIIterNext) is called immediately
  3263. after creating the iterator then the first element of the collection
  3264. is returned.
  3265. If the previous function (OCIIterPrev) is called immediately after
  3266. creating the iterator then "at beginning of collection" error is
  3267. returned.
  3268. RETURNS:
  3269. OCI_SUCCESS if the function completes successfully.
  3270. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3271. OCI_ERROR if
  3272. any of the input parameters is null
  3273. out of memory error
  3274. }
  3275. {----------------------------- OCIIterDelete ------------------------------ }
  3276. {$IFNDEF LinkDynamically}
  3277. function OCIIterDelete(env:POCIEnv; err:POCIError; var itr:POCIIter):sword;cdecl;external ocilib name 'OCIIterDelete';
  3278. {$ELSE}
  3279. OCIIterDelete : function (env:POCIEnv; err:POCIError; var itr:POCIIter):sword;cdecl;
  3280. {$ENDIF}
  3281. {
  3282. NAME: OCIIterDelete - OCIColl Delete ITerator
  3283. PARAMETERS:
  3284. env (IN/OUT) - OCI environment handle initialized in object mode.
  3285. err (IN/OUT) - error handle. If there is an error, it is
  3286. recorded in 'err' and this function returns OCI_ERROR.
  3287. The error recorded in 'err' can be retrieved by calling
  3288. OCIErrorGet().
  3289. itr (IN/OUT) - the allocated collection iterator is destroyed and
  3290. the 'itr' is set to NULL prior to returning
  3291. DESCRIPTION:
  3292. Delete the iterator which was previously created by a call to
  3293. OCIIterCreate.
  3294. RETURNS:
  3295. OCI_SUCCESS if the function completes successfully.
  3296. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3297. OCI_ERROR if
  3298. any of the input parameters is null
  3299. to be discovered
  3300. }
  3301. {----------------------------- OCIIterInit --------------------------------- }
  3302. {$IFNDEF LinkDynamically}
  3303. function OCIIterInit(env:POCIEnv; err:POCIError; coll:POCIColl; itr:POCIIter):sword;cdecl;external ocilib name 'OCIIterInit';
  3304. {$ELSE}
  3305. OCIIterInit : function (env:POCIEnv; err:POCIError; coll:POCIColl; itr:POCIIter):sword;cdecl;
  3306. {$ENDIF}
  3307. {
  3308. NAME: OCIIterInit - OCIColl Initialize ITerator to scan the given
  3309. collection
  3310. PARAMETERS:
  3311. env (IN/OUT) - OCI environment handle initialized in object mode.
  3312. err (IN/OUT) - error handle. If there is an error, it is
  3313. recorded in 'err' and this function returns OCI_ERROR.
  3314. The error recorded in 'err' can be retrieved by calling
  3315. OCIErrorGet().
  3316. coll (IN) - collection which will be scanned; the different
  3317. collection types are varray and nested table
  3318. itr (IN/OUT) - pointer to an allocated collection iterator
  3319. DESCRIPTION:
  3320. Initializes the given iterator to point to the beginning of the
  3321. given collection. This function can be used to:
  3322. a. reset an iterator to point back to the beginning of the collection
  3323. b. reuse an allocated iterator to scan a different collection
  3324. RETURNS:
  3325. OCI_SUCCESS if the function completes successfully.
  3326. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3327. OCI_ERROR if
  3328. any of the input parameters is null
  3329. }
  3330. {------------------------ OCIIterGetCurrent -------------------------------- }
  3331. {$IFNDEF LinkDynamically}
  3332. function OCIIterGetCurrent(env:POCIEnv; err:POCIError; itr:POCIIter; elem:PPdvoid; elemind:PPdvoid):sword;cdecl;external ocilib name 'OCIIterGetCurrent';
  3333. {$ELSE}
  3334. OCIIterGetCurrent : function (env:POCIEnv; err:POCIError; itr:POCIIter; elem:PPdvoid; elemind:PPdvoid):sword;cdecl;
  3335. {$ENDIF}
  3336. {
  3337. NAME: OCIIterGetCurrent - OCIColl Iterator based, get CURrent collection
  3338. element
  3339. PARAMETERS:
  3340. env (IN/OUT) - OCI environment handle initialized in object mode.
  3341. err (IN/OUT) - error handle. If there is an error, it is
  3342. recorded in 'err' and this function returns OCI_ERROR.
  3343. The error recorded in 'err' can be retrieved by calling
  3344. OCIErrorGet().
  3345. itr (IN) - iterator which points to the current element
  3346. elem (OUT) - address of the element pointed by the iterator is returned
  3347. elemind (OUT) [optional] - address of the element's null indicator
  3348. information is returned; if (elemind == NULL) then the null
  3349. indicator information will NOT be returned
  3350. DESCRIPTION:
  3351. Returns pointer to the current element and its corresponding null
  3352. information.
  3353. RETURNS:
  3354. OCI_SUCCESS if the function completes successfully.
  3355. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3356. OCI_ERROR if
  3357. any of the input parameters is null
  3358. }
  3359. {------------------------------ OCIIterNext -------------------------------- }
  3360. {$IFNDEF LinkDynamically}
  3361. function OCIIterNext(env:POCIEnv; err:POCIError; itr:POCIIter; elem:PPdvoid; elemind:PPdvoid;
  3362. eoc:Pboolean):sword;cdecl;external ocilib name 'OCIIterNext';
  3363. {$ELSE}
  3364. OCIIterNext : function (env:POCIEnv; err:POCIError; itr:POCIIter; elem:PPdvoid; elemind:PPdvoid;
  3365. eoc:Pboolean):sword;cdecl;
  3366. {$ENDIF}
  3367. {
  3368. NAME: OCIIterNext - OCIColl Iterator based, get NeXT collection element
  3369. PARAMETERS:
  3370. env (IN/OUT) - OCI environment handle initialized in object mode.
  3371. err (IN/OUT) - error handle. If there is an error, it is
  3372. recorded in 'err' and this function returns OCI_ERROR.
  3373. The error recorded in 'err' can be retrieved by calling
  3374. OCIErrorGet().
  3375. itr (IN/OUT) - iterator is updated to point to the next element
  3376. elem (OUT) - after updating the iterator to point to the next element,
  3377. address of the element is returned
  3378. elemind (OUT) [optional] - address of the element's null indicator
  3379. information is returned; if (elemind == NULL) then the null
  3380. indicator information will NOT be returned
  3381. eoc (OUT) - TRUE if iterator is at End Of Collection (i.e. next
  3382. element does not exist) else FALSE
  3383. DESCRIPTION:
  3384. Returns pointer to the next element and its corresponding null
  3385. information. The iterator is updated to point to the next element.
  3386. If the iterator is pointing to the last element of the collection
  3387. prior to executing this function, then calling this function will
  3388. set eoc flag to TRUE. The iterator will be left unchanged in this
  3389. situation.
  3390. RETURNS:
  3391. OCI_SUCCESS if the function completes successfully.
  3392. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3393. OCI_ERROR if
  3394. any of the input parameters is null
  3395. }
  3396. {------------------------------ OCIIterPrev -------------------------------- }
  3397. {$IFNDEF LinkDynamically}
  3398. function OCIIterPrev(env:POCIEnv; err:POCIError; itr:POCIIter; elem:PPdvoid; elemind:PPdvoid;
  3399. boc:Pboolean):sword;cdecl;external ocilib name 'OCIIterPrev';
  3400. {$ELSE}
  3401. OCIIterPrev : function (env:POCIEnv; err:POCIError; itr:POCIIter; elem:PPdvoid; elemind:PPdvoid;
  3402. boc:Pboolean):sword;cdecl;
  3403. {$ENDIF}
  3404. {
  3405. NAME: OCIIterPrev - OCIColl Iterator based, get PReVious collection element
  3406. PARAMETERS:
  3407. env (IN/OUT) - OCI environment handle initialized in object mode.
  3408. err (IN/OUT) - error handle. If there is an error, it is
  3409. recorded in 'err' and this function returns OCI_ERROR.
  3410. The error recorded in 'err' can be retrieved by calling
  3411. OCIErrorGet().
  3412. itr (IN/OUT) - iterator is updated to point to the previous
  3413. element
  3414. elem (OUT) - after updating the iterator to point to the previous
  3415. element, address of the element is returned
  3416. elemind (OUT) [optional] - address of the element's null indicator
  3417. information is returned; if (elemind == NULL) then the null
  3418. indicator information will NOT be returned
  3419. boc (OUT) - TRUE if iterator is at Beginning Of Collection (i.e.
  3420. previous element does not exist) else FALSE.
  3421. DESCRIPTION:
  3422. Returns pointer to the previous element and its corresponding null
  3423. information. The iterator is updated to point to the previous element.
  3424. If the iterator is pointing to the first element of the collection
  3425. prior to executing this function, then calling this function will
  3426. set 'boc' to TRUE. The iterator will be left unchanged in this
  3427. situation.
  3428. RETURNS:
  3429. OCI_SUCCESS if the function completes successfully.
  3430. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3431. OCI_ERROR if
  3432. any of the input parameters is null
  3433. }
  3434. {*************************************************************************** }
  3435. { FUNCTIONS WHICH OPERATE ONLY ON NESTED TABLE OCITable*() }
  3436. {*************************************************************************** }
  3437. {---------------------------- OCITableSize --------------------------------- }
  3438. {$IFNDEF LinkDynamically}
  3439. function OCITableSize(env:POCIEnv; err:POCIError; tbl:POCITable; size:Psb4):sword;cdecl;external ocilib name 'OCITableSize';
  3440. {$ELSE}
  3441. OCITableSize : function (env:POCIEnv; err:POCIError; tbl:POCITable; size:Psb4):sword;cdecl;
  3442. {$ENDIF}
  3443. {
  3444. NAME: OCITableSize - OCITable return current SIZe of the given
  3445. nested table (not including deleted elements)
  3446. PARAMETERS:
  3447. env(IN) - pointer to OCI environment handle
  3448. err (IN/OUT) - error handle. If there is an error, it is
  3449. recorded in 'err' and this function returns OCI_ERROR.
  3450. The error recorded in 'err' can be retrieved by calling
  3451. OCIErrorGet().
  3452. tbl (IN) - nested table whose number of elements is returned
  3453. size (OUT) - current number of elements in the nested table. The count
  3454. does not include deleted elements.
  3455. DESCRIPTION:
  3456. Returns the count of elements in the given nested table.
  3457. The count returned by OCITableSize() will be decremented upon
  3458. deleting elements from the nested table. So, this count DOES NOT
  3459. includes any "holes" created by deleting elements.
  3460. For example:
  3461. OCITableSize(...);
  3462. // assume 'size' returned is equal to 5
  3463. OCITableDelete(...); // delete one element
  3464. OCITableSize(...);
  3465. // 'size' returned will be equal to 4
  3466. To get the count plus the count of deleted elements use
  3467. OCICollSize(). Continuing the above example,
  3468. OCICollSize(...)
  3469. // 'size' returned will still be equal to 5
  3470. RETURNS:
  3471. OCI_SUCCESS if the function completes successfully.
  3472. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3473. OCI_ERROR if
  3474. error during loading of nested table into object cache
  3475. any of the input parameters is null
  3476. }
  3477. {---------------------- OCITableExists --------------------------------- }
  3478. {$IFNDEF LinkDynamically}
  3479. function OCITableExists(env:POCIEnv; err:POCIError; tbl:POCITable; index:sb4; exists:Pboolean):sword;cdecl;external ocilib name 'OCITableExists';
  3480. {$ELSE}
  3481. OCITableExists : function (env:POCIEnv; err:POCIError; tbl:POCITable; index:sb4; exists:Pboolean):sword;cdecl;
  3482. {$ENDIF}
  3483. {
  3484. NAME: OCITableExists - OCITable test whether element at the given index
  3485. EXIsts
  3486. PARAMETERS:
  3487. env (IN/OUT) - OCI environment handle initialized in object mode.
  3488. err (IN/OUT) - error handle. If there is an error, it is
  3489. recorded in 'err' and this function returns OCI_ERROR.
  3490. The error recorded in 'err' can be retrieved by calling
  3491. OCIErrorGet().
  3492. tbl (IN) - table in which the given index is checked
  3493. index (IN) - index of the element which is checked for existence
  3494. exists (OUT) - set to TRUE if element at given 'index' exists
  3495. else set to FALSE
  3496. DESCRIPTION:
  3497. Test whether an element exists at the given 'index'.
  3498. RETURNS:
  3499. OCI_SUCCESS if the function completes successfully.
  3500. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3501. OCI_ERROR if
  3502. any of the input parameters is null
  3503. }
  3504. {--------------------------- OCITableDelete ------------------------------- }
  3505. {$IFNDEF LinkDynamically}
  3506. function OCITableDelete(env:POCIEnv; err:POCIError; index:sb4; tbl:POCITable):sword;cdecl;external ocilib name 'OCITableDelete';
  3507. {$ELSE}
  3508. OCITableDelete : function (env:POCIEnv; err:POCIError; index:sb4; tbl:POCITable):sword;cdecl;
  3509. {$ENDIF}
  3510. {
  3511. NAME: OCITableDelete - OCITable DELete element at the specified index
  3512. PARAMETERS:
  3513. env (IN/OUT) - OCI environment handle initialized in object mode.
  3514. err (IN/OUT) - error handle. If there is an error, it is
  3515. recorded in 'err' and this function returns OCI_ERROR.
  3516. The error recorded in 'err' can be retrieved by calling
  3517. OCIErrorGet().
  3518. index (IN) - index of the element which must be deleted
  3519. tbl (IN) - table whose element is deleted
  3520. DESCRIPTION:
  3521. Delete the element at the given 'index'. Note that the position
  3522. ordinals of the remaining elements of the table is not changed by the
  3523. delete operation. So delete creates "holes" in the table.
  3524. An error is returned if the element at the specified 'index' has
  3525. been previously deleted.
  3526. RETURNS:
  3527. OCI_SUCCESS if the function completes successfully.
  3528. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3529. OCI_ERROR if
  3530. any of the input parameters is null
  3531. given index is not valid
  3532. }
  3533. {--------------------------- OCITableFirst --------------------------------- }
  3534. {$IFNDEF LinkDynamically}
  3535. function OCITableFirst(env:POCIEnv; err:POCIError; tbl:POCITable; index:Psb4):sword;cdecl;external ocilib name 'OCITableFirst';
  3536. {$ELSE}
  3537. OCITableFirst : function (env:POCIEnv; err:POCIError; tbl:POCITable; index:Psb4):sword;cdecl;
  3538. {$ENDIF}
  3539. {
  3540. NAME: OCITableFirst - OCITable return FirST index of table
  3541. PARAMETERS:
  3542. env (IN/OUT) - OCI environment handle initialized in object mode.
  3543. err (IN/OUT) - error handle. If there is an error, it is
  3544. recorded in 'err' and this function returns OCI_ERROR.
  3545. The error recorded in 'err' can be retrieved by calling
  3546. OCIErrorGet().
  3547. tbl (IN) - table which is scanned
  3548. index (OUT) - first index of the element which exists in the given
  3549. table is returned
  3550. DESCRIPTION:
  3551. Return the first index of the element which exists in the given
  3552. table.
  3553. RETURNS:
  3554. OCI_SUCCESS if the function completes successfully.
  3555. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3556. OCI_ERROR if
  3557. table is empty
  3558. }
  3559. {---------------------------- OCITableLast --------------------------------- }
  3560. {$IFNDEF LinkDynamically}
  3561. function OCITableLast(env:POCIEnv; err:POCIError; tbl:POCITable; index:Psb4):sword;cdecl;external ocilib name 'OCITableLast';
  3562. {$ELSE}
  3563. OCITableLast : function (env:POCIEnv; err:POCIError; tbl:POCITable; index:Psb4):sword;cdecl;
  3564. {$ENDIF}
  3565. {
  3566. NAME: OCITableFirst - OCITable return LaST index of table
  3567. PARAMETERS:
  3568. env (IN/OUT) - OCI environment handle initialized in object mode.
  3569. err (IN/OUT) - error handle. If there is an error, it is
  3570. recorded in 'err' and this function returns OCI_ERROR.
  3571. The error recorded in 'err' can be retrieved by calling
  3572. OCIErrorGet().
  3573. tbl (IN) - table which is scanned
  3574. index (OUT) - last index of the element which exists in the given
  3575. table is returned
  3576. DESCRIPTION:
  3577. Return the last index of the element which exists in the given
  3578. table.
  3579. RETURNS:
  3580. OCI_SUCCESS if the function completes successfully.
  3581. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3582. OCI_ERROR if
  3583. table is empty
  3584. }
  3585. {---------------------------- OCITableNext --------------------------------- }
  3586. {$IFNDEF LinkDynamically}
  3587. function OCITableNext(env:POCIEnv; err:POCIError; index:sb4; tbl:POCITable; next_index:Psb4;
  3588. exists:Pboolean):sword;cdecl;external ocilib name 'OCITableNext';
  3589. {$ELSE}
  3590. OCITableNext : function (env:POCIEnv; err:POCIError; index:sb4; tbl:POCITable; next_index:Psb4;
  3591. exists:Pboolean):sword;cdecl;
  3592. {$ENDIF}
  3593. {
  3594. NAME: OCITableNext - OCITable return NeXT available index of table
  3595. PARAMETERS:
  3596. env (IN/OUT) - OCI environment handle initialized in object mode.
  3597. err (IN/OUT) - error handle. If there is an error, it is
  3598. recorded in 'err' and this function returns OCI_ERROR.
  3599. The error recorded in 'err' can be retrieved by calling
  3600. OCIErrorGet().
  3601. index (IN) - starting at 'index' the index of the next element
  3602. which exists is returned
  3603. tbl (IN) - table which is scanned
  3604. next_index (OUT) - index of the next element which exists
  3605. is returned
  3606. exists (OUT) - FALSE if no next index available else TRUE
  3607. DESCRIPTION:
  3608. Return the smallest position j, greater than 'index', such that
  3609. exists(j) is TRUE.
  3610. RETURNS:
  3611. OCI_SUCCESS if the function completes successfully.
  3612. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3613. OCI_ERROR if
  3614. no next index available
  3615. }
  3616. {---------------------------- OCITablePrev --------------------------------- }
  3617. {$IFNDEF LinkDynamically}
  3618. function OCITablePrev(env:POCIEnv; err:POCIError; index:sb4; tbl:POCITable; prev_index:Psb4;
  3619. exists:Pboolean):sword;cdecl;external ocilib name 'OCITablePrev';
  3620. {$ELSE}
  3621. OCITablePrev : function (env:POCIEnv; err:POCIError; index:sb4; tbl:POCITable; prev_index:Psb4;
  3622. exists:Pboolean):sword;cdecl;
  3623. {$ENDIF}
  3624. {
  3625. NAME: OCITablePrev - OCITable return PReVious available index of table
  3626. PARAMETERS:
  3627. env (IN/OUT) - OCI environment handle initialized in object mode.
  3628. err (IN/OUT) - error handle. If there is an error, it is
  3629. recorded in 'err' and this function returns OCI_ERROR.
  3630. The error recorded in 'err' can be retrieved by calling
  3631. OCIErrorGet().
  3632. index (IN) - starting at 'index' the index of the previous element
  3633. which exists is returned
  3634. tbl (IN) - table which is scanned
  3635. prev_index (OUT) - index of the previous element which exists
  3636. is returned
  3637. exists (OUT) - FALSE if no next index available else TRUE
  3638. DESCRIPTION:
  3639. Return the largest position j, less than 'index', such that
  3640. exists(j) is TRUE.
  3641. RETURNS:
  3642. OCI_SUCCESS if the function completes successfully.
  3643. OCI_INVALID_HANDLE if 'env' or 'err' is NULL.
  3644. OCI_ERROR if
  3645. no previous index available
  3646. }
  3647. {------------------------ OCINumberToLnx ----------------------------------- }
  3648. { void OCINumberToLnx(/o_ OCINumber *num _o/); }
  3649. { was #define dname(params) para_def_expr }
  3650. { argument types are unknown }
  3651. // function OCINumberToLnx(num : longint) : Plnxnum_t;
  3652. {
  3653. NAME: OCINumberToLnx
  3654. PARAMETERS:
  3655. num (IN) - OCINumber to convert ;
  3656. DESCRIPTION:
  3657. Converts OCINumber to its internal lnx format
  3658. This is not to be used in Public interfaces , but
  3659. has been provided due to special requirements from
  3660. SQLPLUS development group as they require to call
  3661. Core funtions directly .
  3662. }
  3663. type
  3664. { OCI representation of XMLType }
  3665. POCIXMLType = pointer;
  3666. { OCI representation of OCIDomDocument }
  3667. POCIDOMDocument = pointer;
  3668. {implementation
  3669. function OCINumberToLnx(num : longint) : Plnxnum_t;
  3670. begin
  3671. OCINumberToLnx:=Plnxnum_t(num);
  3672. end;
  3673. end.}