Created
November 18, 2014 16:11
-
-
Save sachin-handiekar/c023f695dadbc5c63419 to your computer and use it in GitHub Desktop.
OracleAQ-Dequeue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET serveroutput ON format word_wrapped; | |
DECLARE | |
queue_options DBMS_AQ.DEQUEUE_OPTIONS_T; | |
message_properties DBMS_AQ.MESSAGE_PROPERTIES_T; | |
message_id RAW(16); | |
MESSAGE SYS.XMLType; | |
no_messages EXCEPTION; | |
PRAGMA EXCEPTION_INIT (no_messages, -25228); | |
BEGIN | |
queue_options.wait := 1; | |
DBMS_AQ.dequeue(queue_name => 'q_sample', | |
dequeue_options => queue_options, | |
message_properties => message_properties, | |
payload => MESSAGE, | |
msgid => message_id); | |
COMMIT; | |
DBMS_OUTPUT.put_line('XML Payload : ' || message.getStringVal()); | |
EXCEPTION | |
WHEN no_messages THEN | |
DBMS_OUTPUT.put_line (' ---- NO MORE MESSAGES ---- '); | |
END; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment