Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 907487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:33:50+00:00 2026-05-15T16:33:50+00:00

Somebody knows how to implement Oracle Advance Queue from C# using PL/SSQL and ODP.NET?

  • 0

Somebody knows how to implement Oracle Advance Queue from C# using PL/SSQL and ODP.NET?
I can’t find a single example or resource with concrete examples in C# or VB.NET.
Ideally I would like some examples on how the enqueue and dequeue messages with simple types (XMl/string).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:33:51+00:00Added an answer on May 15, 2026 at 4:33 pm

    I can’t help you with the best practices, but I can help you with a UDT Queue. Before you deal with the queue, you need to generate custom types from the database into your C# project. Assuming you have Visual Studio and ODP.NET installed, you simply need to connect to the database through the Server Explorer, locate your UDTs, right click and choose “Generate Custom Class…” These classes map directly to your UDTs and are used to store the Dequeued information.

    Here is an example of the code you would use to enqueue a message:

    private void main(string[] args)
    {
        string _connstring = "Data Source=host/DB;User
        Id=USER;Password=PASSWORD1;";
    
            OracleConnection _connObj = new OracleConnection(_connstring);
    
            // Create a new queue object
            OracleAQQueue _queueObj = new OracleAQQueue("UDT_NAME", _connObj);
    
            _connObj.Open();
    
            OracleTransaction _txn = _connObj.BeginTransaction();
    
            // Set the payload type to your UDT
            _queueObj.MessageType = OracleAQMessageType.Udt;
            _queueObj.UdtTypeName = "UDT_NAME";
    
            // Create a new message object
            OracleAQMessage _msg = new OracleAQMessage();
    
            // Create an instance of JobClass and pass it in as the payload for the
            // message
            UDT_CUSTOM_CLASS _custClass = new UDT_CUSTOM_CLASS();
            // Load up all of the properties of custClass
            custClass.CustString = "Custom String";
            custClass.CustInt = 5;
    
            _msg.Payload = custClass;
    
            // Enqueue the message
            _queueObj.EnqueueOptions.Visibility = OracleAQVisibilityMode.OnCommit;
            _queueObj.Enqueue(_msg);
    
            _txn.Commit();
            _queueObj.Dispose();
            _connObj.Close();
            _connObj.Dispose();
            _connObj = null;
    }
    

    It’s a similar process to dequeue:

    private void main(string[] args)
    {
        string _connstring = "Data Source=host/DB;User
        Id=USER;Password=PASSWORD1;";
    
        OracleConnection _connObj = new OracleConnection(_connstring);
    
        // Create a new queue object
        OracleAQQueue _queueObj = new OracleAQQueue("UDT_NAME", _connObj);
    
        // Set the payload type to your UDT
        _queueObj.MessageType = OracleAQMessageType.Udt;
        _queueObj.UdtTypeName = "UDT_NAME";
    
        _connObj.Open();
    
        OracleTransaction _txn = _connObj.BeginTransaction();
    
        // Dequeue the message.
        _queueObj.DequeueOptions.Visibility = OracleAQVisibilityMode.OnCommit;
        _queueObj.DequeueOptions.Wait = 10;
        OracleAQMessage _deqMsg = _queueObj.Dequeue();
    
        UDT_CUSTOM_CLASS data = (UDT_CUSTOM_CLASS)_deqMsg.Payload;
    
        // At this point, you have the data and can do whatever you need to do with it
    
        _txn.Commit();
        _queueObj.Dispose();
        _connObj.Close();
        _connObj.Dispose();
        _connObj = null;
    
    }
    

    That’s a “simple” example. I pulled most of that out of Pro ODP.NET for Oracle Database 11g by Ed Zehoo. It’s an excellent book and I strongly recommend it to help you gain a better understanding of the ins and outs of all things OPD.NET. You can buy the eBook here: http://apress.com/book/view/9781430228202. If you enter the coupon code MACWORLDOC, you can get the eBook for $21.00. That offer is only good for the eBook which comes in a password protected PDF format. I hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Somebody knows an example of this? an application made with JSF 2.0 and EJB
I'm using Ruby on rails. Does somebody know how can I insert a javascript
Is was starting to implement one but was wondering if somebody knows about an
Does somebody know of a tutorial or an example of how to implement the
Somebody knows how can I open Android´s Settings screen with code? Thank you.
Does somebody knows where the file with the actual stored SharedPreferences is located?
i would to know if somebody knows a methodology or whatever that be capable
Does somebody know a module, which has a function that returns ( for example
Can somebody please let me know how we can determine if a local disk
Before somebody points me to that question, I know that one can't parse html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.