1 PACKAGE UTL_PG IS
2
3 ------------
4 -- OVERVIEW
5 --
6 -- This package provides SQL functions for raws which convert
7 -- various non-Oracle number formats to/from raws.
8 -- Included is conversion support for:
9 -- IBM/370 VS COBOL II
10
11 -- UTL_PG is not specific to the database environment and may
12 -- actually be used in other environments as it exists here.
13 -- For this reason, the prefix UTL has been given to the package
14 -- instead of DBMS.
15
16 -- UTL_PG is, however, complementary to facilities provided in
17 -- the Oracle Procedural Gateway for APPC, and is supported only
18 -- in conjunction with that product.
19
20 -------
21 -- USES
22 --
23 -- The raw functions convert foreign data exchanged with remote
24 -- host systems as Oracle RAW's to/from Oracle NUMBER datatypes.
25
26 ---------------------------
27 -- PROCEDURES AND FUNCTIONS
28
29 /*----------------------------------------------------------------*/
30 /* RAW_TO_NUMBER */
31 /*----------------------------------------------------------------*/
32 FUNCTION raw_to_number(r IN RAW,
33 mask IN VARCHAR2,
34 maskopts IN VARCHAR2,
35 envrnmnt IN VARCHAR2,
36 compname IN VARCHAR2,
37 compopts IN VARCHAR2,
38 nlslang IN VARCHAR2,
39 wind IN BOOLEAN,
40 wmsgbsiz IN BINARY_INTEGER,
41 wmsgblk OUT RAW) RETURN NUMBER;
42 pragma restrict_references (raw_to_number,WNDS,RNDS,WNPS,RNPS);
43
44 -- Convert a raw byte-string from the remote host internal format
45 -- specified by mask, maskopts, envrnmnt, compname, and compopts
46 -- into an Oracle number.
47 -- Warnings are issued, if enabled, when the conversion specified
48 -- conflicts with the conversion implied by the data, or when
49 -- conflicting format specifications are supplied.
50
51 -- Input parameters:
52 -- r - the remote host data which is to be converted
53 -- mask - compiler-datatype mask
54 -- The datatype to be converted, specified in the source
55 -- language of the named compiler (compname). mask
56 -- implies the internal format of the data as encoded
57 -- according to the compiler and host platform.
58 -- maskopts - compiler-datatype mask options, or NULL
59 -- Additional options associated with the mask, as may be
60 -- allowed or required, and is specified in the source
61 -- language of compname. maskopts may further qualify
62 -- the type of conversion needed.
63 -- envrnmnt - compiler environment clause or NULL
64 -- Additional options associated with the environment in
65 -- which the remote data resides, as may be allowed or
66 -- required, and is specified in the source language of
67 -- compname. envrnmnt typically supplies aspects of
68 -- data conversion dictated by customer standards, such
69 -- as decimal point or currency symbols if applicable.
70 -- compname - compiler name, supported values are:
71 -- "IBMVSCOBOLII"
72 -- compopts - compiler options or NULL
73 -- nlslang - zoned-dec codepage in Oracle NLS form:
74 -- language_territory.charset
75 -- or defaults to:
76 -- 'AMERICAN_AMERICA.WE8EBCDIC37C'
77 -- wind - warning indicator.
78 -- A boolean indicator which controls whether conversion
79 -- warning messages are to be returned in the wmsgblk out
80 -- parameter.
81 -- FALSE will suppress all warnings, but errors (if any)
82 -- will still be returned as ORA-nnnnn errors.
83 -- TRUE will cause warnings (if any) to be returned in
84 -- wmsgblk.
85 -- wmsgbsiz - warning message block declared size in bytes.
86 -- A binary_integer set to the byte length of wmgsblk.
87 -- The warning message block must be at least 512 and
88 -- not more than 8192 bytes in length. When declaring
89 -- wmsgblk, plan on approximately 512 bytes per warning
90 -- returned, depending on the nature of the conversion
91 -- requested.
92
93 -- Output parameters:
94 -- wmsgblk - warning message block.
95 -- A raw which may contain multiple warnings in both
96 -- full message and substituted parameter formats, if
97 -- and only if wind was TRUE, in which case wmsgblk
98 -- should be passed to the wmsgcnt function to test if
99 -- warnings were issued and to wmsg to extract any
100 -- warnings which may be present.
101 -- If wind was TRUE and no warnings were issued or if
102 -- wind was FALSE, then the length of wmsgblk is 0.
103 -- wmsgblk does not need to be reset prior to each use.
104 -- The warning message is documented in the Oracle
105 -- Messages and Codes for the RDBMS.
106 -- wmsgblk MUST be allocated and passed as a parameter
107 -- in all cases, regardless of wind value.
108 --
109 -- NOTE: Refer to PGA supported UTL_PG compiler datatypes for
110 -- allowed values of mask, maskopts, envrnmnt, compname, and
111 -- compopts.
112 --
113
114 -- Defaults and optional parameters:
115 -- maskopts - null allowed, no default value
116 -- envrnmnt - null allowed, no default value
117 -- compopts - null allowed, no default value
118
119 -- Return value:
120 -- An Oracle number corresponding in value to r
121
122 -- Errors:
123 -- ORA-8401 invalid compiler name
124 -- ORA-8414 error encounterred
125 -- ORA-8429 raw data has invalid digit in display type data
126 -- ORA-8430 raw data missing leading sign
127 -- ORA-8431 raw data missing zero as defined in picture
128 -- ORA-8433 invalid picture type in convert raw to number
129 -- ORA-8434 raw data has invalid trailing sign
130 -- ORA-8435 picture mask missing leading sign
131 -- ORA-8436 raw data has invalid sign digit
132 -- ORA-8437 invalid picture type in picture mask
133 -- ORA-8441 closed parenthesis is missing in picture mask
134 -- ORA-8443 syntax error in BLANK WHEN ZERO clause in mask options
135 -- ORA-8444 syntax error in JUSTIFIED clause in mask options
136 -- ORA-8445 syntax error in SIGN clause in mask options
137 -- ORA-8446 syntax error in SYNCHRONIZED clause in mask options
138 -- ORA-8447 syntax error in USAGE clause in mask options
139 -- ORA-8448 syntax error in DECIMAL-POINT environment clause
140 -- ORA-8449 invalid numeric symbol found in picture mask
141 -- ORA-8450 invalid specification of CR in picture mask
142 -- ORA-8451 invalid specification of DB in picture mask
143 -- ORA-8452 specification of E in picture mask unsupported
144 -- ORA-8453 more than one V symbol specified in picture mask
145 -- ORA-8454 more than one S symbol specified in picture mask
146 -- ORA-8455 syntax error in CURRENCY SIGN environment clause
147 -- ORA-8456 no sign in picture mask but SIGN clause in mask options
148 -- ORA-8457 syntax error in SEPARATE CHARACTER option of SIGN clause
149 -- ORA-8460 invalid environment clause in environment parameter
150 -- ORA-8462 raw buffer contains invalid decimal data
151 -- ORA-8463 overflow converting decimal number to Oracle number
152 -- ORA-8464 input raw decimal data contains more than 42 digits
153 -- ORA-8466 raw buffer length <len> to short for <type>
154 -- ORA-8468 mask option <option> is not supported
155
156 -- Warnings, if enabled:
157 -- ORA-8498 picture mask overrides mask option USAGE ... to DISPLAY
158 -- ORA-8499 picture mask options ignored by UTL_PG
159
160 /*----------------------------------------------------------------*/
161 /* NUMBER_TO_RAW */
162 /*----------------------------------------------------------------*/
163 FUNCTION number_to_raw(n IN NUMBER,
164 mask IN VARCHAR2,
165 maskopts IN VARCHAR2,
166 envrnmnt IN VARCHAR2,
167 compname IN VARCHAR2,
168 compopts IN VARCHAR2,
169 nlslang IN VARCHAR2,
170 wind IN BOOLEAN,
171 wmsgbsiz IN BINARY_INTEGER,
172 wmsgblk OUT RAW) RETURN RAW;
173 pragma restrict_references (number_to_raw,WNDS,RNDS,WNPS,RNPS);
174
175 -- Convert an Oracle number of declared precision and scale to
176 -- a raw byte-string in the remote host internal format specified
177 -- by mask, maskopts, envrnmnt, compname, and compopts.
178 -- Warnings are issued, if enabled, when the conversion specified
179 -- conflicts with the conversion implied by the data, or when
180 -- conflicting format specifications are supplied.
181
182 -- Input parameters:
183 -- n - the Oracle number which is to be converted
184 -- mask - compiler-datatype mask
185 -- The datatype to be converted, specified in the source
186 -- language of the named compiler (compname). mask
187 -- implies the internal format of the data as encoded
188 -- according to the compiler and host platform.
189 -- maskopts - compiler-datatype mask options, or NULL
190 -- Additional options associated with the mask, as may be
191 -- allowed or required, and is specified in the source
192 -- language of compname. maskopts may further qualify
193 -- the type of conversion needed.
194 -- envrnmnt - compiler environment clause or NULL
195 -- Additional options associated with the environment in
196 -- which the remote data resides, as may be allowed or
197 -- required, and is specified in the source language of
198 -- compname. envrnmnt typically supplies aspects of
199 -- data conversion dictated by customer standards, such
200 -- as decimal point or currency symbols if applicable.
201 -- compname - compiler name, supported values are:
202 -- "IBMVSCOBOLII"
203 -- compopts - compiler options or NULL
204 -- nlslang - zoned-dec codepage in Oracle NLS form:
205 -- language_territory.charset
206 -- or defaults to:
207 -- 'AMERICAN_AMERICA.WE8EBCDIC37C'
208 -- wind - warning indicator.
209 -- A boolean indicator which controls whether conversion
210 -- warning messages are to be returned in the wmsgblk out
211 -- parameter.
212 -- FALSE will suppress all warnings, but errors (if any)
213 -- will still be returned as ORA-nnnnn errors.
214 -- TRUE will cause warnings (if any) to be returned in
215 -- wmsgblk.
216 -- wmsgbsiz - warning message block declared size in bytes.
217 -- A binary_integer set to the byte length of wmgsblk.
218 -- The warning message block must be at least 512 and
219 -- not more than 8192 bytes in length. When declaring
220 -- wmsgblk, plan on approximately 512 bytes per warning
221 -- returned, depending on the nature of the conversion
222 -- requested.
223
224 -- Output parameters:
225 -- wmsgblk - warning message block.
226 -- A raw which may contain multiple warnings in both
227 -- full message and substituted parameter formats, if
228 -- and only if wind was TRUE, in which case wmsgblk
229 -- should be passed to the wmsgcnt function to test if
230 -- warnings were issued and to wmsg to extract any
231 -- warnings which may be present.
232 -- If wind was TRUE and no warnings were issued or if
233 -- wind was FALSE, then the length of wmsgblk is 0.
234 -- wmsgblk does not need to be reset prior to each use.
235 -- The warning message is documented in the Oracle
236 -- Messages and Codes for the RDBMS.
237 -- wmsgblk MUST be allocated and passed as a parameter
238 -- in all cases, regardless of wind value.
239 --
240 -- NOTE: Refer to PGA supported UTL_PG compiler datatypes for
241 -- allowed values of mask, maskopts, envrnmnt, compname, and
242 -- compopts.
243
244 -- Defaults and optional parameters:
245 -- maskopts - null allowed, no default value
246 -- envrnmnt - null allowed, no default value
247 -- compopts - null allowed, no default value
248
249 -- Return value:
250 -- A raw corresponding in value to n.
251
252 -- Errors:
253 -- ORA-8401 invalid compiler name
254 -- ORA-8414 error encounterred
255 -- ORA-8437 invalid picture type in picture mask
256 -- ORA-8441 closed parenthesis is missing in picture mask
257 -- ORA-8443 syntax error in BLANK WHEN ZERO clause in mask options
258 -- ORA-8444 syntax error in JUSTIFIED clause in mask options
259 -- ORA-8445 syntax error in SIGN clause in mask options
260 -- ORA-8446 syntax error in SYNCHRONIZED clause in mask options
261 -- ORA-8447 syntax error in USAGE clause in mask options
262 -- ORA-8448 syntax error in DECIMAL-POINT environment clause
263 -- ORA-8449 invalid numeric symbol found in picture mask
264 -- ORA-8450 invalid specification of CR in picture mask
265 -- ORA-8451 invalid specification of DB in picture mask
266 -- ORA-8452 specification of E in picture mask unsupported
267 -- ORA-8453 more than one V symbol specified in picture mask
268 -- ORA-8454 more than one S symbol specified in picture mask
269 -- ORA-8455 syntax error in CURRENCY SIGN environment clause
270 -- ORA-8456 no sign in picture mask but SIGN clause in mask options
271 -- ORA-8457 syntax error in SEPARATE CHARACTER option of SIGN clause
272 -- ORA-8460 invalid environment clause in environment parameter
273 -- ORA-8466 raw buffer length <len> to short for <type>
274 -- ORA-8467 error encountered converting Oracle number to <type>
275 -- ORA-8468 mask option <option> is not supported
276
277 -- Warnings, if enabled:
278 -- ORA-8498 picture mask overrides mask option USAGE ... to DISPLAY
279 -- ORA-8499 picture mask options ignored by UTL_PG
280
281 /*----------------------------------------------------------------*/
282 /* MAKE_RAW_TO_NUMBER_FORMAT */
283 /*----------------------------------------------------------------*/
284 FUNCTION make_raw_to_number_format(mask IN VARCHAR2,
285 maskopts IN VARCHAR2,
286 envrnmnt IN VARCHAR2,
287 compname IN VARCHAR2,
288 compopts IN VARCHAR2,
289 nlslang IN VARCHAR2,
290 wind IN BOOLEAN,
291 wmsgbsiz IN BINARY_INTEGER,
292 wmsgblk OUT RAW) RETURN RAW;
293 pragma restrict_references (make_raw_to_number_format,WNDS,RNDS,WNPS,RNPS);
294
295 -- Make a raw_to_number format conversion specification used to
296 -- convert a raw byte-string from the remote host internal format
297 -- specified by mask, maskopts, envrnmnt, compname, and compopts
298 -- into an Oracle number of comparable precision and scale.
299 -- Warnings are issued, if enabled, when the conversion specified
300 -- conflicts with the conversion implied by the data, or when
301 -- conflicting format specifications are supplied.
302 -- This function returns a raw containing the conversion format
303 -- which can be passed to UTL_PG.RAW_TO_NUMBER_FORMAT.
304
305 -- Input parameters:
306 -- mask - compiler-datatype mask
307 -- The datatype to be converted, specified in the source
308 -- language of the named compiler (compname). mask
309 -- implies the internal format of the data as encoded
310 -- according to the compiler and host platform.
311 -- maskopts - compiler-datatype mask options, or NULL
312 -- Additional options associated with the mask, as may be
313 -- allowed or required, and is specified in the source
314 -- language of compname. maskopts may further qualify
315 -- the type of conversion needed.
316 -- envrnmnt - compiler environment clause or NULL
317 -- Additional options associated with the environment in
318 -- which the remote data resides, as may be allowed or
319 -- required, and is specified in the source language of
320 -- compname. envrnmnt typically supplies aspects of
321 -- data conversion dictated by customer standards, such
322 -- as decimal point or currency symbols if applicable.
323 -- compname - compiler name, supported values are:
324 -- "IBMVSCOBOLII"
325 -- compopts - compiler options or NULL
326 -- nlslang - zoned-dec codepage in Oracle NLS form:
327 -- language_territory.charset
328 -- or defaults to:
329 -- 'AMERICAN_AMERICA.WE8EBCDIC37C'
330 -- wind - warning indicator.
331 -- A boolean indicator which controls whether conversion
332 -- warning messages are to be returned in the wmsgblk out
333 -- parameter.
334 -- FALSE will suppress all warnings, but errors (if any)
335 -- will still be returned as ORA-nnnnn errors.
336 -- TRUE will cause warnings (if any) to be returned in
337 -- wmsgblk.
338 -- wmsgbsiz - warning message block declared size in bytes.
339 -- A binary_integer set to the byte length of wmgsblk.
340 -- The warning message block must be at least 512 and
341 -- not more than 8192 bytes in length. When declaring
342 -- wmsgblk, plan on approximately 512 bytes per warning
343 -- returned, depending on the nature of the conversion
344 -- requested.
345
346 -- Output parameters:
347 -- wmsgblk - warning message block.
348 -- A raw which may contain multiple warnings in both
349 -- full message and substituted parameter formats, if
350 -- and only if wind was TRUE, in which case wmsgblk
351 -- should be passed to the wmsgcnt function to test if
352 -- warnings were issued and to wmsg to extract any
353 -- warnings which may be present.
354 -- If wind was TRUE and no warnings were issued or if
355 -- wind was FALSE, then the length of wmsgblk is 0.
356 -- wmsgblk does not need to be reset prior to each use.
357 -- The warning message is documented in the Oracle
358 -- Messages and Codes for the RDBMS.
359 -- wmsgblk MUST be allocated and passed as a parameter
360 -- in all cases, regardless of wind value.
361 --
362 -- NOTE: Refer to PGA supported UTL_PG compiler datatypes for
363 -- allowed values of mask, maskopts, envrnmnt, compname, and
364 -- compopts.
365
366 -- Defaults and optional parameters:
367 -- maskopts - null allowed, no default value
368 -- envrnmnt - null allowed, no default value
369 -- compopts - null allowed, no default value
370
371 -- Return value:
372 -- A 2K raw format conversion specification for raw_to_number.
373
374 -- Errors:
375 -- ORA-8401 invalid compiler name
376 -- ORA-8414 error encounterred
377 -- ORA-8433 invalid picture type in convert raw to number
378 -- ORA-8437 invalid picture type in picture mask
379 -- ORA-8441 closed parenthesis is missing in picture mask
380 -- ORA-8443 syntax error in BLANK WHEN ZERO clause in mask options
381 -- ORA-8444 syntax error in JUSTIFIED clause in mask options
382 -- ORA-8445 syntax error in SIGN clause in mask options
383 -- ORA-8446 syntax error in SYNCHRONIZED clause in mask options
384 -- ORA-8447 syntax error in USAGE clause in mask options
385 -- ORA-8448 syntax error in DECIMAL-POINT environment clause
386 -- ORA-8449 invalid numeric symbol found in picture mask
387 -- ORA-8450 invalid specification of CR in picture mask
388 -- ORA-8451 invalid specification of DB in picture mask
389 -- ORA-8452 specification of E in picture mask unsupported
390 -- ORA-8453 more than one V symbol specified in picture mask
391 -- ORA-8454 more than one S symbol specified in picture mask
392 -- ORA-8455 syntax error in CURRENCY SIGN environment clause
393 -- ORA-8456 no sign in picture mask but SIGN clause in mask options
394 -- ORA-8457 syntax error in SEPARATE CHARACTER option of SIGN clause
395 -- ORA-8458 invalid format parameter
396 -- ORA-8459 invalid format parameter length
397 -- ORA-8460 invalid environment clause in environment parameter
398 -- ORA-8467 error encountered converting Oracle number to <type>
399 -- ORA-8468 mask option <option> is not supported
400
401 -- Warnings, if enabled:
402 -- ORA-8498 picture mask overrides mask option USAGE ... to DISPLAY
403 -- ORA-8499 picture mask options ignored by UTL_PG
404
405 /*----------------------------------------------------------------*/
406 /* MAKE_NUMBER_TO_RAW_FORMAT */
407 /*----------------------------------------------------------------*/
408 FUNCTION make_number_to_raw_format(mask IN VARCHAR2,
409 maskopts IN VARCHAR2,
410 envrnmnt IN VARCHAR2,
411 compname IN VARCHAR2,
412 compopts IN VARCHAR2,
413 nlslang IN VARCHAR2,
414 wind IN BOOLEAN,
415 wmsgbsiz IN BINARY_INTEGER,
416 wmsgblk OUT RAW) RETURN RAW;
417 pragma restrict_references (make_number_to_raw_format,WNDS,RNDS,WNPS,RNPS);
418
419 -- Make a number_to_raw format conversion specification used to
420 -- convert an Oracle number of declared precision and scale to
421 -- a raw byte-string in the remote host internal format specified
422 -- by mask, maskopts, envrnmnt, compname, and compopts.
423 -- Warnings are issued, if enabled, when the conversion specified
424 -- conflicts with the conversion implied by the data, or when
425 -- conflicting format specifications are supplied.
426 -- This function returns a raw containing the conversion format
427 -- which can be passed to UTL_PG.NUMBER_TO_RAW_FORMAT.
428 -- The implementation length of the result format raw is 2048 bytes.
429
430 -- Input parameters:
431 -- mask - compiler-datatype mask
432 -- The datatype to be converted, specified in the source
433 -- language of the named compiler (compname). mask
434 -- implies the internal format of the data as encoded
435 -- according to the compiler and host platform.
436 -- maskopts - compiler-datatype mask options, or NULL
437 -- Additional options associated with the mask, as may be
438 -- allowed or required, and is specified in the source
439 -- language of compname. maskopts may further qualify
440 -- the type of conversion needed.
441 -- envrnmnt - compiler environment clause or NULL
442 -- Additional options associated with the environment in
443 -- which the remote data resides, as may be allowed or
444 -- required, and is specified in the source language of
445 -- compname. envrnmnt typically supplies aspects of
446 -- data conversion dictated by customer standards, such
447 -- as decimal point or currency symbols if applicable.
448 -- compname - compiler name, supported values are:
449 -- "IBMVSCOBOLII"
450 -- compopts - compiler options or NULL
451 -- nlslang - zoned-dec codepage in Oracle NLS form:
452 -- language_territory.charset
453 -- or defaults to:
454 -- 'AMERICAN_AMERICA.WE8EBCDIC37C'
455 -- wind - warning indicator.
456 -- A boolean indicator which controls whether conversion
457 -- warning messages are to be returned in the wmsgblk out
458 -- parameter.
459 -- FALSE will suppress all warnings, but errors (if any)
460 -- will still be returned as ORA-nnnnn errors.
461 -- TRUE will cause warnings (if any) to be returned in
462 -- wmsgblk.
463 -- wmsgbsiz - warning message block declared size in bytes.
464 -- A binary_integer set to the byte length of wmgsblk.
465 -- The warning message block must be at least 512 and
466 -- not more than 8192 bytes in length. When declaring
467 -- wmsgblk, plan on approximately 512 bytes per warning
468 -- returned, depending on the nature of the conversion
469 -- requested.
470
471 -- Output parameters:
472 -- wmsgblk - warning message block.
473 -- A raw which may contain multiple warnings in both
474 -- full message and substituted parameter formats, if
475 -- and only if wind was TRUE, in which case wmsgblk
476 -- should be passed to the wmsgcnt function to test if
477 -- warnings were issued and to wmsg to extract any
478 -- warnings which may be present.
479 -- If wind was TRUE and no warnings were issued or if
480 -- wind was FALSE, then the length of wmsgblk is 0.
481 -- wmsgblk does not need to be reset prior to each use.
482 -- The warning message is documented in the Oracle
483 -- Messages and Codes for the RDBMS.
484 -- wmsgblk MUST be allocated and passed as a parameter
485 -- in all cases, regardless of wind value.
486 --
487 -- NOTE: Refer to PGA supported UTL_PG compiler datatypes for
488 -- allowed values of mask, maskopts, envrnmnt, compname, and
489 -- compopts.
490
491 -- Defaults and optional parameters:
492 -- maskopts - null allowed, no default value
493 -- envrnmnt - null allowed, no default value
494 -- compopts - null allowed, no default value
495
496 -- Return value:
497 -- A 2K raw format conversion specification for number_to_raw.
498
499 -- Errors:
500 -- ORA-8401 invalid compiler name
501 -- ORA-8414 error encounterred
502 -- ORA-8437 invalid picture type in picture mask
503 -- ORA-8441 closed parenthesis is missing in picture mask
504 -- ORA-8443 syntax error in BLANK WHEN ZERO clause in mask options
505 -- ORA-8444 syntax error in JUSTIFIED clause in mask options
506 -- ORA-8445 syntax error in SIGN clause in mask options
507 -- ORA-8446 syntax error in SYNCHRONIZED clause in mask options
508 -- ORA-8447 syntax error in USAGE clause in mask options
509 -- ORA-8448 syntax error in DECIMAL-POINT environment clause
510 -- ORA-8449 invalid numeric symbol found in picture mask
511 -- ORA-8450 invalid specification of CR in picture mask
512 -- ORA-8451 invalid specification of DB in picture mask
513 -- ORA-8452 specification of E in picture mask unsupported
514 -- ORA-8453 more than one V symbol specified in picture mask
515 -- ORA-8454 more than one S symbol specified in picture mask
516 -- ORA-8455 syntax error in CURRENCY SIGN environment clause
517 -- ORA-8456 no sign in picture mask but SIGN clause in mask options
518 -- ORA-8457 syntax error in SEPARATE CHARACTER option of SIGN clause
519 -- ORA-8458 invalid format parameter
520 -- ORA-8459 invalid format parameter length
521 -- ORA-8460 invalid environment clause in environment parameter
522 -- ORA-8467 error encountered converting Oracle number to <type>
523 -- ORA-8468 mask option <option> is not supported
524
525 -- Warnings, if enabled:
526 -- ORA-8498 picture mask overrides mask option USAGE ... to DISPLAY
527 -- ORA-8499 picture mask options ignored by UTL_PG
528
529 /*----------------------------------------------------------------*/
530 /* RAW_TO_NUMBER_FORMAT */
531 /*----------------------------------------------------------------*/
532 FUNCTION raw_to_number_format(rawval IN RAW,
533 r2nfmt IN RAW) RETURN NUMBER;
534 pragma restrict_references (raw_to_number_format,WNDS,RNDS,WNPS,RNPS);
535
536 -- Convert, according to the raw_to_number conversion format r2nfmt,
537 -- a raw byte-string rawval in the remote host internal format
538 -- to an Oracle number.
539
540 -- Input parameters:
541 -- rawval - the remote host data which is to be converted
542 -- r2nfmt - a 2K raw format specification returned from
543 -- make_raw_to_number_format
544
545 -- Defaults and optional parameters: None
546
547 -- Return value:
548 -- An Oracle number corresponding in value to r
549
550 -- Errors:
551 -- ORA-8414 error encounterred
552 -- ORA-8429 raw data has invalid digit in display type data
553 -- ORA-8430 raw data missing leading sign
554 -- ORA-8431 raw data missing zero as defined in picture
555 -- ORA-8434 raw data has invalid trailing sign
556 -- ORA-8436 raw data has invalid sign digit
557 -- ORA-8458 invalid format parameter
558 -- ORA-8459 invalid format parameter length
559 -- ORA-8462 raw buffer contains invalid decimal data
560 -- ORA-8463 overflow converting decimal number to Oracle number
561 -- ORA-8464 input raw decimal data contains more than 42 digits
562 -- ORA-8466 raw buffer length <len> to short for <type>
563 -- ORA-8467 error encountered converting Oracle number to <type>
564
565 /*----------------------------------------------------------------*/
566 /* NUMBER_TO_RAW_FORMAT */
567 /*----------------------------------------------------------------*/
568 FUNCTION number_to_raw_format(numval IN NUMBER,
569 n2rfmt IN RAW) RETURN RAW;
570 pragma restrict_references (number_to_raw_format,WNDS,RNDS,WNPS,RNPS);
571
572 -- Convert, according to the number_to_raw conversion format n2rfmt,
573 -- an Oracle number numval of declared precision and scale to a
574 -- raw byte-string in the remote host internal format.
575
576 -- Input parameters:
577 -- numval - the Oracle number which is to be converted
578 -- n2rfmt - a 2K raw format specification returned from
579 -- make_number_to_raw_format
580
581 -- Defaults and optional parameters: None
582
583 -- Return value:
584 -- A raw corresponding in value to n.
585
586 -- Errors:
587 -- ORA-8414 error encounterred
588 -- ORA-8458 invalid format parameter
589 -- ORA-8459 invalid format parameter length
590 -- ORA-8467 error encountered converting Oracle number to <type>
591
592 /*----------------------------------------------------------------*/
593 /* WMSGCNT */
594 /*----------------------------------------------------------------*/
595 FUNCTION wmsgcnt(wmsgblk IN RAW) RETURN BINARY_INTEGER;
596 pragma restrict_references (wmsgcnt,WNDS,RNDS,WNPS,RNPS);
597
598 -- Tests a wmsgblk to determine how many warnings (if any) may
599 -- be present.
600
601 -- Input parameters:
602 -- wmsgblk - warning message block returned from:
603 -- number_to_raw
604 -- raw_to_number
605 -- make_raw_to_number_format
606 -- make_number_to_raw_format
607
608 -- Defaults and optional parameters: None
609
610 -- Return value:
611 -- A binary_integer equal to the count of warnings present in the
612 -- wmsgblk raw.
613 -- Possible returned values are:
614 -- >0 - positive count of warnings present in wmsgblk.
615 -- 0 - no warnings present in wmsgblk.
616
617 -- Errors:
618 -- Return value:
619 -- Possible return values are:
620 -- -2 - invalid message block.
621
622 /*----------------------------------------------------------------*/
623 /* WMSG */
624 /*----------------------------------------------------------------*/
625 FUNCTION wmsg(wmsgblk IN RAW,
626 wmsgitem IN BINARY_INTEGER,
627 wmsgno OUT BINARY_INTEGER,
628 wmsgtext OUT VARCHAR2,
629 wmsgfill OUT VARCHAR2) RETURN BINARY_INTEGER;
630 pragma restrict_references (wmsg,WNDS,RNDS,WNPS,RNPS);
631
632 -- Extract a warning message specified by wmsgitem from wmsgblk.
633
634 -- Input parameters:
635 -- wmsgblk - A raw, the warning message block returned from:
636 -- number_to_raw
637 -- raw_to_number
638 -- make_raw_to_number_format
639 -- make_number_to_raw_format
640 -- wmsgitem - A binary_integer specifying which warning message
641 -- to extract, numbered from 0 as the first warning
642 -- through n-1 for the Nth warning.
643
644 -- Output parameters:
645 -- wmsgno - A binary_integer (hexadecimal) value of the
646 -- warning number. This value, after conversion to
647 -- decimal, is documented in the Oracle Messages and
648 -- Codes for the RDBMS.
649 -- wmsgtext - A varchar2 containing the fully formated warning
650 -- message in the format:
651 -- ORA-nnnnn warning message text
652 -- where nnnnn is the decimal warning number documented
653 -- in the Oracle Messages and Codes for the RDBMS.
654 -- wmsgfill - A varchar2 containing the list of warning message
655 -- parameters to be substituted into a warning message
656 -- in the format:
657 -- warnparm1;;warnparm2;;...;;warnparmN
658 -- where each warning parameter is delimited by a
659 -- double semi-colon ';;'.
660
661 -- Defaults and optional parameters: None
662
663 -- Return value:
664 -- A binary_integer containing a status return code.
665 -- 0 - wmsgno, wmsgtext, and wmsgfill are assigned and valid.
666
667 -- Errors:
668 -- Return value:
669 -- Possible return values are:
670 -- -1 - warning specified by wmsgitem not found in wmsgblk.
671 -- -2 - invalid message block.
672 -- -3 - wmsgblk is too small to contain the warning associated
673 -- with wmsgitem. Only a partial or possibly no warning
674 -- message may be present for this particular wmsgitem.
675 -- -4 - too many substituted warning parameters.
676
677 END UTL_PG;