Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
.. _dpiDeqOptionsFunctions:

ODPI-C Dequeue Options Functions
--------------------------------

Dequeue option handles are used to represent the options specified when
dequeuing messages using advanced queueing. They are created by calling the
function :func:`dpiConn_newDeqOptions()` and are destroyed by releasing the
last reference by calling the function :func:`dpiDeqOptions_release()`.

.. function:: int dpiDeqOptions_addRef(dpiDeqOptions* options)

    Adds a reference to the dequeue options. This is intended for situations
    where a reference to the dequeue options needs to be maintained
    independently of the reference returned when the handle was created.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - The dequeue options to which a reference is to be added. If the
            reference is NULL or invalid, an error is returned.

.. function:: int dpiDeqOptions_getCondition(dpiDeqOptions* options, \
        const char** value, uint32_t* valueLength)

    Returns the condition that must be satisfied in order for a message to be
    dequeued. See function :func:`dpiDeqOptions_setCondition()` for more
    information.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options from which the condition is to
            be retrieved. If the reference is NULL or invalid, an error is
            returned.
        * - ``value``
          - OUT
          - A pointer to the value, as a byte string in the encoding used for
            CHAR data, which will be populated upon successful completion of
            this function. If there is no condition, the pointer will be
            populated with the value NULL.
        * - ``valueLength``
          - OUT
          - A pointer to the length of the value, in bytes, which will be
            populated upon successful completion of this function. If there
            is no condition, the pointer will be populated with the value 0.

.. function:: int dpiDeqOptions_getConsumerName(dpiDeqOptions* options, \
        const char** value, uint32_t* valueLength)

    Returns the name of the consumer that is dequeuing messages. See function
    :func:`dpiDeqOptions_setConsumerName()` for more information.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options from which the consumer name
            is to be retrieved. If the reference is NULL or invalid, an error
            is returned.
        * - ``value``
          - OUT
          - A pointer to the value, as a byte string in the encoding used for
            CHAR data, which will be populated upon successful completion of
            this function. If there is no consumer name, the pointer will be
            populated with the value NULL.
        * - ``valueLength``
          - OUT
          - A pointer to the length of the value, in bytes, which will be
            populated upon successful completion of this function. If there
            is no consumer name, the pointer will be populated with the value
            0.

.. function:: int dpiDeqOptions_getCorrelation(dpiDeqOptions* options, \
        const char** value, uint32_t* valueLength)

    Returns the correlation of the message to be dequeued. See function
    :func:`dpiDeqOptions_setCorrelation()` for more information.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options from which the correlation
            is to be retrieved. If the reference is NULL or invalid, an error
            is returned.
        * - ``value``
          - OUT
          - A pointer to the value, as a byte string in the encoding used for
            CHAR data, which will be populated upon successful completion of
            this function. If there is no correlation, the pointer will be
            populated with the value NULL.
        * - ``valueLength``
          - OUT
          - A pointer to the length of the value, in bytes, which will be
            populated upon successful completion of this function. If there
            is no correlation, the pointer will be populated with the value
            0.

.. function:: int dpiDeqOptions_getMode(dpiDeqOptions* options, \
        dpiDeqMode* value)

    Returns the mode that is to be used when dequeuing messages.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options from which the mode is to be
            retrieved. If the reference is NULL or invalid, an error is
            returned.
        * - ``value``
          - OUT
          - A pointer to the value, which will be populated upon successful
            completion of this function. It will be one of the values from
            the enumeration :ref:`dpiDeqMode<dpiDeqMode>`.

.. function:: int dpiDeqOptions_getMsgId(dpiDeqOptions* options, \
        const char** value, uint32_t* valueLength)

    Returns the identifier of the specific message that is to be dequeued.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options from which the message
            identifier is to be retrieved. If the reference is NULL or invalid,
            an error is returned.
        * - ``value``
          - OUT
          - A pointer to the value, which will be populated upon successful
            completion of this function. If there is no message identifier, the
            pointer will be populated with the value NULL.
        * - ``valueLength``
          - OUT
          - A pointer to the length of the value, in bytes, which will be
            populated upon successful completion of this function. If there
            is no message identifier, the pointer will be populated with the
            value 0.

