Skip to content

Instantly share code, notes, and snippets.

@sachin-handiekar
Created November 18, 2014 16:11
Show Gist options
  • Save sachin-handiekar/c023f695dadbc5c63419 to your computer and use it in GitHub Desktop.
Save sachin-handiekar/c023f695dadbc5c63419 to your computer and use it in GitHub Desktop.
OracleAQ-Dequeue
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