| |
 |
|
Oracle Tips by Burleson |
Chapter 4 -
Chaining Oracle Jobs Together
Conditional Job Runs Using Oracle Advanced
Queuing
-- -----------------------------------------------------------------
PROCEDURE dequeue_message (p_queue_name IN
VARCHAR2) AS
--
-----------------------------------------------------------------
l_dequeue_options
DBMS_AQ.dequeue_options_t;
l_message_properties
DBMS_AQ.message_properties_t;
l_message_handle
RAW(16);
l_job_chain_msg job_chain_msg_type;
BEGIN
DBMS_AQ.dequeue(queue_name => 'job_user.'
|| p_queue_name,
dequeue_options => l_dequeue_options,
message_properties => l_message_properties,
payload => l_job_chain_msg,
msgid =>
l_message_handle);
END dequeue_message;
--
-----------------------------------------------------------------
END job_chain_aq;
/
SHOW ERRORS
Next, the jobs associated with each task are
scheduled. Unlike the previous example, the job sequence is
protected by the queue, so all the jobs can be enabled.
 |
For more details and scripts, see my new book "
Oracle
Tuning: The Definitive Reference", over 900 pages
of BC's favorite tuning tips & scripts.
You can buy it direct from the publisher for 30%-off and get
instant access to the code depot. |
|