.. function:: int dpiDeqOptions_getNavigation(dpiDeqOptions* options, \
        dpiDeqNavigation* value)

    Returns the position of the message that is to be dequeued.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options from which the navigation
            option is to be retrieved. If the reference is NULL or invalid,
            an error is returned.
        * - ``value``
          - OUT
          - A pointer to the value, which will be populated upon successful
            completion of this function. It will be one of the values from
            the enumeration :ref:`dpiDeqNavigation<dpiDeqNavigation>`.

.. function:: int dpiDeqOptions_getTransformation(dpiDeqOptions* options, \
        const char** value, uint32_t* valueLength)

    Returns the transformation of the message to be dequeued. See function
    :func:`dpiDeqOptions_setTransformation()` for more information.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options from which the transformation
            is to be retrieved. If the reference is NULL or invalid, an
            error is returned.
        * - ``value``
          - OUT
          - A pointer to the value, as a byte string in the encoding used for
            CHAR data, which will be populated upon successful completion of
            this function. If there is no transformation, the pointer will be
            populated with the value NULL.
        * - ``valueLength``
          - OUT
          - A pointer to the length of the value, in bytes, which will be
            populated upon successful completion of this function. If there is
            no transformation, the pointer will be populated with the value 0.

.. function:: int dpiDeqOptions_getVisibility(dpiDeqOptions* options, \
        dpiVisibility* value)

    Returns whether the message being dequeued is part of the current
    transaction or constitutes a transaction on its own.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options from which the visibility
            is to be retrieved. If the reference is NULL or invalid, an
            error is returned.
        * - ``value``
          - OUT
          - A pointer to the value, which will be populated upon successful
            completion of this function. It will be one of the values from
            the enumeration :ref:`dpiVisibility<dpiVisibility>`.

.. function:: int dpiDeqOptions_getWait(dpiDeqOptions* options, \
        uint32_t* value)

    Returns the time to wait, in seconds, for a message matching the search
    criteria. See function :func:`dpiDeqOptions_setWait()` for more
    information.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options from which the wait time
            is to be retrieved. If the reference is NULL or invalid, an
            error is returned.
        * - ``value``
          - OUT
          - A pointer to the value, which will be populated upon successful
            completion of this function.

.. function:: int dpiDeqOptions_release(dpiDeqOptions* options)

    Releases a reference to the dequeue options. A count of the references to
    the dequeue options is maintained and when this count reaches zero, the
    memory associated with the options is freed.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - The dequeue options from which a reference is to be released. If
            the reference is NULL or invalid, an error is returned.

.. function:: int dpiDeqOptions_setCondition(dpiDeqOptions* options, \
        const char* value, uint32_t valueLength)

    Sets the condition which must be true for messages to be dequeued. The
    condition must be a valid boolean expression similar to the where clause
    of a SQL query. The expression can include conditions on message
    properties, user data properties and PL/SQL or SQL functions. User data
    properties must be prefixed with tab.user_data as a qualifier to indicate
    the specific column of the queue table that stores the message payload.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options on which the condition is to
            be set. If the reference is NULL or invalid, an error is returned.
        * - ``value``
          - IN
          - A byte string in the encoding used for CHAR data, or NULL if the
            condition is to be cleared.
        * - ``valueLength``
          - IN
          - The length of the value parameter in bytes, or 0 if the value
            parameter is NULL.

.. function:: int dpiDeqOptions_setConsumerName(dpiDeqOptions* options, \
        const char* value, uint32_t valueLength)

    Sets the name of the consumer which will be dequeuing messages. This value
    should only be set if the queue is set up for multiple consumers.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options on which the consumer name is to
            be set. If the reference is NULL or invalid, an error is returned.
        * - ``value``
          - IN
          - A byte string in the encoding used for CHAR data, or NULL if the
            consumer name is to be cleared.
        * - ``valueLength``
          - IN
          - The length of the value parameter in bytes, or 0 if the value
            parameter is NULL.

