Browsing a Queue Table
To browse a queue table is to select from it as you would a non‑queue table.
The following list of queries provides some peeks at a queue without consuming any rows.
If the depth is zero, then the system places a consume mode SELECT request into a delayed state.
WHERE qits = (SELECT MIN(qits)
SELECT TOP 10 *
ORDER BY QITS;
ORDER BY myqueue_qits;
To determine the duration of a queue table, you can perform the following request.
SELECT TOP 1 CURRENT_TIMESTAMP, qits, (CURRENT_TIMESTAMP - qits) DAY(4) TO SECOND AS queue_duration
ORDER BY qits;
The report generated by this query might look something like the following.
*** Query completed. One row found. 3 columns returned.
Current Timestamp (6) 2004-05-19 14:30:01.420000+00:00
Q Insertion Time 2004-05-18 08:44:19.460000
queue_duration 1 05:45:41.960000