Unix Technical Forum

DBMS_AQ

This is a discussion on DBMS_AQ within the Oracle Miscellaneous forums, part of the Oracle Database category; --> dears. i have a procedure in my ora-db that permanently dequeus messages from an oracle-queue. like: dequeue_options.navigation := DBMS_AQ.first_message; ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 10:26 AM
roy
 
Posts: n/a
Default DBMS_AQ

dears.

i have a procedure in my ora-db that permanently dequeus messages from
an oracle-queue.
like:

dequeue_options.navigation := DBMS_AQ.first_message;
LOOP
DBMS_AQ.dequeue (queue_name =>
'PRESEL_REQ',
dequeue_options =>
dequeue_options,
message_properties =>
message_properties,
payload => payload,
msgid => msgid
);
dequeue_options.navigation := DBMS_AQ.next_message;
END LOOP;

what options du i have to handle this procedure - means how to start
and how to stop?
for the moment i start this procedure by calling it in an oracle job
und stop it with kill -9 <spid>.

is there a better way to do this?

best regards,

roy

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 10:26 AM
Brian Peasland
 
Posts: n/a
Default Re: DBMS_AQ

roy wrote:
> dears.
>
> i have a procedure in my ora-db that permanently dequeus messages from
> an oracle-queue.
> like:
>
> dequeue_options.navigation := DBMS_AQ.first_message;
> LOOP
> DBMS_AQ.dequeue (queue_name =>
> 'PRESEL_REQ',
> dequeue_options =>
> dequeue_options,
> message_properties =>
> message_properties,
> payload => payload,
> msgid => msgid
> );
> dequeue_options.navigation := DBMS_AQ.next_message;
> END LOOP;
>
> what options du i have to handle this procedure - means how to start
> and how to stop?
> for the moment i start this procedure by calling it in an oracle job
> und stop it with kill -9 <spid>.
>
> is there a better way to do this?
>
> best regards,
>
> roy
>


My first question is why are you creating a job that deletes messages
from the queue? Don't the subscribers need those messages? Why not have
them delete the message once they have consumed the message?

But more specifically to your question, you have to kill this job
because you have coded a loop with no exit condition. You need an EXIT
WHEN statement somewhere inside the loop. You'll probably want this at
the end, when the call to DBMS_AQ.next_message does not return a valid
message. So you'll need some sort of conditional (IF-THEN) testing for
the exit point, and then exit from the loop.

HTH,
Brian

--
================================================== =================

Brian Peasland
oracle_dba@nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:34 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com