.. function:: int dpiDeqOptions_setCorrelation(dpiDeqOptions* options, \
        const char* value, uint32_t valueLength)

    Sets the correlation of the message to be dequeued. Special pattern
    matching characters such as the percent sign (%) and the underscore (_)
    can be used. If multiple messages satisfy the pattern, the order of
    dequeuing is undetermined.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options on which the correlation is to
            be set. If the reference is NULL or invalid, an error is returned.
        * - ``value``
          - IN
          - A byte string in the encoding used for CHAR data, or NULL if the
            correlation is to be cleared.
        * - ``valueLength``
          - IN
          - The length of the value parameter in bytes, or 0 if the value
            parameter is NULL.

.. function:: int dpiDeqOptions_setDeliveryMode(dpiDeqOptions* options, \
        dpiMessageDeliveryMode value)

    Sets the message delivery mode that is to be used when dequeuing messages.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options on which the message delivery
            mode is to be set. If the reference is NULL or invalid, an error is
            returned.
        * - ``value``
          - IN
          - The mode that should be used. It should be one of the values from
            the enumeration :ref:`dpiMessageDeliveryMode<dpiMessageDeliveryMode>`.

.. function:: int dpiDeqOptions_setMode(dpiDeqOptions* options, \
        dpiDeqMode value)

    Sets the mode that is to be used when dequeuing messages.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options on which the mode is to be set.
            If the reference is NULL or invalid, an error is returned.
        * - ``value``
          - IN
          - The mode that should be used. It should be one of the values from
            the enumeration :ref:`dpiDeqMode<dpiDeqMode>`.

.. function:: int dpiDeqOptions_setMsgId(dpiDeqOptions* options, \
        const char* value, uint32_t valueLength)

    Sets the identifier of the specific message to be dequeued.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options on which the message identifier
            is to be set. If the reference is NULL or invalid, an error is
            returned.
        * - ``value``
          - IN
          - A pointer to the bytes making up the message identifier, or NULL
            if no specific message is to be dequeued.
        * - ``valueLength``
          - IN
          - The length of the value parameter in bytes, or 0 if the value
            parameter is NULL.

.. function:: int dpiDeqOptions_setNavigation(dpiDeqOptions* options, \
        dpiDeqNavigation value)

    Sets the position in the queue of the message that is to be dequeued.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options on which the navigation option
            is to be set. If the reference is NULL or invalid, an error is
            returned.
        * - ``value``
          - IN
          - The value that should be used. It should be one of the values
            from the enumeration :ref:`dpiDeqNavigation<dpiDeqNavigation>`.

.. function:: int dpiDeqOptions_setTransformation(dpiDeqOptions* options, \
        const char* value, uint32_t valueLength)

    Sets the transformation of the message to be dequeued. The transformation
    is applied after the message is dequeued but before it is returned to the
    application. It must be created using DBMS_TRANSFORM.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options on which the transformation
            is to be set. If the reference is NULL or invalid, an error is
            returned.
        * - ``value``
          - IN
          - A byte string in the encoding used for CHAR data, or NULL if the
            transformation is to be cleared.
        * - ``valueLength``
          - IN
          - The length of the value parameter in bytes, or 0 if the value
            parameter is NULL.

.. function:: int dpiDeqOptions_setVisibility(dpiDeqOptions* options, \
        dpiVisibility value)

    Sets whether the message being dequeued is part of the current transaction
    or constitutes a transaction on its own.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options on which the visibility
            is to be set. If the reference is NULL or invalid, an error is
            returned.
        * - ``value``
          - IN
          - The value that should be used. It should be one of the values
            from the enumeration :ref:`dpiVisibility<dpiVisibility>`.

.. function:: int dpiDeqOptions_setWait(dpiDeqOptions* options, \
        uint32_t value)

    Set the time to wait, in seconds, for a message matching the search
    criteria.

    The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

    .. parameters-table::

        * - ``options``
          - IN
          - A reference to the dequeue options on which the wait time is to
            be set. If the reference is NULL or invalid, an error is
            returned.
        * - ``value``
          - IN
          - The number of seconds to wait for a message matching the search
            criteria. Any integer is valid but the predefined constants
            DPI_DEQ_WAIT_NO_WAIT and DPI_DEQ_WAIT_FOREVER are provided as a
            convenience.