Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

Using Advanced Queuing Interfaces

Oracle Objects for OLE provides the OraAQ Automation interface with methods for enqueuing and dequeuing messages. The OraAQMsg object contains the message to be enqueued or dequeued. The message can be a raw message or any user-defined type.

The following examples illustrate how to enqueue RAW messages from the queue DBQ. Note that DBQ must already be created in the database.

Dim Q as OraAQ

Dim Msg as OraAQMsg

set OO4OSession = CreateObject("OracleInProcServer.XOraSession")

set empDb = OO4OSession.OpenDatabase("ExampleDb", "scott/tiger", 0)

Set Q = empDb.CreateAQ("DBQ")

Retrieve the message object from the Q object.

set Msg = Q.AQMsg

Specify the message value.

Msg.Value = "This is the first Test message"

Enqueue the message.

Q.Enqueue

The following lines enqueue a high priority message.

Msg.Priority = ORAQMSG_HIGH_PRIORITY

Msg.Delay = 5

Msg.Value = "Urgent message"

Q.Enqueue

The following example dequeues the RAW messages from the Oracle server and displays the message content.

Q.Dequeue

MsgBox Msg.value

Dequeue and display the first high priority message

Msg.Priority = ORAQMSG_HIGH_PRIORITY

Q.Dequeue

MsgBox Msg.value