Solved

Dequeueing by message id

Posted on 2014-01-30
4
893 Views
Last Modified: 2014-02-02
I'm attempting to dequeue a specific message by its message ID using PL/SQL.

I retrieve the message ID from the queue table, but when I run the dequeue, I get
ORA-25263, no message in queue SCHEMA.QUEUE with message ID C0C68C7D93694022A93157ED55406D53"

What am I doing wrong? I also tried hextoraw() on the msgid but that made no difference.
script.sql
0
Comment
Question by:Elisas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 39821485
See if the following note from Oracle Support helps:
ORA-25263 Returned While Dequeueing a Message From AQ Using DBMS_AQ.NO_WAIT option (Doc ID 1344845.1)

It is for NO_WAIT but based on the online docs you are only waiting 1 second so it might be the same thing.
0
 

Author Comment

by:Elisas
ID: 39823924
A greater delay does not seem to make a difference (I've tried as long as 10 minutes).

I have no access to the trace file so I cannot confirm or deny an ORA-00054 as the doc you're referring to suggests, but there are no other processes working on the queue so I don't see why there would be a lock.
Also, dequeueing the entire queue without specifying a message id works just fine.
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39823966
Sorry but that is all the information I can locate.

If you have a test case that creates the queue, enqueues a message then tries to dequeue, I'll be happy to run it on me development database to see if I can reproduce what you are seeing and attempt to figure out the issue.

If not, I suggest you open an SR with Oracle Support.  They will have the necessary tools to help you troubleshoot this and trace properly if necessary.
0
 

Author Comment

by:Elisas
ID: 39828814
I realized what went wrong as I was making a test case. Now I just feel stupid.

Since I'm dequeueing in a loop, the message is gone on the 2nd iteration. Since an exception then is thrown, the queue is apparently rolled back.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question