Oracle Objects for OLE Release 9.2 Part Number A95895-01 |
|
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
|
Copyright © 1994, 2002 Oracle Corporation. All Rights Reserved. |
|