blob: 9562f2eea24e7011a5deac19101e695eea11d5da [file] [log] [blame]
Tang Cheng31b95252014-10-23 09:22:35 +08001/* @(#)ort.h 1.44 95/07/07 */
2
3/* Copyright (c) 1994, 2005, Oracle. All rights reserved. */
4
5/*
6 NAME
7
8 ORT - ORacle's external open Type interface to the open type manager (OTM)
9
10 DESCRIPTION
11
12 The open type manager interface includes dynamic type operations to
13 create, delete, update, and access types. See the "Functional
14 Specification for Oracle Object Call Interface (Objects Project),
15 Version 1.0" for a user level description of the OTM. For a more
16 detailed description, see the "Component Document for the Open Type
17 Manager, Version 1.0".
18
19 NOTE: MOST Of the functions in this header file are being desupported.
20 Please use the OCIDescribeAny interface as described in oci.h
21 instead.
22 The OCIType, OCITypeElem, OCITypeMethod abstract types continue
23 to be supported. The only two functions that remain to be documented
24 are OCITypeArrayByName and OCITypeArrayByRef.
25 All obsolete types/functions are marked accordingly below.
26
27 RELATED DOCUMENTS
28
29 For the functional specification for the OTM, see:
30 [1] Kotsovolos, Susan, "Functional Specification for Oracle Object
31 Call Interface (Objects Project), Version 1.0", Oracle
32 Corporation, February 1995.
33 For the internal design of the OTM, see the following:
34 [2] Kotsovolos, Susan, "Component Document for the Open Type Manager",
35 Oracle Corporation, November 1994.
36 [3] Kotsovolos, Susan, "Design for The Open Type Manager, Oracle
37 Object Management Subsystem Version 1.0", Oracle Corporation,
38 March 1994.
39 [4] Kotsovolos, Susan and Tin A. Nguyen, "The Open Type Manager",
40 Oracle Corporation, March 1994.
41 [5] Kotsovolos, Susan and Tin A. Nguyen, "Schema Evolution",
42 Oracle Corporation, March 1994.
43 For a description of the types the OTM must support, see:
44 [6] Nguyen, Tin A., "The Open Type System", Oracle Corporation,
45 February 1994.
46
47 INSPECTION STATUS
48
49 Inspection date:
50 Inspection status:
51 Estimated increasing cost defects per page:
52 Rule sets:
53
54 ACCEPTANCE REVIEW STATUS
55
56 Review date:
57 Review status:
58 Reviewers:
59
60
61 **** ALL OBSOLETE FUNCTIONS/TYPES ARE MARKED ACCORDINGLY ***
62
63 EXPORT FUNCTIONS
64
65 None
66
67 PUBLIC DATA STRUCTURES
68
69 OCIType - type descriptor in the object cache
70 OCITypeElem - type element descriptor in the object cache
71 (used for attributes and paramters)
72 OCITypeCode - Open Type System type code.
73 OCITypeMethod - method descriptor in the object cache
74 OCITypeParamMode - parameter modes (ie. IN, IN-OUT etc)
75
76 PUBLIC FUNCTIONS
77
78 ITERATOR (for OCITypeAttrNext and OCITypeMethodNext)
79
80 OCITypeIterNew - ** OBSOLETE ** Create new instance of an iteraton.
81 OCITypeIterSet - ** OBSOLETE ** Initialize iterator.
82 OCITypeIterFree - ** OBSOLETE ** Free instance of iterator.
83
84 TYPE GET
85
86 OCITypeByName - ** OBSOLETE ** Get a type by name.
87 OCITypeArrayByName - Get an array of types by their names.
88 OCITypeByRef - ** OBSOLETE ** Get a type by its CREF.
89 OCITypeArrayByRef - Get an array of types by their CREFs.
90
91 TYPE ACCESSORS
92
93 OCITypeName - ** OBSOLETE ** OCI Get a type's name.
94 OCITypeSchema - ** OBSOLETE ** OCI Get a type's schema name.
95 OCITypeTypeCode - ** OBSOLETE ** OCI Get a type's type code.
96 OCITypeVersion - ** OBSOLETE ** OCI Get a Type's user-readable Version.
97 OCITypeAttrs - ** OBSOLETE ** OCI Get a Type's Number of Attributes.
98 OCITypeMethods - ** OBSOLETE ** OCI Get a Type's Number of Methods.
99
100 TYPE ELEMENT ACCESSORS (they represent attributes/parameters/results)
101
102 OCITypeElemName - ** OBSOLETE ** Get a type element's (only for
103 attributes) name.
104 OCITypeElemType - ** OBSOLETE ** Get a type element's type
105 descriptor.
106 OCITypeElemTypeCode - ** OBSOLETE ** Get a type element's typecode.
107 OCITypeElemParameterizedType - ** OBSOLETE ** Get a type element's
108 parameterized type's type descriptor.
109 OCITypeElemNumPrec - ** OBSOLETE ** Get a number's precision.
110 OCITypeElemNumScale - ** OBSOLETE ** Get a decimal or oracle Number's
111 Scale
112 OCITypeElemCharSetID - ** OBSOLETE ** Get a fixed or variable length
113 string's character set ID.
114 OCITypeElemCharSetForm - ** OBSOLETE ** Get a fixed or variable length
115 string's character set form (how
116 character set information has
117 been specified).
118 OCITypeElemLength - ** OBSOLETE ** Get a raw, fixed or variable
119 length string's length.
120 OCITypeElemParamMode - ** OBSOLETE ** Get element's parameter's mode
121 (only valid for parameter).
122 OCITypeElemDefaultValue - ** OBSOLETE ** Get element's Default Value.
123
124 ATTRIBUTE ACCESSORS
125
126 OCITypeAttrByName - ** OBSOLETE ** Get an Attribute by Name.
127 OCITypeAttrNext - ** OBSOLETE ** Get an Attribute by Iteration.
128
129 COLLECTION ACCESSORS
130
131 OCITypeCollTypeCode - ** OBSOLETE ** Get a named collection's typecode.
132 OCITypeCollElem - ** OBSOLETE ** Get a named collection's element's
133 type element information.
134 OCITypeCollSize - ** OBSOLETE ** Get a named collection's size in
135 number of elements.
136
137 METHOD ACCESSORS
138
139 OCITypeMethodOverload - ** OBSOLETE ** Get number of overloaded methods
140 with the given method name.
141 (no direct equivalent for
142 OCIDescribe interface)
143 OCITypeMethodByName - ** OBSOLETE ** Get one or more methods by name.
144 OCITypeMethodNext - ** OBSOLETE ** Iterate to the next method to
145 retrieve.
146 OCITypeMethodName - ** OBSOLETE ** Get method's name.
147 OCITypeMethodEncap - ** OBSOLETE ** Get method's encapsulation level.
148 OCITypeMethodFlags - ** OBSOLETE ** et method's flags.
149 OCITypeMethodMap - ** OBSOLETE ** Get type's map function.
150 OCITypeMethodOrder - ** OBSOLETE ** Get type's order function.
151 OCITypeMethodParams - ** OBSOLETE ** Get a method's number of
152 parameters.
153
154 RESULT ACCESSORS
155
156 OCITypeResult - ** OBSOLETE ** OCI Get a method's Result.
157
158 See also ATTRIBUTE/PARAMETER/RESULT TYPE ACCESSORS.
159
160 PARAMETER ACCESSORS
161
162 OCITypeParamByPos - ** OBSOLETE ** Get a Parameter in a method By
163 Position.
164 OCITypeParamByName - ** OBSOLETE ** Get a Parameter in a method By Name.
165 OCITypeParamPos - ** OBSOLETE ** Get a Parameter's PoSition in a
166 method.
167
168 CALL GRAPHS:
169
170 Only type accessors are supported for 8.0.
171 ** OBSOLETE ** please use OCIDescribe interface
172
173 TYPE ACCESSOR EXAMPLE
174
175 CREATE TYPE CAR
176 (
177 name vstring,
178 age number,
179 number car_age; /o Oracle number o/
180 weight car_weight; /o abstract type o/
181
182 PUBLIC:
183
184 /o methods o/
185 car(orlvs a_name, number an_age, WEIGHT a_weight);
186 ~car();
187 inline number get_age() const;
188
189 /o relative ordering (map) functions o/
190 number car_map
191 );
192
193 /o the following code accesses the type created above o/
194
195 ub1 meth_flags;
196 ub4 i, j;
197 ub4 text_len, position;
198 ub4 count;
199 ub4 length;
200 OCITypeCode typecode;
201 OCIRef *attr_ref;
202 OCIRef *param_ref;
203 OCIType *tdo, new_tdo, final_tdo;
204 OCITypeElem *elem;
205 OCITypeIter *iterator_ort;
206 oratext (*names)[];
207 ub4 lengths[];
208 ub4 *positions;
209 oratext *name;
210 oratext name_buffer[M_IDEN];
211
212 /o initialize the references o/
213 DISCARD orlrini(env, err, (dvoid *)&attr_ref);
214 DISCARD orlrini(env, err, (dvoid *)&param_ref);
215
216 /o ----------------- GET INFORMATION ABOUT A TYPE ----------------- o/
217
218 /o start a transaction o/
219
220 /o Pin the type until the end of the transaction. Pinning the type is
221 o required before using any type accessors.
222 o/
223 if (OCITypeByName(env, err, svc, (oratext *)0, 0, "CAR", strlen("CAR"),
224 OCI_DURATION_TRANS, &car_ref, &car_tdo) != OCI_SUCCESS)
225 /o error o/ ;
226
227 /o get the type's name o/
228 if (!memcmp(OCITypeName(env, err, car_tdo, &text_len), "person",
229 text_len))
230 /o do something o/ ;
231
232 /o get the type's schema name o/
233 if (!memcmp(OCITypeSchema(env, err, car_tdo, &text_len), "john",
234 text_len))
235 /o do something o/ ;
236
237 /o get the type code of the type o/
238 if (OCITypeTypeCode(env, err, car_tdo) == OCI_TYPECODE_ADT)
239 /o do something o/ ;
240
241 /o get the type version o/
242 if (!memcmp(OCITypeVersion(env, err, car_tdo, &text_len), "1", text_len))
243 /o do something o/ ;
244
245 /o ------- GET FLATTENED POSITION OF AN ATTRIBUTES IN A TYPE ------- o/
246
247 names = malloc(sizeof(oratext *) * 2);
248 names[0] = malloc(strlen("car_weight"));
249 names[1] = malloc(strlen("ounces"));
250 memcpy(names[0], "car_weight", strlen("car_weight"));
251 memcpy(names[1], "ounces", strlen("ounces"));
252
253 lengths = malloc(sizeof(ub4) * 2);
254 lengths[0] = strlen("car_weight");
255 lengths[1] = strlen("ounces");
256
257 /o ---------- GET IMMEDIATE ATTRIBUTES IN A TYPE ---------- o/
258
259 /o loop through all attributes in the type with iterator o/
260 if (OCITypeIterNew(env, err, car_tdo, &iterator_ort) != OCI_SUCCESS)
261 /o do something o/
262
263 while (OCITypeAttrNext(env, err, iterator_ort, &ado) != OCI_NO_DATA)
264 {
265 /o get the attribute's name o/
266 if (!memcmp(OCITypeElemName(env, err, ado, &text_len),
267 "tiger", text_len))
268 /o do something o/ ;
269
270 /o get the attribute's type descriptor o/
271 if (OCITypeElemType(env, err, ado, &tdo) != OCI_SUCCESS)
272 /o error o/ ;
273
274 /o get the attribute's type code o/
275 typecode = OCITypeElemTypeCode(env, err, ado);
276
277 switch (typecode)
278 {
279 /o scalar types o/
280 case OCI_TYPECODE_DATE: /o date o/
281 case OCI_TYPECODE_SIGNED8: /o byte o/
282 case OCI_TYPECODE_SIGNED16: /o short o/
283 case OCI_TYPECODE_UNSIGNED8: /o unsigned byte o/
284 case OCI_TYPECODE_UNSIGNED16: /o unsigned short o/
285 case OCI_TYPECODE_OCTET: /o octet o/
286 case OCI_TYPECODE_TABLE: /o nested table o/
287 case OCI_TYPECODE_CLOB: /o character lob o/
288 case OCI_TYPECODE_BLOB: /o binary lob o/
289 case OCI_TYPECODE_CFILE: /o character file object o/
290 case OCI_TYPECODE_BFILE: /o binary file object o/
291
292 /o do something o/
293 break;
294
295 /o number types o/
296 case OCI_TYPECODE_NUMBER: /o oracle number o/
297 case OCI_TYPECODE_DECIMAL: /o decimal o/
298 {
299 /o get the scale of the number o/
300 if (OCITypeElemNumScale(env, err, ado) == 3)
301 /o do something o/ ;
302 }
303 /o fall through to get the precision o/
304
305 case OCI_TYPECODE_FLOAT: /o float o/
306 case OCI_TYPECODE_SIGNED32: /o long o/
307 case OCI_TYPECODE_UNSIGNED32: /o unsigned long o/
308 case OCI_TYPECODE_REAL: /o real o/
309 case OCI_TYPECODE_DOUBLE: /o double o/
310 {
311 /o get the precision of the number o/
312 if (OCITypeElemNumPrec(env, err, ado) == 2)
313 /o do something o/ ;
314 }
315 break;
316
317 /o string types o/
318 case OCI_TYPECODE_CHAR: /o fixed length string o/
319 case OCI_TYPECODE_VARCHAR2: /o variable length string o/
320 case OCI_TYPECODE_RAW: /o raw o/
321 {
322 /o get the length of the fixed or variable length string o/
323 if (OCITypeElemLength(env, err, ado) < 100)
324 /o do something o/
325 }
326 break;
327
328 /o parameterized types o/
329 case OCI_TYPECODE_REF: /o reference o/
330 case OCI_TYPECODE_PTR: /o pointer o/
331 {
332 /o get the type stored in the parameterized type o/
333 if (OCITypeElemParameterizedType(env, err, ado, &tdo)
334 != OCI_SUCCESS)
335 /o error o/ ;
336
337 /o do something o/
338 if (OCI_TYPEELEM_IS_REF(OCITypeElemFlags(env, err, ado)))...
339 }
340 break;
341
342 /o domain type o/
343 case OCI_TYPECODE_NAMEDCOLLECTION:
344 switch (OCITypeCollTypeCode(env, err, tdo))
345 {
346 case OCI_TYPECODE_VARRAY: /o variable array o/
347 ub4 num_elems;
348 OCIType *element_type;
349
350 /o get the number of elements in the farray or the maximum number
351 o of elements in the varray.
352 o/
353 OCITypeCollSize(env, err, tdo, &num_elems);
354
355 /o get the type of the array o/
356 OCITypeElemType(env, err, tdo, &element_type);
357 }
358 break;
359
360 case OCI_TYPECODE_TABLE: /o multiset o/
361 {
362 OCIType *table_type;
363
364 /o get the type of the multiset o/
365 OCITypeElemType(env, err, tdo, &table_type);
366
367 /o do something o/
368 }
369 }
370
371 /o abstract type o/
372 case OCI_TYPECODE_ADT: /o abstract data type o/
373 {
374 /o get the adt information o/
375 if (OCITypeElemType(env, err, ado, &tdo) != OCI_SUCCESS)
376 /o error o/ ;
377
378 /o do something o/
379 }
380 break;
381
382 default:
383 DISCARD printf("Error: invalid type code\n");
384
385 } /o end of typecode switch o/
386
387 } /o end of loop through all attributes in a type o/
388
389
390 /o ------------ GET THE IMMEDIATE METHODS OF A TYPE ------------ o/
391
392 /o loop through all methods in the type by reusing iterator o/
393 if (OCITypeIterSet(env, err, car_tdo, iterator_ort) != OCI_SUCCESS)
394 /o do something o/
395
396 while (OCITypeMethodNext(env, err, iterator_ort) != OCI_NO_DATA)
397 {
398 /o get the method's name o/
399 if (!memcmp(OCITypeMethodName(env, err, mdo, &text_len), "car",
400 text_len))
401 /o do something o/ ;
402
403 /o get the method's encapsulation o/
404 if (OCITypeMethodEncap(env, err, mdo) == OCI_TYPEENCAP_PUBLIC)
405 /o do something o/ ;
406
407 /o get the method's flags o/
408 meth_flags = OCITypeMethodFlags(env, err, mdo);
409 if (meth_flags & OCI_TYPEMETHOD_VIRTUAL)
410 /o do something o/ ;
411
412
413 /o ------------ GET THE PARAMETERS IN A METHOD ------------ o/
414
415 /o loop through all parameters in the method o/
416 count = OCITypeMethodParams(env, err, mdo);
417 for (j = 1; j <= count; j++)
418 {
419 /o get the parameter information by position o/
420 if (OCITypeParamByPos(env, err, mdo, i, &elem) != OCI_SUCCESS)
421 /o error o/ ;
422
423 /o get the parameter's name o/
424 if (!memcmp(OCITypeElemName(env, err, elem, &text_len), "an_age",
425 text_len))
426 /o do something o/ ;
427
428 /o get the parameter's mode o/
429 if (OCITypeElemMode(env, err, elem) == OCI_PARAM_OUT)
430 /o do something o/ ;
431
432 /o get the parameter's required flag o/
433 if (ortgprq(env, err, elem))
434 /o do something o/ ;
435 }
436 }
437
438 /o get a method by name o/
439 if (OCITypeMethodByName(env, err, car_tdo, "car_constructor",
440 strlen("car_constructor"), NULLP(OCIRef), &mdo)
441 != OCI_SUCCESS)
442 /o error o/ ;
443
444 /o get a parameter in a method by name o/
445 if (OCITypeParamByName(env, err, mdo, "an_age", strlen("an_age"), &elem)
446 != OCI_SUCCESS)
447 /o error o/ ;
448
449 /o get a parameter's typecode o/
450 typecode = OCITypeElemTypeCode(env, err, elem);
451
452 /o get a parameter's type object o/
453 if (OCITypeElemType(env, err, elem, &tdo)) != OCI_SUCCESS)
454 /o error o/ ;
455
456 /o get a parameter's position in a method o/
457 if (ortgpps(env, err, mdo, "an_age", strlen("an_age"),
458 &position, NULLP(OCIRef), NULLP(OCITypeElem)) != OCI_SUCCESS)
459 /o error o/ ;
460
461 /o ------------ GET THE METHOD's RESULT ------------ o/
462
463 /o get a method by name o/
464 if (OCITypeMethodByName(env, err, car_tdo, "get_age", strlen("get_age"),
465 &mdo) != OCI_SUCCESS)
466 /o error o/ ;
467
468 /o get the typecode of the method's result o/
469 typecode = OCITypeElemTypeCode(env, err, mdo);
470
471
472 /o ----------------- END ---------------- o/
473
474 /o free the references implicitly allocated o/
475 DISCARD orlrfre(env, err, (dvoid *)&attr_ref);
476 DISCARD orlrfre(env, err, (dvoid *)&param_ref);
477
478 NOTES
479
480 MODIFIED
481 dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
482 srseshad 03/12/03 - convert oci public api to ansi
483 aahluwal 06/03/02 - bug 2360115
484 skabraha 04/16/02 - fix compiler warnings
485 rkasamse 03/02/01 - do not use iterator : keyword in MSVB
486 bpalaval 02/09/01 - Change text to oratext.
487 rxgovind 01/31/00 - add OCIType interfaces for transient types
488 whe 09/01/99 - 976457:check __cplusplus for C++ code
489 cxcheng 05/06/97 - make OCI_TYPE?? test macros return either 1 or 0
490 cxcheng 04/22/97 - add comment on desupporting OCIType functions
491 skrishna 03/18/97 - fix ifdef for supporting ansi and k&r proto-types
492 cxcheng 02/26/97 - fix lint problem with oro names
493 cxcheng 02/06/97 - take out short name support except with SLSHORTNAME
494 cxcheng 01/15/97 - change prototype of OCITypeElemParameterizedType()
495 cxcheng 01/03/97 - replace bit in OCI_TYPEPARAM_IS_REQUIRED with bitwis
496 cxcheng 12/31/96 - replace OCI_PARAM_IS_REQUIRED with OCI_TYPEPARAM_IS_
497 cxcheng 12/09/96 - add prototype for OCITypeElemExtTypeCode and OCIType
498 cxcheng 11/25/96 - add schema name parameter to OCITypeVTInsert()
499 cxcheng 11/20/96 - fix prototype for OCITypeByName()
500 cxcheng 11/11/96 - fix prototype for OCITypeByName()
501 cxcheng 11/05/96 - remove OCITypeElemExtTypeCode and OCITypeCollExtType
502 dchatter 10/28/96 - change ortgatyp to be OCITypeArrayByName
503 cxcheng 10/25/96 - fix problem with ortgatyp at end
504 cxcheng 10/22/96 - add OCITypeByRef and OCITypeArrayByRef
505 cxcheng 10/20/96 - remove ortgtyp() from #define section at end
506 cxcheng 10/18/96 - rename OCITypeGetArray to OCITypeArrayByName
507 cxcheng 10/17/96 - final change to prototype for OCI_TYPEPARAM_IS_REQUI
508 cxcheng 10/15/96 - rename OCIEncapLevel and OCIMethodFlag
509 cxcheng 10/14/96 - change prototype of OCITypeResult
510 mluong 10/11/96 - fix compile error
511 jwijaya 10/10/96 - fix bug on OCI_PARAM_IS_REQUIRED
512 cxcheng 10/09/96 - more lint and link fixes
513 cxcheng 10/08/96 - more lint fixes
514 cxcheng 10/07/96 - more changes
515 cxcheng 10/04/96 - replace short names with long names
516 cxcheng 10/01/96 - change to long names for readability
517 cxcheng 09/27/96 - rename ortgatyp() to ortgtya() for lint
518 cxcheng 09/20/96 - add ortgatyp() for array get type
519 cxcheng 09/18/96 - add array pin and iterator functions
520 cxcheng 08/09/96 - add version table calls
521 cxcheng 07/22/96 - add OCITypeElemType() to top
522 jwijaya 07/03/96 - add ANSI prototypes
523 cxcheng 06/28/96 - add OCITypeElemCharSetForm()
524 cxcheng 06/26/96 - fix comment on OCITypeParamByPos()/ortgpps()
525 cxcheng 06/18/96 - fix comments on OCITypeResult()
526 cxcheng 06/17/96 - improve comments
527 skrishna 06/03/96 - change OCITypeCollElem() prototype
528 vkrishna 05/29/96 - replace OROTCFAR with OROTCCAR
529 cxcheng 05/28/96 - fix comments, remove non-beta1 functions
530 cxcheng 05/02/96 - fix prototype bugs
531 cxcheng 04/29/96 - rename OCITypeElemm() to ortanct()
532 cxcheng 04/26/96 - add ortgrbp and ortftyi,
533 fix comments and examples
534 cxcheng 04/22/96 - big merge to main branch
535 cxcheng 04/17/96 - fix syntax
536 cxcheng 04/08/96 - change prototype to ortaty()
537 skrishna 04/08/96 - change ort*() to take OCIEnv* and OCIError* instead
538 of oroenv*
539 cxcheng 03/28/96 - add ortslob(), change ortsstr() prototype
540 cxcheng 03/13/96 - change alter type interface
541 cxcheng 03/11/96 - ORT interface changes
542 cxcheng 02/27/96 - correct comments
543 jboonleu 02/09/96 - rename oroopd to OCIDuration
544 cxcheng 01/19/96 - change ORTCTYVAL to ORTCTYEMB for embedded ADT
545 cxcheng 02/14/96 - add more comments
546 jboonleu 02/09/96 - rename oroopd to OCIDuration
547 cxcheng 02/07/96 - fix comments and examples
548 cxcheng 01/19/96 - new ORT interface without korfc's
549 cxcheng 01/08/96 - consolidate collection functions
550 cxcheng 12/14/95 - remove obsolete ortgcol() and ortrelease()
551 jweisz 12/12/95 - merge screwup: ortdth twice
552 cxcheng 12/05/95 - change multiset interface for new standard
553 skotsovo 12/01/95 - merge from /vobs/rdbms/public/ort.h@@/main/
554 st_rdbms_big_dev/st_rdbms_obj/
555 st_rdbms_jwijaya_variable_ref
556 cxcheng 11/13/95 - add ortaty()/orteaty()
557 cxcheng 11/13/95 - add new collection type accessors
558 skotsovo 10/30/95 - add 'oid' type b/c extent type uses it.
559 skotsovo 10/24/95 - update according to new variable length ref
560 cxcheng 10/05/95 - add null support, change prototypes to calls
561 cxcheng 10/03/95 - add OCITypeMethodOrder() to get ORDER method
562 cxcheng 09/28/95 - add OCITypeElemm() for collection types support
563 skotsovo 06/05/95 - add adt_type parameter to ortsab()
564 skotsovo 05/10/95 - ifdef'd out ortgafp()
565 skotsovo 03/07/95 - update interface to only include release 1
566 skotsovo 02/22/95 - add multiset accessors
567 skotsovo 02/09/95 - update according to new ots doc
568 skotsovo 01/31/95 - add rest of release 1 types
569 skotsovo 01/24/95 - categorize sint32, double, and real as number types
570 (with precision and scale) instead of scalar types.
571 skotsovo 01/12/95 - remove dependency from ortdty interface
572 skotsovo 01/03/95 - remove orotyp accessors
573 skotsovo 12/12/94 - update comments
574 skotsovo 12/05/94 - change OCITypeElemParameterizedTyper interface
575 skotsovo 10/26/94 - add type version table
576 skotsovo 10/17/94 - fix ortgafp() comments
577 skotsovo 10/14/94 - modify ortgafp() parameters
578 skotsovo 10/14/94 - add examples
579 skotsovo 10/13/94 - add a few new routines
580 jwijaya 10/07/94 - add namespace to pin by name
581 jwijaya 10/02/94 - connection handle -> connection number
582 skotsovo 09/13/94 - modify example to use updated oririni interface
583 skotsovo 08/25/94 - change scale to sb1 from sb2
584 skotsovo 07/28/94 - add ortbeg() and ortend()
585 skotsovo 07/14/94 - add decimal type & call graph
586 skotsovo 06/28/94 - subset by removing miscellaneous functions
587 skotsovo 06/28/94 - consistently put comments before typedefs
588 skotsovo 06/27/94 - modify according to new header file template, add
589 more examples, and change ortcty() to return a
590 reference to the type
591 skotsovo 06/24/94 - add functions to get type information from orotyp
592 skotsovo 06/20/94 - finish modifying according to header template
593 skotsovo 06/09/94 - modify according to header file template
594 skotsovo 06/08/94 - replace s.h with oratypes.h
595 skotsovo 05/24/94 - modify comments & update example
596 skotsovo 05/23/94 - modify fnt names for create, alter and drop type
597 skotsovo 05/18/94 - remove ortdme() -- delete a method
598 skotsovo 05/17/94 - add tdo parameter to all type modifiers
599 skotsovo 05/11/94 - return text* instead of including it in arglist
600 skotsovo 11/16/93 - creation
601
602*/
603
604#ifndef ORATYPES
605#include <oratypes.h>
606#endif
607#ifndef ORO_ORACLE
608#include <oro.h>
609#endif
610#ifndef OCI_ORACLE
611#include <oci.h>
612#endif
613
614#ifndef ORT_ORACLE
615#define ORT_ORACLE
616
617/*---------------------------------------------------------------------------*/
618/* SHORT NAMES SUPPORT SECTION */
619/*---------------------------------------------------------------------------*/
620
621#ifdef SLSHORTNAME
622
623/* the following are short names that are only supported on IBM mainframes
624 with the SLSHORTNAME defined.
625 With this all subsequent long names will actually be substituted with
626 the short names here */
627
628#define OCITypeArrayByName ortgatyp
629#define OCITypeAttrByName ortgabn
630#define OCITypeAttrNext ortgabi
631#define OCITypeAttrs ortgtna
632#define OCITypeByRef ortgtbrf
633#define OCITypeCollElem ortgcel
634#define OCITypeCollExtTypeCode ortgcsqt
635#define OCITypeCollSize ortgcne
636#define OCITypeCollTypeCode ortgdttc
637#define OCITypeElem ortado
638#define OCITypeElemCharSetForm ortgscform
639#define OCITypeElemCharSetID ortgscid
640#define OCITypeElemDefaultValue ortgpdv
641#define OCITypeElemExtTypeCode ortgasqt
642#define OCITypeElemLength ortgsl
643#define OCITypeElemName ortganm
644#define OCITypeElemNumPrec ortgnp
645#define OCITypeElemNumScale ortgns
646#define OCITypeElemParamMode ortgpmo
647#define OCITypeElemParameterizedType ortgpa
648#define OCITypeElemType ortgaty
649#define OCITypeElemTypeCode ortgatc
650#define OCITypeIter ortitr
651#define OCITypeIterFree ortifre
652#define OCITypeIterNew ortinew
653#define OCITypeIterSet ortiset
654#define OCITypeMethod ortmdo
655#define OCITypeMethodByName ortgmbn
656#define OCITypeMethodEncap ortgmen
657#define OCITypeMethodFlags ortgmfl
658#define OCITypeMethodMap ortgmmap
659#define OCITypeMethodName ortgmnm
660#define OCITypeMethodNext ortgmbi
661#define OCITypeMethodOrder ortgmor
662#define OCITypeMethodOverload ortgmno
663#define OCITypeMethodParams ortgmnp
664#define OCITypeMethods ortgtnm
665#define OCITypeName ortgtme
666#define OCITypeParamByName ortgpbn
667#define OCITypeParamPos ortgpps
668#define OCITypeSchema ortgtsch
669#define OCITypeTypeCode ortgttc
670#define OCITypeVTInit ortvini
671#define OCITypeVTInsert ortvins
672#define OCITypeVTSelect ortvsel
673#define OCITypeVersion ortgtvn
674
675#endif /* SLSHORTNAME */
676
677
678/*============================*/
679/* PUBLIC TYPES AND CONSTANTS */
680/*============================*/
681
682/*----------------------------- TYPE DESCRIPTION ----------------------------*/
683
684/*
685 * OCIType - OCI Type Description Object
686 *
687 * The contents of an 'OCIType' is private/opaque to clients. Clients just
688 * need to declare and pass 'OCIType' pointers in to the type manage
689 * functions.
690 * The pointer points to the type in the object cache. Thus, clients don't
691 * need to allocate space for this type and must NEVER free the pointer to the
692 * 'OCIType'.
693 */
694
695typedef struct OCIType OCIType;
696
697/*------------------------- TYPE ELEMENT DESCRIPTION ------------------------*/
698
699
700/*
701 * OCITypeElem - OCI Type Element object
702 *
703 * The contents of an 'OCITypeElem' is private/opaque to clients. Clients just
704 * need to declare and pass 'OCITypeElem' pointers in to the type manager
705 * functions.
706 *
707 * 'OCITypeElem' objects contains type element information such as the numeric
708 * precision for example, for number objects, and the number of elements for
709 * arrays.
710 * They ARE used to describe type attributes, collection elements,
711 * method parameters, and method results. Hence they are pass in or returned
712 * by attribute, collection, and method parameter/result accessors.
713 */
714
715typedef struct OCITypeElem OCITypeElem;
716
717
718/*--------------------------- METHOD DESCRIPTION ---------------------------*/
719
720
721/*
722 * OCITypeMethod - OCI Method Description object
723 *
724 * The contents of an 'OCITypeMethod' is private/opaque to clients. Clients
725 * just need to declare and pass 'OCITypeMethod' pointers in to the type
726 * manager functions.
727 * The pointer points to the method in the object cache. Thus, clients don't
728 * need to allocate space for this type and must NEVER free the pointer to
729 * the 'OCITypeMethod'.
730 */
731
732typedef struct OCITypeMethod OCITypeMethod;
733
734
735/*--------------------------- TYPE ACCESS ITERATOR --------------------------*/
736
737/*
738 * OCITypeIter- OCI Type Iterator
739 *
740 * The contents of an 'orti' is private/opaque to clients. Clients just
741 * need to declare and pass 'orti' pointers in to the type manager functions.
742 * The iterator is used to retreive MDO's and ADO's that belong to the TDO
743 * one at a time. It needs to be allocated by the 'OCITypeIterNew()' function
744 * call and deallocated with the 'OCITypeIterFree()' function call.
745 */
746
747typedef struct OCITypeIter OCITypeIter;
748
749
750/*==================*/
751/* PUBLIC FUNCTIONS */
752/*==================*/
753
754/*--------------------------------------------------------------------------*/
755/* ITERATOR */
756/*--------------------------------------------------------------------------*/
757
758/*-----------------------_- OCITypeIterNew ---------------------------------*/
759
760/* ** OBSOLETE ** */
761sword OCITypeIterNew( OCIEnv *env, OCIError *err, OCIType *tdo,
762 OCITypeIter **iterator_ort );
763
764/*
765 NAME: OCITypeIterNew - OCI Iterator NEW
766 PARAMETERS:
767 env (IN/OUT) - OCI environment handle initialized in object mode
768 err (IN/OUT) - error handle. If there is an error, it is
769 recorded in 'err' and this function returns OCI_ERROR.
770 The error recorded in 'err' can be retrieved by calling
771 OCIErrorGet().
772 tdo (IN) - pointer to the pinned type in the object cache to
773 initialize the iterator with
774 iterator_ort (OUT) - pointer to the pointer to the new iterator created
775 DESCRIPTION:
776 Create a new instance of a method/attribute iterator and initalize
777 it's values.
778 RETURNS:
779 OCI_SUCCESS if the function completes successfully.
780 OCI_INVALID_HANDLE if 'env' or 'err' is null.
781 OCI_ERROR if
782 1) any of the required parameters is null.
783 2) error while allocating space for the iterator.
784*/
785
786/*------------------------ OCITypeIterSet ---------------------------------*/
787
788/* ** OBSOLETE ** */
789sword OCITypeIterSet( OCIEnv *env, OCIError *err, OCIType *tdo,
790 OCITypeIter *iterator_ort );
791
792/*
793 NAME: OCITypeIterSet - OCI Iterator SET
794 PARAMETERS:
795 env (IN/OUT) - OCI environment handle initialized in object mode
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 tdo (IN) - pointer to the pinned type in the object cache to
801 initialize the iterator with
802 iterator_ort (IN/OUT) - pointer to the iterator to set
803 DESCRIPTION:
804 Initializes the iterator. This is used to reset the state of the
805 iterator.
806 RETURNS:
807 OCI_SUCCESS if the function completes successfully.
808 OCI_INVALID_HANDLE if 'env' or 'err' is null.
809 OCI_ERROR if
810 1) any of the required parameters is null.
811*/
812
813/*------------------------ OCITypeIterFree ---------------------------------*/
814
815/* ** OBSOLETE ** */
816sword OCITypeIterFree( OCIEnv *env, OCIError *err, OCITypeIter
817 *iterator_ort );
818
819/*
820 NAME: OCITypeIterFree - OCI Iterator FREe
821 PARAMETERS:
822 env (IN/OUT) - OCI environment handle initialized in object mode
823 err (IN/OUT) - error handle. If there is an error, it is
824 recorded in 'err' and this function returns OCI_ERROR.
825 The error recorded in 'err' can be retrieved by calling
826 OCIErrorGet().
827 iterator_ort (IN/OUT) - pointer to the iterator to free
828 DESCRIPTION:
829 Free space allocated for the iterator.
830 RETURNS:
831 OCI_SUCCESS if the function completes successfully.
832 OCI_INVALID_HANDLE if 'env' or 'err' is null.
833 OCI_ERROR if
834 1) any of the required parameters is null.
835 2) error while freeing the iterator, probably bad iterator pointer.
836*/
837
838
839/*--------------------------------------------------------------------------*/
840/* TYPE GET */
841/*--------------------------------------------------------------------------*/
842
843/* ** OBSOLETE ** */
844sword OCITypeByName( OCIEnv *env, OCIError *err, const OCISvcCtx *svc,
845 const oratext *schema_name, ub4 s_length,
846 const oratext *type_name, ub4 t_length,
847 const oratext *version_name, ub4 v_length,
848 OCIDuration pin_duration, OCITypeGetOpt get_option,
849 OCIType **tdo );
850/*
851 NAME: OCITypeByName - OCI Get the most current version of an existing TYPe
852 by name.
853 PARAMETERS:
854 env (IN/OUT) - OCI environment handle initialized in object mode
855 err (IN/OUT) - error handle. If there is an error, it is
856 recorded in 'err' and this function returns OCI_ERROR.
857 The error recorded in 'err' can be retrieved by calling
858 OCIErrorGet().
859 svc (IN) - OCI service handle
860 schema_name (IN, optional) - name of schema associated with the
861 type. By default, the user's schema name is used.
862 s_length (IN) - length of the 'schema_name' parameter
863 type_name (IN) - name of the type to get
864 t_length (IN) - length of the 'type_name' parameter
865 version_name (IN, optional) - user readable version of the type.
866 Pass (oratext *)0 for the most current version.
867 v_length (IN) - length of version_name in bytes. Should be 0 if
868 the most current version is to be retrieved.
869 pin_duration (IN) - pin duration (e.g. until the end of current
870 transaction). See 'oro.h' for a description of
871 each option.
872 get_option (IN) - options for loading the types. It can be one of two
873 values:
874 OCI_TYPEGET_HEADER for only the header to be loaded, or
875 OCI_TYPEGET_ALL for the TDO and all ADO and MDOs to be
876 loaded.
877 tdo (OUT) - pointer to the pinned type in the object cache
878 DESCRIPTION:
879 Get a pointer to a version of the existing type associated
880 with schema/type name.
881 RETURNS:
882 OCI_SUCCESS if the function completes successfully.
883 OCI_INVALID_HANDLE if 'env' or 'err' is null.
884 OCI_ERROR if
885 1) any of the required parameters is null.
886 2) the adt type associated with schema/type name does not exist.
887 NOTE:
888 Schema and type names are CASE-SENSITIVE. If they have been created
889 via SQL, you need to use uppercase names.
890*/
891
892sword OCITypeArrayByName( OCIEnv *env, OCIError *err, const OCISvcCtx *svc,
893 ub4 array_len,
894 const oratext *schema_name[], ub4 s_length[],
895 const oratext *type_name[], ub4 t_length[],
896 const oratext *version_name[], ub4 v_length[],
897 OCIDuration pin_duration,
898 OCITypeGetOpt get_option, OCIType **tdo );
899
900/*
901 NAME: OCITypeArrayByName - OCI Get array of TYPes by name.
902 PARAMETERS:
903 env (IN/OUT) - OCI environment handle initialized in object mode
904 err (IN/OUT) - error handle. If there is an error, it is
905 recorded in 'err' and this function returns OCI_ERROR.
906 The error recorded in 'err' can be retrieved by calling
907 OCIErrorGet().
908 svc (IN) - OCI service handle
909 array_len (IN) - number of schema_name/type_name/version_name entries to
910 be retrieved.
911 schema_name (IN, optional) - array of schema names associated with the
912 types to be retrieved. The array must have array_len
913 elements if specified.
914 If 0 is supplied, the default schema is assumed, otherwise
915 it MUST have array_len number of elements.
916 0 can be supplied for one or more of the entries to indicate
917 that the default schema is desired for those entries.
918 s_length (IN) - array of schema_name lengths with each entry
919 corresponding to the length of the corresponding schema_name
920 entry in the schema_name array in bytes.
921 The array must either have array_len number of elements or
922 it MUST be 0 if schema_name is not specified.
923 type_name (IN) - array of the names of the types to retrieve. This
924 MUST have array_len number of elements.
925 t_length (IN) - array of the lengths of type names in the type_name
926 array in bytes.
927 version_name (IN) - array of the version names of the types to retrieve
928 corresponding. This can be 0 to indicate retrieval of the
929 most current versions, or it MUST have array_len number of
930 elements.
931 If 0 is supplied, the most current version is assumed,
932 otherwise it MUST have array_len number of elements.
933 0 can be supplied for one or more of the entries to indicate
934 that the current version is desired for those entries.
935 v_length (IN) - array of the lengths of version names in the
936 version_name array in bytes.
937 pin_duration (IN) - pin duration (e.g. until the end of current
938 transaction) for the types retreieve. See 'oro.h' for a
939 description of each option.
940 get_option (IN) - options for loading the types. It can be one of two
941 values:
942 OCI_TYPEGET_HEADER for only the header to be loaded, or
943 OCI_TYPEGET_ALL for the TDO and all ADO and MDOs to be
944 loaded.
945 tdo (OUT) - output array for the pointers to each pinned type in the
946 object cache. It must have space for array_len pointers.
947 Use OCIObjectGetObjectRef() to obtain the CREF to each
948 pinned type descriptor.
949 DESCRIPTION:
950 Get pointers to the existing types associated with the schema/type name
951 array. This is similar to OCITypeByName() except that all the TDO's are
952 retreived via a single network roundtrip.
953 RETURNS:
954 OCI_SUCCESS if the function completes successfully.
955 OCI_INVALID_HANDLE if 'env' or 'err' is null.
956 OCI_ERROR if
957 1) any of the required parameters is null.
958 2) one or more adt types associated with a schema/type name entry
959 does not exist.
960*/
961
962sword OCITypeByRef( OCIEnv *env, OCIError *err,
963 const OCIRef *type_ref, OCIDuration pin_duration,
964 OCITypeGetOpt get_option, OCIType **tdo );
965
966/*
967 NAME: OCITypeArrayByRef - OCI Get array of TYPes by REF.
968 PARAMETERS:
969 env (IN/OUT) - OCI environment handle initialized in object mode
970 err (IN/OUT) - error handle. If there is an error, it is
971 recorded in 'err' and this function returns OCI_ERROR.
972 The error recorded in 'err' can be retrieved by calling
973 OCIErrorGet().
974 type_ref (IN) - OCIRef * pointing to the particular version of
975 the type descriptor object to obtain.
976 The array must have array_len elements if specified.
977 pin_duration (IN) - pin duration (e.g. until the end of current
978 transaction) for the type to retreieve. See 'oro.h' for a
979 description of each option.
980 get_option (IN) - options for loading the type. It can be one of two
981 values:
982 OCI_TYPEGET_HEADER for only the header to be loaded, or
983 OCI_TYPEGET_ALL for the TDO and all ADO and MDOs to be
984 loaded.
985 tdo (OUT) - pointer to the pinned type in the object cache
986 DESCRIPTION:
987 Get pointers to the
988 with the schema/type name array. This is similar to OCITypeByName()
989 except that all the TDO's are retreived via a single network roundtrip.
990 RETURNS:
991 OCI_SUCCESS if the function completes successfully.
992 OCI_INVALID_HANDLE if 'env' or 'err' is null.
993 OCI_ERROR if
994 1) any of the required parameters is null.
995 2) one or more adt types associated with a schema/type name entry
996 does not exist.
997*/
998
999sword OCITypeArrayByRef( OCIEnv *env, OCIError *err,
1000 ub4 array_len, const OCIRef **type_ref,
1001 OCIDuration pin_duration,
1002 OCITypeGetOpt get_option, OCIType **tdo );
1003
1004/*
1005 NAME: OCITypeArrayByRef - OCI Get array of TYPes by REF.
1006 PARAMETERS:
1007 env (IN/OUT) - OCI environment handle initialized in object mode
1008 err (IN/OUT) - error handle. If there is an error, it is
1009 recorded in 'err' and this function returns OCI_ERROR.
1010 The error recorded in 'err' can be retrieved by calling
1011 OCIErrorGet().
1012 array_len (IN) - number of schema_name/type_name/version_name entries to
1013 be retrieved.
1014 type_ref (IN) - array of OCIRef * pointing to the particular version of
1015 the type descriptor object to obtain.
1016 The array must have array_len elements if specified.
1017 pin_duration (IN) - pin duration (e.g. until the end of current
1018 transaction) for the types retreieve. See 'oro.h' for a
1019 description of each option.
1020 get_option (IN) - options for loading the types. It can be one of two
1021 values:
1022 OCI_TYPEGET_HEADER for only the header to be loaded, or
1023 OCI_TYPEGET_ALL for the TDO and all ADO and MDOs to be
1024 loaded.
1025 tdo (OUT) - output array for the pointers to each pinned type in the
1026 object cache. It must have space for array_len pointers.
1027 Use OCIObjectGetObjectRef() to obtain the CREF to each
1028 pinned type descriptor.
1029 DESCRIPTION:
1030 Get pointers to the
1031 with the schema/type name array. This is similar to OCITypeByName()
1032 except that all the TDO's are retreived via a single network roundtrip.
1033 RETURNS:
1034 OCI_SUCCESS if the function completes successfully.
1035 OCI_INVALID_HANDLE if 'env' or 'err' is null.
1036 OCI_ERROR if
1037 1) any of the required parameters is null.
1038 2) one or more adt types associated with a schema/type name entry
1039 does not exist.
1040*/
1041
1042
1043/*--------------------------------------------------------------------------*/
1044/* TYPE ACCESSORS */
1045/*--------------------------------------------------------------------------*/
1046
1047/*---------------------------- OCITypeName ---------------------------------*/
1048
1049/* ** OBSOLETE ** */
1050oratext* OCITypeName( OCIEnv *env, OCIError *err, const OCIType *tdo,
1051 ub4 *n_length );
1052/*
1053 NAME: OCITypeName - ORT Get a Type's naME.
1054 PARAMETERS:
1055 env (IN/OUT) - OCI environment handle initialized in object mode
1056 err (IN/OUT) - error handle. If there is an error, it is
1057 recorded in 'err' and this function returns OCI_ERROR.
1058 The error recorded in 'err' can be retrieved by calling
1059 OCIErrorGet().
1060 tdo (IN) - pointer to to the type descriptor in the object cache
1061 n_length (OUT) - length (in bytes) of the returned type name. The
1062 caller must allocate space for the ub4 before calling this
1063 routine.
1064 REQUIRES:
1065 1) All type accessors require that the type be pinned before calling
1066 any accessor.
1067 2) All input parameters must not be NULL and must be valid.
1068 3) 'n_length' must point to an allocated ub4.
1069 DESCRIPTION:
1070 Get the name of the type.
1071 RETURNS:
1072 the name of the type
1073 NOTES:
1074 The type descriptor, 'tdo', must be unpinned when the accessed
1075 information is no longer needed.
1076 */
1077
1078/*------------------------ OCITypeSchema ---------------------------------*/
1079
1080/* ** OBSOLETE ** */
1081oratext* OCITypeSchema( OCIEnv *env, OCIError *err, const OCIType *tdo,
1082 ub4 *n_length );
1083/*
1084 NAME: OCITypeSchema - ORT Get a Type's SCHema name.
1085 PARAMETERS:
1086 env (IN/OUT) - OCI environment handle initialized in object mode
1087 err (IN/OUT) - error handle. If there is an error, it is
1088 recorded in 'err' and this function returns OCI_ERROR.
1089 The error recorded in 'err' can be retrieved by calling
1090 OCIErrorGet().
1091 tdo (IN) - pointer to to the type descriptor in the object cache
1092 n_length (OUT) - length (in bytes) of the returned schema name. The
1093 caller must allocate space for the ub4 before calling this
1094 routine.
1095 REQUIRES:
1096 1) All type accessors require that the type be pinned before calling
1097 any accessor.
1098 2) All input parameters must not be NULL and must be valid.
1099 3) 'n_length' must point to an allocated ub4.
1100 DESCRIPTION:
1101 Get the schema name of the type.
1102 RETURNS:
1103 the schema name of the type
1104 NOTES:
1105 The type descriptor, 'tdo', must be unpinned when the accessed
1106 information is no longer needed.
1107 */
1108
1109/*------------------------ OCITypeTypeCode ---------------------------------*/
1110
1111/* ** OBSOLETE ** */
1112OCITypeCode OCITypeTypeCode( OCIEnv *env, OCIError *err,
1113 const OCIType *tdo );
1114/*
1115 NAME: OCITypeTypeCode - OCI Get a Type's Type Code.
1116 PARAMETERS:
1117 env (IN/OUT) - OCI environment handle initialized in object mode
1118 err (IN/OUT) - error handle. If there is an error, it is
1119 recorded in 'err' and this function returns OCI_ERROR.
1120 The error recorded in 'err' can be retrieved by calling
1121 OCIErrorGet().
1122 tdo (IN) - pointer to to the type descriptor in the object cache
1123 REQUIRES:
1124 1) All type accessors require that the type be pinned before calling
1125 any accessor.
1126 2) All input parameters must not be NULL and must be valid.
1127 DESCRIPTION:
1128 Get the type code of the type.
1129 RETURNS:
1130 The type code of the type.
1131 NOTES:
1132 The type descriptor, 'tdo', must be unpinned when the accessed
1133 information is no longer needed.
1134 */
1135
1136/*----------------------- OCITypeCollTypeCode -------------------------------*/
1137
1138/* ** OBSOLETE ** */
1139OCITypeCode OCITypeCollTypeCode( OCIEnv *env, OCIError *err,
1140 const OCIType *tdo );
1141/*
1142 NAME: OCITypeCollTypeCode - OCI Get a Domain Type's Type Code.
1143 PARAMETERS:
1144 env (IN/OUT) - OCI environment handle initialized in object mode
1145 err (IN/OUT) - error handle. If there is an error, it is
1146 recorded in 'err' and this function returns OCI_ERROR.
1147 The error recorded in 'err' can be retrieved by calling
1148 OCIErrorGet().
1149 tdo (IN) - pointer to to the type descriptor in the object cache
1150 REQUIRES:
1151 1) All type accessors require that the type be pinned before calling
1152 any accessor.
1153 2) All input parameters must not be NULL and must be valid.
1154 3) 'tdo' MUST point to a named collection type.
1155 DESCRIPTION:
1156 Get the type code of the named collection type. For V8.0, named
1157 collection types can only be variable length arrays and nested tables.
1158 RETURNS:
1159 OCI_TYPECODE_VARRAY for variable length array, and
1160 OCI_TYPECODE_TABLE for nested tables.
1161 NOTES:
1162 The type descriptor, 'tdo', should be unpinned when the accessed
1163 information is no longer needed.
1164 */
1165
1166/*------------------------- OCITypeVersion ---------------------------------*/
1167
1168/* ** OBSOLETE ** */
1169oratext* OCITypeVersion( OCIEnv *env, OCIError *err, const OCIType *tdo,
1170 ub4 *v_length );
1171/*
1172 NAME: OCITypeVersion - OCI Get a Type's user-readable VersioN.
1173 PARAMETERS:
1174 env (IN/OUT) - OCI environment handle initialized in object mode
1175 err (IN/OUT) - error handle. If there is an error, it is
1176 recorded in 'err' and this function returns OCI_ERROR.
1177 The error recorded in 'err' can be retrieved by calling
1178 OCIErrorGet().
1179 tdo (IN) - pointer to to the type descriptor in the object cache
1180 v_length (OUT) - length (in bytes) of the returned user-readable
1181 version. The caller must allocate space for the ub4 before
1182 calling this routine.
1183 REQUIRES:
1184 1) All type accessors require that the type be pinned before calling
1185 any accessor.
1186 2) All input parameters must not be NULL and must be valid.
1187 3) 'v_length' must point to an allocated ub4.
1188 DESCRIPTION:
1189 Get the user-readable version of the type.
1190 RETURNS:
1191 The user-readable version of the type
1192 NOTES:
1193 The type descriptor, 'tdo', must be unpinned when the accessed
1194 information is no longer needed.
1195 */
1196
1197/*--------------------------- OCITypeAttrs ---------------------------------*/
1198
1199/* ** OBSOLETE ** */
1200ub4 OCITypeAttrs( OCIEnv *env, OCIError *err, const OCIType *tdo );
1201/*
1202 NAME: OCITypeAttrs - OCI Get a Type's Number of Attributes.
1203 PARAMETERS:
1204 env (IN/OUT) - OCI environment handle initialized in object mode
1205 err (IN/OUT) - error handle. If there is an error, it is
1206 recorded in 'err' and this function returns OCI_ERROR.
1207 The error recorded in 'err' can be retrieved by calling
1208 OCIErrorGet().
1209 tdo (IN) - pointer to to the type descriptor in the object cache
1210 REQUIRES:
1211 1) All type accessors require that the type be pinned before calling
1212 any accessor.
1213 2) All input parameters must not be NULL and must be valid.
1214 DESCRIPTION:
1215 Get the number of attributes in the type.
1216 RETURNS:
1217 The number of attributes in the type. 0 for ALL non-ADTs.
1218 NOTES:
1219 The type descriptor, 'tdo', must be unpinned when the accessed
1220 information is no longer needed.
1221 */
1222
1223/*------------------------- OCITypeMethods ---------------------------------*/
1224
1225/* ** OBSOLETE ** */
1226ub4 OCITypeMethods( OCIEnv *env, OCIError *err, const OCIType *tdo );
1227/*
1228 NAME: OCITypeMethods - OCI Get a Type's Number of Methods.
1229 PARAMETERS:
1230 env (IN/OUT) - OCI environment handle initialized in object mode
1231 err (IN/OUT) - error handle. If there is an error, it is
1232 recorded in 'err' and this function returns OCI_ERROR.
1233 The error recorded in 'err' can be retrieved by calling
1234 OCIErrorGet().
1235 tdo (IN) - pointer to to the type descriptor in the object cache
1236 REQUIRES:
1237 1) All type accessors require that the type be pinned before calling
1238 any accessor.
1239 2) All input parameters must not be NULL and must be valid.
1240 DESCRIPTION:
1241 Get the number of methods in a type.
1242 RETURNS:
1243 The number of methods in the type
1244 NOTES:
1245 The type descriptor, 'tdo', must be unpinned when the accessed
1246 information is no longer needed.
1247 */
1248
1249
1250/*--------------------------------------------------------------------------*/
1251/* TYPE ELEMENT INFORMATION ACCESSORS */
1252/*--------------------------------------------------------------------------*/
1253
1254/*------------------------ OCITypeElemName ---------------------------------*/
1255
1256/* ** OBSOLETE ** */
1257oratext* OCITypeElemName( OCIEnv *env, OCIError *err,
1258 const OCITypeElem *elem, ub4 *n_length );
1259/*
1260 NAME: OCITypeElemName - OCI Get an Attribute's NaMe.
1261 PARAMETERS:
1262 env (IN/OUT) - OCI environment handle initialized in object mode
1263 err (IN/OUT) - error handle. If there is an error, it is
1264 recorded in 'err' and this function returns OCI_ERROR.
1265 The error recorded in 'err' can be retrieved by calling
1266 OCIErrorGet().
1267 elem (IN) - pointer to the type element descriptor in the object cache
1268 n_length (OUT) - length (in bytes) of the returned attribute name.
1269 The caller must allocate space for the ub4 before calling this
1270 routine.
1271 REQUIRES:
1272 1) All type accessors require that the type be pinned before calling
1273 any accessor.
1274 2) All input parameters must not be NULL and must be valid.
1275 3) 'n_length' must point to an allocated ub4.
1276 DESCRIPTION:
1277 Get the name of the attribute.
1278 RETURNS:
1279 the name of the attribute and the length in n_length
1280 NOTES:
1281 The type must be unpinned when the accessed information is no
1282 longer needed.
1283 */
1284
1285/*------------------------ OCITypeElemTypeCode ------------------------------*/
1286
1287/* ** OBSOLETE ** */
1288OCITypeCode OCITypeElemTypeCode( OCIEnv *env, OCIError *err,
1289 const OCITypeElem *elem );
1290/*
1291 NAME: OCITypeElemTypeCode - OCI Get an Attribute's TypeCode.
1292 PARAMETERS:
1293 env (IN/OUT) - OCI environment handle initialized in object mode
1294 err (IN/OUT) - error handle. If there is an error, it is
1295 recorded in 'err' and this function returns OCI_ERROR.
1296 The error recorded in 'err' can be retrieved by calling
1297 OCIErrorGet().
1298 elem (IN) - pointer to the type element descriptor in the object cache
1299 REQUIRES:
1300 1) All type accessors require that the type be pinned before calling
1301 any accessor.
1302 2) All input parameters must not be NULL and must be valid.
1303 DESCRIPTION:
1304 Get the typecode of an attribute's type.
1305 RETURNS:
1306 the typecode of the attribute's type. If this is a scalar type, the
1307 typecode sufficiently describes the scalar type and no further calls
1308 need to be made. Valid scalar types include: OCI_TYPECODE_SIGNED8,
1309 OCI_TYPECODE_UNSIGNED8, OCI_TYPECODE_SIGNED16, OCI_TYPECODE_UNSIGNED16,
1310 OCI_TYPECODE_SIGNED32, OCI_TYPECODE_UNSIGNED32, OCI_TYPECODE_REAL,
1311 OCI_TYPECODE_DOUBLE, OCI_TYPECODE_DATE,
1312 OCI_TYPECODE_MLSLABEL, OROTCOID, OCI_TYPECODE_OCTET, or OROTCLOB.
1313 This function converts the CREF (stored in the attribute) into a
1314 typecode.
1315 NOTES:
1316 The type must be unpinned when the accessed information is no
1317 longer needed.
1318 */
1319
1320/*------------------------ OCITypeElemType ---------------------------------*/
1321
1322/* ** OBSOLETE ** */
1323sword OCITypeElemType( OCIEnv *env, OCIError *err, const OCITypeElem *elem,
1324 OCIType **elem_tdo );
1325/*
1326 PARAMETERS
1327 env (IN/OUT) - OCI environment handle initialized in object mode
1328 err (IN/OUT) - error handle. If there is an error, it is
1329 recorded in 'err' and this function returns OCI_ERROR.
1330 The error recorded in 'err' can be retrieved by calling
1331 OCIErrorGet().
1332 elem (IN) - pointer to the type element descriptor in the object cache
1333 elem_tdo (OUT) - If the function completes successfully, 'elem_tdo'
1334 points to the type descriptor (in the object cache) of the type of
1335 the element.
1336
1337 REQUIRES
1338 1) All type accessors require that the type be pinned before calling
1339 any accessor. This can be done by calling 'OCITypeByName()'.
1340 2) if 'elem' is not null, it must point to a valid type element descriptor
1341 in the object cache.
1342
1343 DESCRIPTION
1344 Get the type tdo of the type of this element.
1345 RETURNS
1346 OCI_SUCCESS if the function completes successfully.
1347 OCI_INVALID_HANDLE if 'env' or 'err' is null.
1348 OCI_ERROR if
1349 1) any of the parameters is null.
1350
1351 NOTES
1352 The type must be unpinned when the accessed information is no
1353 longer needed. This can be done by calling 'OCIObjectUnpin()'.
1354 */
1355
1356/*------------------------- OCITypeElemFlags -------------------------------*/
1357
1358/* ** OBSOLETE ** */
1359ub4 OCITypeElemFlags( OCIEnv *env, OCIError *err,
1360 const OCITypeElem *elem );
1361/*
1362 NAME: OCITypeElemFlags - OCI Get a Elem's FLags
1363 (inline, constant, virtual, constructor,
1364 destructor).
1365 PARAMETERS:
1366 env (IN/OUT) - OCI environment handle initialized in object mode
1367 err (IN/OUT) - error handle. If there is an error, it is
1368 recorded in 'err' and this function returns OCI_ERROR.
1369 The error recorded in 'err' can be retrieved by calling
1370 OCIErrorGet().
1371 elem (IN) - pointer to the type element descriptor in the object cache
1372 REQUIRES:
1373 1) All type accessors require that the type be pinned before calling
1374 any accessor.
1375 2) All input parameters must not be NULL and must be valid.
1376 DESCRIPTION:
1377 Get the flags of a type element (attribute, parameter).
1378 RETURNS:
1379 The flags of the type element.
1380 NOTES:
1381 The flag bits are not externally documented. Use only the macros
1382 in the last section (ie. OCI_TYPEPARAM_IS_REQUIRED, and
1383 OCI_TYPEELEM_IS_REF) to test for them only. The type must be unpinned
1384 when the accessed information is no longer needed.
1385 */
1386
1387/*------------------------ OCITypeElemNumPrec ------------------------------*/
1388
1389/* ** OBSOLETE ** */
1390ub1 OCITypeElemNumPrec( OCIEnv *env, OCIError *err,
1391 const OCITypeElem *elem );
1392/*
1393 NAME: OCITypeElemNumPrec - Get a Number's Precision. This includes float,
1394 decimal, real, double, and oracle number.
1395 PARAMETERS:
1396 env (IN/OUT) - OCI environment handle initialized in object mode
1397 err (IN/OUT) - error handle. If there is an error, it is
1398 recorded in 'err' and this function returns OCI_ERROR.
1399 The error recorded in 'err' can be retrieved by calling
1400 OCIErrorGet().
1401 elem (IN) - pointer to the type element descriptor in the object cache
1402 REQUIRES:
1403 All input parameters must not be NULL and must be valid.
1404 DESCRIPTION:
1405 Get the precision of a float, decimal, long, unsigned long, real,
1406 double, or Oracle number type.
1407 RETURNS:
1408 the precision of the float, decimal, long, unsigned long, real, double,
1409 or Oracle number
1410 */
1411
1412/*------------------------- OCITypeElemNumScale -----------------------------*/
1413
1414/* ** OBSOLETE ** */
1415sb1 OCITypeElemNumScale( OCIEnv *env, OCIError *err,
1416 const OCITypeElem *elem );
1417/*
1418 NAME: OCITypeElemNumScale - Get a decimal or oracle Number's Scale
1419 PARAMETERS:
1420 env (IN/OUT) - OCI environment handle initialized in object mode
1421 err (IN/OUT) - error handle. If there is an error, it is
1422 recorded in 'err' and this function returns OCI_ERROR.
1423 The error recorded in 'err' can be retrieved by calling
1424 OCIErrorGet().
1425 elem (IN) - pointer to the type element descriptor in the object cache
1426 REQUIRES:
1427 All input parameters must not be NULL and must be valid.
1428 DESCRIPTION:
1429 Get the scale of a decimal, or Oracle number type.
1430 RETURNS:
1431 the scale of the decimal, or Oracle number
1432 */
1433
1434/*------------------------ OCITypeElemLength -------------------------------*/
1435
1436/* ** OBSOLETE ** */
1437ub4 OCITypeElemLength( OCIEnv *env, OCIError *err,
1438 const OCITypeElem *elem );
1439/*
1440 NAME: OCITypeElemLength - Get a raw, fixed or variable length String's
1441 length in bytes.
1442 PARAMETERS:
1443 env (IN/OUT) - OCI environment handle initialized in object mode
1444 err (IN/OUT) - error handle. If there is an error, it is
1445 recorded in 'err' and this function returns OCI_ERROR.
1446 The error recorded in 'err' can be retrieved by calling
1447 OCIErrorGet().
1448 elem (IN) - pointer to the type element descriptor in the object cache
1449 REQUIRES:
1450 All input parameters must not be NULL and must be valid.
1451 DESCRIPTION:
1452 Get the length of a raw, fixed or variable length string type.
1453 RETURNS:
1454 length of the raw, fixed or variable length string
1455 */
1456
1457/*----------------------- OCITypeElemCharSetID -----------------------------*/
1458
1459/* ** OBSOLETE ** */
1460ub2 OCITypeElemCharSetID( OCIEnv *env, OCIError *err,
1461 const OCITypeElem *elem );
1462/*
1463 NAME: OCITypeElemCharSetID - Get a fixed or variable length String's
1464 character set ID
1465 PARAMETERS:
1466 env (IN/OUT) - OCI environment handle initialized in object mode
1467 err (IN/OUT) - error handle. If there is an error, it is
1468 recorded in 'err' and this function returns OCI_ERROR.
1469 The error recorded in 'err' can be retrieved by calling
1470 OCIErrorGet().
1471 elem (IN) - pointer to the type element descriptor in the object cache
1472 REQUIRES:
1473 All input parameters must not be NULL and must be valid.
1474 DESCRIPTION:
1475 Get the character set ID of a fixed or variable length string type.
1476 RETURNS:
1477 character set ID of the fixed or variable length string
1478 */
1479
1480/*---------------------- OCITypeElemCharSetForm ----------------------------*/
1481
1482/* ** OBSOLETE ** */
1483ub2 OCITypeElemCharSetForm( OCIEnv *env, OCIError *err,
1484 const OCITypeElem *elem );
1485/*
1486 NAME: OCITypeElemCharSetForm - Get a fixed or variable length String's
1487 character set specification form.
1488 PARAMETERS:
1489 env (IN/OUT) - OCI environment handle initialized in object mode
1490 err (IN/OUT) - error handle. If there is an error, it is
1491 recorded in 'err' and this function returns OCI_ERROR.
1492 The error recorded in 'err' can be retrieved by calling
1493 OCIErrorGet().
1494 elem (IN) - pointer to the attribute information in the object cache
1495 REQUIRES:
1496 All input parameters must not be NULL and must be valid.
1497 DESCRIPTION:
1498 Get the character form of a fixed or variable length string type.
1499 The character form is an enumerated value that can be one of the
1500 4 values below:
1501 SQLCS_IMPLICIT for CHAR, VARCHAR2, CLOB w/o a specified set
1502 SQLCS_NCHAR for NCHAR, NCHAR VARYING, NCLOB
1503 SQLCS_EXPLICIT for CHAR, etc, with "CHARACTER SET ..." syntax
1504 SQLCS_FLEXIBLE for PL/SQL "flexible" parameters
1505 RETURNS:
1506 character form of the fixed or variable string
1507 */
1508
1509/*--------------------- OCITypeElemParameterizedType ------------------------*/
1510
1511/* ** OBSOLETE ** */
1512sword OCITypeElemParameterizedType( OCIEnv *env, OCIError *err,
1513 const OCITypeElem *elem,
1514 OCIType **type_stored );
1515/*
1516 NAME: OCITypeElemParameterizedType
1517 PARAMETERS:
1518 env (IN/OUT) - OCI environment handle initialized in object mode
1519 err (IN/OUT) - error handle. If there is an error, it is
1520 recorded in 'err' and this function returns OCI_ERROR.
1521 The error recorded in 'err' can be retrieved by calling
1522 OCIErrorGet().
1523 elem (IN) - pointer to the type element descriptor in the object cache
1524 type_stored (OUT) - If the function completes successfully,
1525 and the parameterized type is complex, 'type_stored' is NULL.
1526 Otherwise, 'type_stored' points to the type descriptor (in the
1527 object cache) of the type that is stored in the parameterized
1528 type. The caller must allocate space for the OCIType*
1529 before calling this routine and must not write into the space.
1530 REQUIRES:
1531 All input parameters must be valid.
1532 DESCRIPTION:
1533 Get a descriptor to the parameter type of a parameterized type.
1534 Parameterized types are types of the form:
1535 REF T
1536 VARRAY (n) OF T
1537 etc, where T is the parameter in the parameterized type.
1538 Additionally is_ref is set if the parameter is a PTR or REF.
1539 For example, it is set for REF T or VARRAY(n) OF REF T.
1540 RETURNS:
1541 OCI_SUCCESS if the function completes successfully.
1542 OCI_INVALID_HANDLE if 'env' or 'err' is null.
1543 OCI_ERROR if
1544 1) any of the parameters is null.
1545 2) 'type_stored' is not NULL but points to NULL data.
1546 NOTES:
1547 Complex parameterized types will be in a future release (once
1548 typedefs are supported. When setting the parameterized type
1549 information, the user must typedef the contents if it's a
1550 complex parameterized type. Ex. for varray<varray<car>>, use
1551 'typedef varray<car> varcar' and then use varray<varcar>.
1552 */
1553
1554/*----------------------- OCITypeElemExtTypeCode ----------------------------*/
1555
1556/* ** OBSOLETE ** */
1557OCITypeCode OCITypeElemExtTypeCode( OCIEnv *env, OCIError *err,
1558 const OCITypeElem *elem );
1559/*
1560 NAME: OCITypeElemExtTypeCode - OCI Get an element's SQLT constant.
1561 PARAMETERS:
1562 env (IN/OUT) - OCI environment handle initialized in object mode
1563 err (IN/OUT) - error handle. If there is an error, it is
1564 recorded in 'err' and this function returns OCI_ERROR.
1565 The error recorded in 'err' can be retrieved by calling
1566 OCIErrorGet().
1567 elem (IN) - pointer to the type element descriptor in the object cache
1568 REQUIRES:
1569 1) All type accessors require that the type be pinned before calling
1570 any accessor.
1571 2) All input parameters must not be NULL and must be valid.
1572 DESCRIPTION:
1573 Get the internal Oracle typecode associated with an attribute's type.
1574 This is the actual typecode for the attribute when it gets mapped
1575 to a column in the Oracle database.
1576 RETURNS:
1577 The Oracle typecode associated with the attribute's type.
1578 NOTES:
1579 The type must be unpinned when the accessed information is no
1580 longer needed.
1581 */
1582
1583/*--------------------------------------------------------------------------*/
1584/* ATTRIBUTE ACCESSORS */
1585/*--------------------------------------------------------------------------*/
1586
1587/*------------------------ OCITypeAttrByName -------------------------------*/
1588
1589/* ** OBSOLETE ** */
1590sword OCITypeAttrByName( OCIEnv *env, OCIError *err, const OCIType *tdo,
1591 const oratext *name, ub4 n_length,
1592 OCITypeElem **elem );
1593/*
1594 NAME: OCITypeAttrByName - OCI Get an Attribute By Name.
1595 PARAMETERS:
1596 env (IN/OUT) - OCI environment handle initialized in object mode
1597 err (IN/OUT) - error handle. If there is an error, it is
1598 recorded in 'err' and this function returns OCI_ERROR.
1599 The error recorded in 'err' can be retrieved by calling
1600 OCIErrorGet().
1601 tdo (IN) - pointer to to the type descriptor in the object cache
1602 name (IN) - the attribute's name
1603 n_length (IN) - length (in bytes) of the 'name' parameter
1604 elem (OUT) - If this function completes successfully, 'elem' points to
1605 the selected type element descriptor pertaining to the
1606 attributein the object cache.
1607 REQUIRES:
1608 1) All type accessors require that the type be pinned before calling
1609 any accessor.
1610 2) if 'tdo' is not null, it must point to a valid type descriptor
1611 in the object cache.
1612 DESCRIPTION:
1613 Get an attribute given its name.
1614 RETURNS:
1615 OCI_SUCCESS if the function completes successfully.
1616 OCI_INVALID_HANDLE if 'env' or 'err' is null.
1617 OCI_ERROR if
1618 1) any of the required parameters is null.
1619 2) the type does not contain an attribute with the input 'name'.
1620 3) 'name' is NULL.
1621 NOTES:
1622 The type descriptor, 'tdo', must be unpinned when the accessed
1623 information is no longer needed.
1624 Schema and type names are CASE-SENSITIVE. If they have been created
1625 via SQL, you need to use uppercase names.
1626 */
1627
1628/*------------------------ OCITypeAttrNext ---------------------------------*/
1629
1630/* ** OBSOLETE ** */
1631sword OCITypeAttrNext( OCIEnv *env, OCIError *err,
1632 OCITypeIter *iterator_ort, OCITypeElem **elem );
1633
1634/*
1635 NAME: OCITypeAttrNext - OCI Get an Attribute By Iteration.
1636 PARAMETERS:
1637 env (IN/OUT) - OCI environment handle initialized in object mode
1638 err (IN/OUT) - error handle. If there is an error, it is
1639 recorded in 'err' and this function returns OCI_ERROR.
1640 The error recorded in 'err' can be retrieved by calling
1641 OCIErrorGet().
1642 iterator_ort (IN/OUT) - iterator for retrieving the next attribute;
1643 see OCITypeIterNew() to initialize iterator.
1644 elem (OUT) - If this function completes successfully, 'elem' points to
1645 the selected type element descriptor pertaining to the
1646 attributein the object cache.
1647 REQUIRES:
1648 1) All type accessors require that the type be pinned before calling
1649 any accessor.
1650 2) if 'tdo' is not null, it must point to a valid type descriptor
1651 in the object cache.
1652 DESCRIPTION:
1653 Iterate to the next attribute to retrieve.
1654 RETURNS:
1655 OCI_SUCCESS if the function completes successfully.
1656 OCI_NO_DATA if there are no more attributes to iterate on; use
1657 OCITypeIterSet() to reset the iterator if necessary.
1658 OCI_INVALID_HANDLE if 'env' or 'err' is null.
1659 OCI_ERROR if
1660 1) any of the required parameters is null.
1661 NOTES:
1662 The type must be unpinned when the accessed information is no
1663 longer needed.
1664 */
1665
1666/*--------------------------------------------------------------------------*/
1667/* COLLECTION ACCESSORS */
1668/*--------------------------------------------------------------------------*/
1669
1670/*------------------------ OCITypeCollElem ---------------------------------*/
1671
1672/* ** OBSOLETE ** */
1673sword OCITypeCollElem( OCIEnv *env, OCIError *err, const OCIType *tdo,
1674 OCITypeElem **element );
1675/*
1676 NAME: OCITypeCollElem
1677 PARAMETERS:
1678 env (IN/OUT) - OCI environment handle initialized in object mode
1679 err (IN/OUT) - error handle. If there is an error, it is
1680 recorded in 'err' and this function returns OCI_ERROR.
1681 The error recorded in 'err' can be retrieved by calling
1682 OCIErrorGet().
1683 tdo (IN) - pointer to the type descriptor in the object cache
1684 element (IN/OUT) - If the function completes successfully, this
1685 points to the descriptor for the collection's element.
1686 It is stored in the same format as an ADT attribute's
1687 descriptor.
1688 If *element is NULL, OCITypeCollElem() implicitly allocates a
1689 new instance of OCITypeElem in the object cache. This instance
1690 will be
1691 automatically freed at the end of the session, and does not have
1692 to be freed explicitly.
1693 If *element is not NULL, OCITypeCollElem() assumes that it
1694 points to a valid OCITypeElem descriptor and will copy the
1695 results into it.
1696 REQUIRES:
1697 All input parameters must be valid.
1698 DESCRIPTION:
1699 Get a pointer to the descriptor (OCITypeElem) of the element of an
1700 array or the rowtype of a nested table.
1701 RETURNS:
1702 OCI_SUCCESS if the function completes successfully.
1703 OCI_INVALID_HANDLE if 'env' or 'err' is null.
1704 OCI_ERROR if
1705 1) any of the parameters is null.
1706 2) the type TDO does not point to a valid collection's type.
1707 NOTES:
1708 Complex parameterized types will be in a future release (once
1709 typedefs are supported. When setting the parameterized type
1710 information, the user must typedef the contents if it's a
1711 complex parameterized type. Ex. for varray<varray<car>>, use
1712 'typedef varray<car> varcar' and then use varray<varcar>.
1713 */
1714
1715/*------------------------ OCITypeCollSize ---------------------------------*/
1716
1717/* ** OBSOLETE ** */
1718sword OCITypeCollSize( OCIEnv *env, OCIError *err, const OCIType *tdo,
1719 ub4 *num_elems );
1720/*
1721 NAME: OCITypeCollSize - OCI Get a Collection's Number of Elements.
1722 PARAMETERS:
1723 env (IN/OUT) - OCI environment handle initialized in object mode
1724 err (IN/OUT) - error handle. If there is an error, it is
1725 recorded in 'err' and this function returns OCI_ERROR.
1726 The error recorded in 'err' can be retrieved by calling
1727 OCIErrorGet().
1728 tdo (IN) - pointer to the type descriptor in the object cache
1729 num_elems (OUT) - number of elements in collection
1730 REQUIRES:
1731 All input parameters must be valid. tdo points to an array type
1732 defined as a domain.
1733 DESCRIPTION:
1734 Get the number of elements stored in a fixed array or the maximum
1735 number of elements in a variable array.
1736 RETURNS:
1737 OCI_SUCCESS if the function completes successfully.
1738 OCI_INVALID_HANDLE if 'env' or 'err' is null.
1739 OCI_ERROR if
1740 1) any of the parameters is null.
1741 2) 'tdo' does not point to a domain with a collection type.
1742 NOTES:
1743 Complex parameterized types will be in a future release (once
1744 typedefs are supported. When setting the parameterized type
1745 information, the user must typedef the contents if it's a
1746 complex parameterized type. Ex. for varray<varray<car>>, use
1747 'typedef varray<car> varcar' and then use varray<varcar>.
1748 */
1749
1750/*------------------------ OCITypeCollExtTypeCode ---------------------------*/
1751
1752/* ** OBSOLETE ** */
1753sword OCITypeCollExtTypeCode( OCIEnv *env, OCIError *err,
1754 const OCIType *tdo, OCITypeCode *sqt_code );
1755/*
1756 NAME: ortcsqt - OCI Get a Collection element's DTY constant.
1757 PARAMETERS:
1758 env (IN/OUT) - OCI environment handle initialized in object mode
1759 err (IN/OUT) - error handle. If there is an error, it is
1760 recorded in 'err' and this function returns OCI_ERROR.
1761 The error recorded in 'err' can be retrieved by calling
1762 OCIErrorGet().
1763 tdo (IN) - pointer to the type descriptor in the object cache
1764 sqt_code (OUT) - SQLT code of type element.
1765 REQUIRES:
1766 1) All type accessors require that the type be pinned before calling
1767 any accessor.
1768 2) All input parameters must not be NULL and must be valid.
1769 DESCRIPTION:
1770 Get the SQLT constant associated with an domain's element type.
1771 The SQLT codes are defined in <sqldef.h> and are needed for OCI/OOCI
1772 use.
1773 RETURNS:
1774 OCI_SUCCESS if the function completes successfully.
1775 OCI_INVALID_HANDLE if 'env' or 'err' is null.
1776 OCI_ERROR if
1777 1) any of the parameters is null.
1778 2) 'tdo' does not point to a domain with a collection type.
1779 NOTES:
1780 The type must be unpinned when the accessed information is no
1781 longer needed.
1782 */
1783
1784
1785/*--------------------------------------------------------------------------*/
1786/* METHOD ACCESSORS */
1787/*--------------------------------------------------------------------------*/
1788
1789/*------------------------- OCITypeMethodOverload --------------------------*/
1790
1791/* ** OBSOLETE ** */
1792ub4 OCITypeMethodOverload( OCIEnv *env, OCIError *err, const OCIType *tdo,
1793 const oratext *method_name, ub4 m_length );
1794/*
1795 NAME: OCITypeMethodOverload - OCI Get type's Number of Overloaded names
1796 for the given method name.
1797 PARAMETERS:
1798 gp (IN/OUT) - pga environment handle. Any errors are recorded here.
1799 tdo (IN) - pointer to to the type descriptor in the object cache
1800 method_name (IN) - the method's name
1801 m_length (IN) - length (in bytes) of the 'method_name' parameter
1802 REQUIRES:
1803 1) All type accessors require that the type be pinned before calling
1804 any accessor.
1805 2) if 'tdo' is not null, it must point to a valid type descriptor
1806 in the object cache.
1807 DESCRIPTION:
1808 Overloading of methods implies that more than one method may have the
1809 same method name. This routine returns the number of methods that
1810 have the given method name. If there are no methods with the input
1811 method name, 'num_methods' is 0. The caller uses this information when
1812 allocating space for the array of mdo and/or position pointers before
1813 calling 'OCITypeMethodByName()' or 'ortgmps()'.
1814 RETURNS:
1815 The number of methods with the given name. 0 if none contains the
1816 name.
1817 NOTES:
1818 Schema and type names are CASE-SENSITIVE. If they have been created
1819 via SQL, you need to use uppercase names.
1820 */
1821
1822/*------------------------ OCITypeMethodByName ------------------------------*/
1823
1824/* ** OBSOLETE ** */
1825sword OCITypeMethodByName( OCIEnv *env, OCIError *err, const OCIType *tdo,
1826 const oratext *method_name, ub4 m_length,
1827 OCITypeMethod **mdos );
1828/*
1829 NAME: OCITypeMethodByName - OCI Get one or more Methods with Name.
1830 PARAMETERS:
1831 env (IN/OUT) - OCI environment handle initialized in object mode
1832 err (IN/OUT) - error handle. If there is an error, it is
1833 recorded in 'err' and this function returns OCI_ERROR.
1834 The error recorded in 'err' can be retrieved by calling
1835 OCIErrorGet().
1836 tdo (IN) - pointer to to the type descriptor in the object cache
1837 method_name (IN) - the methods' name
1838 m_length (IN) - length (in bytes) of the 'name' parameter
1839 mdos (OUT) - If this function completes successfully, 'mdos' points to
1840 the selected methods in the object cache. The caller must
1841 allocate space for the array of OCITypeMethod pointers before
1842 calling this routine and must not write into the space.
1843 The number of OCITypeMethod pointers that will be returned can
1844 be obtained by calling 'OCITypeMethodOverload()'.
1845 REQUIRES:
1846 1) All type accessors require that the type be pinned before calling
1847 any accessor.
1848 2) if 'tdo' is not null, it must point to a valid type descriptor
1849 in the object cache.
1850 DESCRIPTION:
1851 Get one or more methods given the name.
1852 RETURNS:
1853 OCI_SUCCESS if the function completes successfully.
1854 OCI_INVALID_HANDLE if 'env' or 'err' is null.
1855 OCI_ERROR if
1856 1) any of the required parameters is null.
1857 2) No methods in type has name 'name'.
1858 3) 'mdos' is not NULL but points to NULL data.
1859 NOTES:
1860 The type must be unpinned when the accessed information is no
1861 longer needed.
1862 Schema and type names are CASE-SENSITIVE. If they have been created
1863 via SQL, you need to use uppercase names.
1864 */
1865
1866/*------------------------ OCITypeMethodNext --------------------------------*/
1867
1868/* ** OBSOLETE ** */
1869sword OCITypeMethodNext( OCIEnv *env, OCIError *err,
1870 OCITypeIter *iterator_ort,
1871 OCITypeMethod **mdo );
1872
1873/*
1874 NAME: OCITypeMethodNext - OCI Get a Method By Iteration.
1875 PARAMETERS:
1876 env (IN/OUT) - OCI environment handle initialized in object mode
1877 err (IN/OUT) - error handle. If there is an error, it is
1878 recorded in 'err' and this function returns OCI_ERROR.
1879 The error recorded in 'err' can be retrieved by calling
1880 OCIErrorGet().
1881 iterator_ort (IN/OUT) - iterator for retrieving the next method;
1882 see OCITypeIterNew() to set iterator.
1883 mdo (OUT) - If this function completes successfully, 'mdo' points to
1884 the selected method descriptor in the object cache. Positions
1885 start at 1. The caller must allocate space for the
1886 OCITypeMethod* before calling this routine and must not write
1887 nto the space.
1888 REQUIRES:
1889 1) All type accessors require that the type be pinned before calling
1890 any accessor.
1891 2) if 'tdo' is not null, it must point to a valid type descriptor
1892 in the object cache.
1893 DESCRIPTION:
1894 Iterate to the next method to retrieve.
1895 RETURNS:
1896 OCI_SUCCESS if the function completes successfully.
1897 OCI_NO_DATA if there are no more attributes to iterate on; use
1898 OCITypeIterSet() to reset the iterator if necessary.
1899 OCI_INVALID_HANDLE if 'env' or 'err' is null.
1900 OCI_ERROR if
1901 1) any of the required parameters is null.
1902 2) 'mdo' is not NULL but points to NULL data.
1903 NOTES:
1904 The type must be unpinned when the accessed information is no
1905 longer needed.
1906 */
1907
1908/*------------------------ OCITypeMethodName --------------------------------*/
1909
1910/* ** OBSOLETE ** */
1911oratext *OCITypeMethodName( OCIEnv *env, OCIError *err,
1912 const OCITypeMethod *mdo, ub4 *n_length );
1913/*
1914 NAME: OCITypeMethodName - OCI Get a Method's NaMe.
1915 PARAMETERS:
1916 env (IN/OUT) - OCI environment handle initialized in object mode
1917 err (IN/OUT) - error handle. If there is an error, it is
1918 recorded in 'err' and this function returns OCI_ERROR.
1919 The error recorded in 'err' can be retrieved by calling
1920 OCIErrorGet().
1921 mdo (IN) - pointer to the method descriptor in the object cache
1922 n_length (OUT) - length (in bytes) of the 'name' parameter. The caller
1923 must allocate space for the ub4 before calling this routine.
1924 REQUIRES:
1925 1) All type accessors require that the type be pinned before calling
1926 any accessor.
1927 2) All input parameters must not be NULL and must be valid.
1928 DESCRIPTION:
1929 Get the (non-unique) real name of the method.
1930 RETURNS:
1931 the non-unique name of the method or NULL if there is an error.
1932 NOTES:
1933 The type must be unpinned when the accessed information is no
1934 longer needed.
1935 */
1936
1937/*------------------------ OCITypeMethodEncap -------------------------------*/
1938
1939/* ** OBSOLETE ** */
1940OCITypeEncap OCITypeMethodEncap( OCIEnv *env, OCIError *err,
1941 const OCITypeMethod *mdo );
1942/*
1943 NAME: OCITypeMethodEncap - Get a Method's ENcapsulation (private/public).
1944 PARAMETERS:
1945 env (IN/OUT) - OCI environment handle initialized in object mode
1946 err (IN/OUT) - error handle. If there is an error, it is
1947 recorded in 'err' and this function returns OCI_ERROR.
1948 The error recorded in 'err' can be retrieved by calling
1949 OCIErrorGet().
1950 mdo (IN) - pointer to the method descriptor in the object cache
1951 REQUIRES:
1952 1) All type accessors require that the type be pinned before calling
1953 any accessor.
1954 2) All input parameters must not be NULL and must be valid.
1955 DESCRIPTION:
1956 Get the encapsulation (private, or public) of a method.
1957 RETURNS:
1958 the encapsulation (private, or public) of the method
1959 NOTES:
1960 The type must be unpinned when the accessed information is no
1961 longer needed.
1962 */
1963
1964/*------------------------ OCITypeMethodFlags -------------------------------*/
1965
1966/* ** OBSOLETE ** */
1967OCITypeMethodFlag OCITypeMethodFlags( OCIEnv *env, OCIError *err,
1968 const OCITypeMethod *mdo );
1969/*
1970 NAME: OCITypeMethodFlags - OCI Get a Method's FLags
1971 (inline, constant, virtual, constructor,
1972 destructor).
1973 PARAMETERS:
1974 env (IN/OUT) - OCI environment handle initialized in object mode
1975 err (IN/OUT) - error handle. If there is an error, it is
1976 recorded in 'err' and this function returns OCI_ERROR.
1977 The error recorded in 'err' can be retrieved by calling
1978 OCIErrorGet().
1979 mdo (IN) - pointer to the method descriptor in the object cache
1980 REQUIRES:
1981 1) All type accessors require that the type be pinned before calling
1982 any accessor.
1983 2) All input parameters must not be NULL and must be valid.
1984 DESCRIPTION:
1985 Get the flags (inline, constant, virutal, constructor, destructor) of
1986 a method.
1987 RETURNS:
1988 the flags (inline, constant, virutal, constructor, destructor) of
1989 the method
1990 NOTES:
1991 The type must be unpinned when the accessed information is no
1992 longer needed.
1993 */
1994
1995/*------------------------ OCITypeMethodMap ---------------------------------*/
1996
1997/* ** OBSOLETE ** */
1998sword OCITypeMethodMap( OCIEnv *env, OCIError *err, const OCIType *tdo,
1999 OCITypeMethod **mdo );
2000/*
2001 NAME: OCITypeMethodMap - OCI Get the Method's MAP function.
2002 PARAMETERS:
2003 env (IN/OUT) - OCI environment handle initialized in object mode
2004 err (IN/OUT) - error handle. If there is an error, it is
2005 recorded in 'err' and this function returns OCI_ERROR.
2006 The error recorded in 'err' can be retrieved by calling
2007 OCIErrorGet().
2008 tdo (IN) - pointer to to the type descriptor in the object cache
2009 mdo (OUT) - If this function completes successfully, and there is a
2010 map function for this type, 'mdo' points to the selected method
2011 descriptor in the object cache. Otherwise, 'mdo' is null.
2012 REQUIRES:
2013 1) All type accessors require that the type be pinned before calling
2014 any accessor.
2015 2) All required input parameters must not be NULL and must be valid.
2016 DESCRIPTION:
2017 A type may have only one map function. 'OCITypeMethodMap()' finds
2018 this function, if it exists, and returns a reference and a pointer to
2019 the method descriptor in the object cache. If the type does not have a
2020 map (relative ordering) function, then 'mdo_ref' and 'mdo' are set
2021 to null and an error is returned.
2022 RETURNS:
2023 OCI_SUCCESS if the function completes successfully.
2024 OCI_INVALID_HANDLE if 'env' or 'err' is null.
2025 OCI_ERROR if
2026 the type does not contain a map function.
2027 NOTES:
2028 The type must be unpinned when the accessed information is no
2029 longer needed.
2030 */
2031
2032/*------------------------ OCITypeMethodOrder -------------------------------*/
2033
2034/* ** OBSOLETE ** */
2035sword OCITypeMethodOrder( OCIEnv *env, OCIError *err, const OCIType *tdo,
2036 OCITypeMethod **mdo );
2037/*
2038 NAME: OCITypeMethodOrder - OCI Get the Method's ORder function.
2039 PARAMETERS:
2040 env (IN/OUT) - OCI environment handle initialized in object mode
2041 err (IN/OUT) - error handle. If there is an error, it is
2042 recorded in 'err' and this function returns OCI_ERROR.
2043 The error recorded in 'err' can be retrieved by calling
2044 OCIErrorGet().
2045 tdo (IN) - pointer to to the type descriptor in the object cache
2046 mdo (OUT) - If this function completes successfully, and there is a
2047 map function for this type, 'mdo' points to the selected method
2048 descriptor in the object cache. Otherwise, 'mdo' is null.
2049 REQUIRES:
2050 1) All type accessors require that the type be pinned before calling
2051 any accessor.
2052 2) All required input parameters must not be NULL and must be valid.
2053 DESCRIPTION:
2054 A type may have only one ORder or MAP function. 'OCITypeMethodOrder()'
2055 finds this function, if it exists, and returns a ref and a pointer
2056 to the method descriptor in the object cache. If the type does not
2057 have a map (relative ordering) function, then 'mdo_ref' and 'mdo' are
2058 set to null and an error is returned.
2059 RETURNS:
2060 OCI_SUCCESS if the function completes successfully.
2061 OCI_INVALID_HANDLE if 'env' or 'err' is null.
2062 OCI_ERROR if
2063 the type does not contain a map function.
2064 NOTES:
2065 The type must be unpinned when the accessed information is no
2066 longer needed.
2067 */
2068
2069/*------------------------ OCITypeMethodParams ------------------------------*/
2070
2071/* ** OBSOLETE ** */
2072ub4 OCITypeMethodParams( OCIEnv *env, OCIError *err,
2073 const OCITypeMethod *mdo );
2074/*
2075 NAME: OCITypeMethodParams - OCI Get a Method's Number of Parameters.
2076 PARAMETERS:
2077 env (IN/OUT) - OCI environment handle initialized in object mode
2078 err (IN/OUT) - error handle. If there is an error, it is
2079 recorded in 'err' and this function returns OCI_ERROR.
2080 The error recorded in 'err' can be retrieved by calling
2081 OCIErrorGet().
2082 mdo (IN) - pointer to the method descriptor in the object cache
2083 REQUIRES:
2084 1) All type accessors require that the type be pinned before calling
2085 any accessor.
2086 2) All input parameters must not be NULL and must be valid.
2087 DESCRIPTION:
2088 Get the number of parameters in a method.
2089 RETURNS:
2090 the number of parameters in the method
2091 NOTES:
2092 The type must be unpinned when the accessed information is no
2093 longer needed.
2094 */
2095
2096
2097/*--------------------------------------------------------------------------*/
2098/* RESULT ACCESSORS */
2099/*--------------------------------------------------------------------------*/
2100
2101/*-------------------------- OCITypeResult ---------------------------------*/
2102
2103/* ** OBSOLETE ** */
2104sword OCITypeResult( OCIEnv *env, OCIError *err, const OCITypeMethod *mdo,
2105 OCITypeElem **elem );
2106/*
2107 NAME: OCITypeResult - OCI Get a method's result type descriptor.
2108 PARAMETERS:
2109 env (IN/OUT) - OCI environment handle initialized in object mode
2110 err (IN/OUT) - error handle. If there is an error, it is
2111 recorded in 'err' and this function returns OCI_ERROR.
2112 The error recorded in 'err' can be retrieved by calling
2113 OCIErrorGet().
2114 mdo (IN) - pointer to the method descriptor in the object cache
2115 elem (OUT) - If this function completes successfully, 'rdo' points to
2116 the selected result (parameter) descriptor in the object cache.
2117 REQUIRES:
2118 1) All type accessors require that the type be pinned before calling
2119 any accessor.
2120 2) 'elem' MUST be the address of an OCITypeElem pointer.
2121 DESCRIPTION:
2122 Get the result of a method.
2123 RETURNS:
2124 OCI_SUCCESS if the function completes successfully.
2125 OCI_INVALID_HANDLE if 'env' or 'err' is null.
2126 OCI_ERROR if
2127 1) any of the required parameters is null.
2128 2) method returns no results.
2129 NOTES:
2130 The method must be unpinned when the accessed information is no
2131 longer needed.
2132 */
2133
2134
2135/*--------------------------------------------------------------------------*/
2136/* PARAMETER ACCESSORS */
2137/*--------------------------------------------------------------------------*/
2138
2139/*------------------------ OCITypeParamByPos -------------------------------*/
2140
2141/* ** OBSOLETE ** */
2142sword OCITypeParamByPos( OCIEnv *env, OCIError *err,
2143 const OCITypeMethod *mdo, ub4 position,
2144 OCITypeElem **elem );
2145/*
2146 NAME: OCITypeParamByPos - OCI Get a Parameter in a method By Position.
2147 PARAMETERS:
2148 env (IN/OUT) - OCI environment handle initialized in object mode
2149 err (IN/OUT) - error handle. If there is an error, it is
2150 recorded in 'err' and this function returns OCI_ERROR.
2151 The error recorded in 'err' can be retrieved by calling
2152 OCIErrorGet().
2153 mdo (IN) - pointer to the method descriptor in the object cache
2154 position (IN) - the parameter's position. Positions start at 1.
2155 elem (OUT) - If this function completes successfully, 'elem' points to
2156 the selected parameter descriptor in the object cache.
2157 REQUIRES:
2158 1) All type accessors require that the type be pinned before calling
2159 any accessor.
2160 DESCRIPTION:
2161 Get a parameter given its position in the method. Positions start
2162 at 1.
2163 RETURNS:
2164 OCI_SUCCESS if the function completes successfully.
2165 OCI_INVALID_HANDLE if 'env' or 'err' is null.
2166 OCI_ERROR if
2167 1) any of the required parameters is null.
2168 2) 'position' is not >= 1 and <= the number of parameters in the
2169 method.
2170 NOTES:
2171 The type must be unpinned when the accessed information is no
2172 longer needed.
2173 */
2174
2175/*------------------------ OCITypeParamByName -------------------------------*/
2176
2177/* ** OBSOLETE ** */
2178sword OCITypeParamByName( OCIEnv *env, OCIError *err,
2179 const OCITypeMethod *mdo,
2180 const oratext *name, ub4 n_length,
2181 OCITypeElem **elem );
2182/*
2183 NAME: OCITypeParamByName - OCI Get a Parameter in a method By Name.
2184 PARAMETERS:
2185 env (IN/OUT) - OCI environment handle initialized in object mode
2186 err (IN/OUT) - error handle. If there is an error, it is
2187 recorded in 'err' and this function returns OCI_ERROR.
2188 The error recorded in 'err' can be retrieved by calling
2189 OCIErrorGet().
2190 mdo (IN) - pointer to the method descriptor in the object cache
2191 name (IN) - the parameter's name
2192 n_length (IN) - length (in bytes) of the 'name' parameter
2193 elem (OUT) - If this function completes successfully, 'elem' points to
2194 the selected parameter descriptor in the object cache.
2195 REQUIRES:
2196 1) All type accessors require that the type be pinned before calling
2197 any accessor.
2198 2) if 'mdo' is not null, it must point to a valid method descriptor
2199 in the object cache.
2200 DESCRIPTION:
2201 Get a parameter given its name.
2202 RETURNS:
2203 OCI_SUCCESS if the function completes successfully.
2204 OCI_INVALID_HANDLE if 'env' or 'err' is null.
2205 OCI_ERROR if
2206 1) any of the required parameters is null.
2207 2) the method does not contain a parameter with the input 'name'.
2208 NOTES:
2209 The type must be unpinned when the accessed information is no
2210 longer needed.
2211 */
2212
2213/*------------------------ OCITypeParamPos ---------------------------------*/
2214
2215/* ** OBSOLETE ** */
2216sword OCITypeParamPos( OCIEnv *env, OCIError *err,
2217 const OCITypeMethod *mdo,
2218 const oratext *name, ub4 n_length, ub4 *position,
2219 OCITypeElem **elem );
2220/*
2221 NAME: OCITypeParamPos - OCI Get a parameter's position in a method
2222 PARAMETERS:
2223 env (IN/OUT) - OCI environment handle initialized in object mode
2224 err (IN/OUT) - error handle. If there is an error, it is
2225 recorded in 'err' and this function returns OCI_ERROR.
2226 The error recorded in 'err' can be retrieved by calling
2227 OCIErrorGet().
2228 mdo (IN) - pointer to the method descriptor in the object cache
2229 name (IN) - the parameter's name
2230 n_length (IN) - length (in bytes) of the 'name' parameter
2231 position (OUT) - If this function completes successfully, 'position'
2232 points to the position of the parameter in the method starting
2233 at position 1. position MUST point to space for a ub4.
2234 elem (OUT) - If this function completes successfully, and
2235 the input 'elem' is not NULL, 'elem' points to the selected
2236 parameter descriptor in the object cache.
2237 REQUIRES:
2238 1) All type accessors require that the type be pinned before calling
2239 any accessor.
2240 2) if 'mdo' is not null, it must point to a valid method descriptor
2241 in the object cache.
2242 DESCRIPTION:
2243 Get the position of a parameter in a method. Positions start at 1.
2244 RETURNS:
2245 OCI_SUCCESS if the function completes successfully.
2246 OCI_INVALID_HANDLE if 'env' or 'err' is null.
2247 OCI_ERROR if
2248 1) any of the parameters is null.
2249 2) the method does not contain a parameter with the input 'name'.
2250 NOTES:
2251 The type must be unpinned when the accessed information is no
2252 longer needed.
2253 */
2254
2255/*------------------------ OCITypeParamElemMode -----------------------------*/
2256
2257/* ** OBSOLETE ** */
2258OCITypeParamMode OCITypeElemParamMode( OCIEnv *env, OCIError *err,
2259 const OCITypeElem *elem );
2260/*
2261 NAME: OCITypeElemParamMode - OCI Get a parameter's mode
2262 PARAMETERS:
2263 env (IN/OUT) - OCI environment handle initialized in object mode
2264 err (IN/OUT) - error handle. If there is an error, it is
2265 recorded in 'err' and this function returns OCI_ERROR.
2266 The error recorded in 'err' can be retrieved by calling
2267 OCIErrorGet().
2268 elem (IN) - pointer to the parameter descriptor in the object cache
2269 (represented by an OCITypeElem)
2270 REQUIRES:
2271 1) All type accessors require that the type be pinned before calling
2272 any accessor.
2273 2) All input parameters must not be NULL and must be valid.
2274 DESCRIPTION:
2275 Get the mode (in, out, or in/out) of the parameter.
2276 RETURNS:
2277 the mode (in, out, or in/out) of the parameter
2278 NOTES:
2279 The type must be unpinned when the accessed information is no
2280 longer needed.
2281 */
2282
2283/*------------------------- OCITypeElemDefaultValue -------------------------*/
2284
2285/* ** OBSOLETE ** */
2286oratext* OCITypeElemDefaultValue( OCIEnv *env, OCIError *err,
2287 const OCITypeElem *elem,
2288 ub4 *d_v_length );
2289/*
2290 NAME: OCITypeElemDefaultValue - OCI Get the element's Default Value.
2291 PARAMETERS:
2292 env (IN/OUT) - OCI environment handle initialized in object mode
2293 err (IN/OUT) - error handle. If there is an error, it is
2294 recorded in 'err' and this function returns OCI_ERROR.
2295 The error recorded in 'err' can be retrieved by calling
2296 OCIErrorGet().
2297 elem (IN) - pointer to the parameter descriptor in the object cache
2298 (represented by an OCITypeElem)
2299 d_v_length (OUT) - length (in bytes) of the returned default value.
2300 The caller must allocate space for the ub4 before calling this
2301 routine.
2302 REQUIRES:
2303 1) All type accessors require that the type be pinned before calling
2304 any accessor.
2305 2) All input parameters must not be NULL and must be valid.
2306 DESCRIPTION:
2307 Get the default value in text form (PL/SQL) of an element. For V8.0,
2308 this only makes sense for a method parameter.
2309 RETURNS:
2310 The default value (text) of the parameter.
2311 NOTES:
2312 The type must be unpinned when the accessed information is no
2313 longer needed.
2314 */
2315
2316
2317/*--------------------------------------------------------------------------*/
2318/* TYPE VERSION TABLE */
2319/*--------------------------------------------------------------------------*/
2320
2321/* For V8.0, the type version table is meant to be an internal data structure
2322 only for Oracle clients for type version maintanence purposes. A more
2323 general version of the API may be made public in subsequent releases. */
2324
2325
2326/*--------------------------- OCITypeVTInit --------------------------------*/
2327
2328/* ** OBSOLETE ** */
2329sword OCITypeVTInit( OCIEnv *env, OCIError *err );
2330/*
2331 NAME: OCITypeVTInit - OCI type Version table INItialize
2332 PARAMETERS:
2333 env (IN/OUT) - OCI environment handle initialized in object mode
2334 err (IN/OUT) - error handle. If there is an error, it is
2335 recorded in 'err' and this function returns OCI_ERROR.
2336 The error recorded in 'err' can be retrieved by calling
2337 OCIErrorGet().
2338 REQUIRES:
2339 none
2340 DESCRIPTION:
2341 Allocate space for and initialize the type version table and the type
2342 version table's index.
2343 RETURNS:
2344 OCI_SUCCESS if the function completes successfully.
2345 OCI_INVALID_HANDLE if 'env' or 'err' is null.
2346 OCI_ERROR if internal errors occurrs during initialization.
2347 */
2348
2349/*--------------------------- OCITypeVTInsert -------------------------------*/
2350
2351/* ** OBSOLETE ** */
2352sword OCITypeVTInsert( OCIEnv *env, OCIError *err,
2353 const oratext *schema_name, ub4 s_n_length,
2354 const oratext *type_name, ub4 t_n_length,
2355 const oratext *user_version, ub4 u_v_length );
2356/*
2357 NAME: OCITypeVTInsert - OCI type Version table INSert entry.
2358 PARAMETERS:
2359 env (IN/OUT) - OCI environment handle initialized in object mode
2360 err (IN/OUT) - error handle. If there is an error, it is
2361 recorded in 'err' and this function returns OCI_ERROR.
2362 The error recorded in 'err' can be retrieved by calling
2363 OCIErrorGet().
2364 schema_name (IN, optional) - name of schema associated with the
2365 type. By default, the user's schema name is used.
2366 s_n_length (IN) - length of the 'schema_name' parameter
2367 type_name (IN) - type name to insert
2368 t_n_length (IN) - length (in bytes) of the 'type_name' parameter
2369 user_version (IN) - user readable version of the type
2370 u_v_length (IN) - length (in bytes) of the 'user_version' parameter
2371 REQUIRES:
2372 none
2373 DESCRIPTION:
2374 Insert an entry into the type version table and the type version
2375 table's index. The entry's type name and user readable version
2376 fields are updated with the input values. All other fields are
2377 initialized to null.
2378 RETURNS:
2379 OCI_SUCCESS if the function completes successfully.
2380 OCI_INVALID_HANDLE if 'env' or 'err' is null.
2381 OCI_ERROR if
2382 1) any of the parameters is invalid.
2383 2) an entry for 'type_name' has already been registered in the
2384 type version table.
2385 */
2386
2387/*------------------------------ OCITypeVTSelect ----------------------------*/
2388
2389/* OCITypeVTSelect - OCI type VERSion table SELECT entry */
2390/* ** OBSOLETE ** */
2391sword OCITypeVTSelect( OCIEnv *env, OCIError *err,
2392 const oratext *schema_name, ub4 s_n_length,
2393 const oratext *type_name, ub4 t_n_length,
2394 oratext **user_version, ub4 *u_v_length,
2395 ub2 *version );
2396/*
2397 NAME: OCITypeVTSelect - OCI type Version table SELect entry.
2398 PARAMETERS:
2399 env (IN/OUT) - OCI environment handle initialized in object mode
2400 err (IN/OUT) - error handle. If there is an error, it is
2401 recorded in 'err' and this function returns OCI_ERROR.
2402 The error recorded in 'err' can be retrieved by calling
2403 OCIErrorGet().
2404 schema_name (IN, optional) - name of schema associated with the
2405 type. By default, the user's schema name is used.
2406 s_n_length (IN) - length of the 'schema_name' parameter
2407 type_name (IN) - type name to select
2408 t_n_length (IN) - length (in bytes) of the 'type_name' parameter
2409 user_version (OUT, optional) - pointer to user readable version of the
2410 type
2411 u_v_length (OUT, optional) - length (in bytes) of the 'user_version'
2412 parameter
2413 version (OUT, optional) - internal type version
2414 REQUIRES:
2415 All input parameters must not be NULL and must be valid.
2416 DESCRIPTION:
2417 Select an entry in the type version table by name.
2418 RETURNS:
2419 OCI_SUCCESS if the function completes successfully.
2420 OCI_INVALID_HANDLE if 'env' or 'err' is null.
2421 OCI_ERROR if
2422 1) any of the parameters is invalid.
2423 2) an entry with 'type_name' does not exist.
2424 */
2425
2426/* Compatibility function - following function prototype retained for
2427 compatibility only */
2428sword ortgcty( OCIEnv *env, OCIError *err, OCIType *coll_tdo,
2429 OCIType **collelem_tdo );
2430
2431/*---------------------------------------------------------------------------*/
2432/* Transient Type Construction functions */
2433/*---------------------------------------------------------------------------*/
2434
2435sword OCITypeBeginCreate(OCISvcCtx *svchp, OCIError *errhp, OCITypeCode tc,
2436 OCIDuration dur, OCIType **type);
2437/*
2438 NAME: OCITypeBeginCreate - OCI Type Begin Creation of a transient type.
2439 REMARKS
2440 Begins the construction process for a transient type. The type will be
2441 anonymous (no name). To create a persistent named type, the CREATE TYPE
2442 statement should be used from SQL. Transient types have no identity.
2443 They are pure values.
2444 PARAMETERS:
2445 svchp (IN) - The OCI Service Context.
2446 errhp (IN/OUT) - The OCI error handle. If there is an error, it is
2447 recorded in errhp and this function returns
2448 OCI_ERROR. Diagnostic information can be obtained by
2449 calling OCIErrorGet().
2450 tc - The TypeCode for the type. The Typecode could
2451 correspond to a User Defined Type or a Built-in type.
2452 Currently, the permissible values for User Defined
2453 Types are OCI_TYPECODE_OBJECT for an Object Type
2454 (structured), OCI_TYPECODE_VARRAY for a VARRAY
2455 collection type or OCI_TYPECODE_TABLE for a nested
2456 table collection type. For Object types,
2457 OCITypeAddAttr() needs to be called to add each of
2458 the attribute types. For Collection types,
2459 OCITypeSetCollection() needs to be called.
2460 Subsequently, OCITypeEndCreate() needs to be called
2461 to finish the creation process.
2462 The permissible values for Built-in type codes are
2463 specified in the user manual. Additional information
2464 on built-ins if any (like precision, scale for
2465 numbers, character set info for VARCHAR2s etc.) must
2466 be set with a subsequent call to OCITypeSetBuiltin().
2467 Subsequently OCITypeEndCreate() needs to be called
2468 to finish the creation process.
2469 dur - The allocation duration for the Type. Could be a
2470 predefined or a user defined duration.
2471 type(OUT) - The OCIType (Type Descriptor) that is being
2472 constructed.
2473 RETURNS:
2474 OCI_SUCCESS if the function completes successfully.
2475 OCI_ERROR on error.
2476*/
2477
2478
2479sword OCITypeSetCollection(OCISvcCtx *svchp, OCIError *errhp, OCIType *type,
2480 OCIParam *collelem_info, ub4 coll_count);
2481/*
2482 NAME: OCITypeSetCollection - OCI Type Set Collection information
2483 REMARKS :
2484 Set Collection type information. This call can be called only if the
2485 OCIType has been constructed with a collection typecode.
2486 PARAMETERS:
2487 svchp (IN) - The OCI Service Context.
2488 errhp (IN/OUT) - The OCI error handle. If there is an error, it is
2489 recorded in errhp and this function returns
2490 OCI_ERROR. Diagnostic information can be obtained by
2491 calling OCIErrorGet().
2492 type(IN OUT) - The OCIType (Type Descriptor) that is being
2493 constructed.
2494 collelem_info - collelem_info provides information on the collection
2495 element. It is obtained by allocating an OCIParam
2496 (parameter handle) and setting type information in
2497 the OCIParam using OCIAttrSet() calls.
2498 coll_count - The count of elements in the collection. Pass 0 for
2499 a nested table (unbounded).
2500 RETURNS:
2501 OCI_SUCCESS if the function completes successfully.
2502 OCI_ERROR on error.
2503*/
2504
2505sword OCITypeSetBuiltin(OCISvcCtx *svchp, OCIError *errhp, OCIType *type,
2506 OCIParam *builtin_info);
2507/*
2508 NAME: OCITypeSetBuiltin - OCI Type Set Builtin information.
2509 REMARKS:
2510 Set Built-in type information. This call can be called only if the
2511 OCIType has been constructed with a built-in typecode
2512 (OCI_TYPECODE_NUMBER etc.).
2513 PARAMETERS:
2514 svchp (IN) - The OCI Service Context.
2515 errhp (IN/OUT) - The OCI error handle. If there is an error, it is
2516 recorded in errhp and this function returns
2517 OCI_ERROR. Diagnostic information can be obtained by
2518 calling OCIErrorGet().
2519 type(IN OUT) - The OCIType (Type Descriptor) that is being
2520 constructed.
2521 builtin_info - builtin_info provides information on the built-in
2522 (like precision, scale, charater set etc.). It is
2523 obtained by allocating an OCIParam (parameter handle)
2524 and setting type information in the OCIParam using
2525 OCIAttrSet() calls.
2526 RETURNS:
2527 OCI_SUCCESS if the function completes successfully.
2528 OCI_ERROR on error.
2529*/
2530
2531sword OCITypeAddAttr(OCISvcCtx *svchp, OCIError *errhp, OCIType *type,
2532 const oratext *a_name, ub4 a_length,
2533 OCIParam *attr_info);
2534/*
2535 NAME: OCITypeAddAttr - OCI Type Add Attribute to an Object Type.
2536 REMARKS:
2537 Adds an attribute to an Object type (that was constructed earlier with
2538 typecode OCI_TYPECODE_OBJECT).
2539 PARAMETERS:
2540 svchp (IN) - The OCI Service Context
2541 errhp (IN/OUT) - The OCI error handle. If there is an error, it is
2542 recorded in errhp and this function returns
2543 OCI_ERROR. Diagnostic information can be obtained by
2544 calling OCIErrorGet().
2545 type (IN/OUT) - The Type description that is being constructed.
2546 a_name(IN) - Optional. gives the name of the attribute.
2547 a_length - Optional. gives length of attribute name.
2548 attr_info - Information on the attribute. It is obtained by
2549 allocating an OCIParam (parameter handle) and setting
2550 type information in the OCIParam using OCIAttrSet()
2551 calls.
2552 RETURNS:
2553 OCI_SUCCESS if the function completes successfully.
2554 OCI_ERROR on error.
2555*/
2556
2557sword OCITypeEndCreate(OCISvcCtx *svchp, OCIError *errhp, OCIType *type);
2558/*
2559 NAME: OCITypeEndCreate - OCI Type End Creation
2560 REMARKS:
2561 Finishes construction of a type description.Subsequently, only access
2562 will be allowed.
2563 PARAMETERS:
2564 svchp (IN) - The OCI Service Context
2565 errhp (IN/OUT) - The OCI error handle. If there is an error, it is
2566 recorded in errhp and this function returns
2567 OCI_ERROR. Diagnostic information can be obtained by
2568 calling OCIErrorGet().
2569 type (IN/OUT) - The Type description that is being constructed.
2570 RETURNS:
2571 OCI_SUCCESS if the function completes successfully.
2572 OCI_ERROR on error.
2573*/
2574
2575/*=========================*/
2576/* PUBLIC MACROS AND FLAGS */
2577/*=========================*/
2578
2579/*--------------------------------------------------------------------------*/
2580/* TYPE ELEMENT FLAGS */
2581/*--------------------------------------------------------------------------*/
2582
2583#define OCI_TYPEELEM_REF 0x8000 /* element is a REF */
2584#define OCI_TYPEPARAM_REQUIRED 0x0800 /* parameter is required */
2585
2586/* macros to test flags */
2587#define OCI_TYPEELEM_IS_REF(elem_flag) \
2588 (((elem_flag) & OCI_TYPEELEM_REF)!=0)
2589#define OCI_TYPEPARAM_IS_REQUIRED(param_flag) \
2590 (((param_flag) & OCI_TYPEPARAM_REQUIRED)!=0)
2591
2592
2593#endif /* ORT_ORACLE */
2594