09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

length is a variable of type NUMBER. */<br />

Propagation Features<br />

/* Complete the order data and perform the enqueue using the order_enq()<br />

procedure: */<br />

dbms_aq.enqueue('OE.OE_bookedorders_que', enqopt, msgprop,<br />

OE_enq_order_data, enq_msgid);<br />

/* Get the lob locator in the queue table after enqueue: */<br />

SELECT t.user_data.coupon INTO lob_loc<br />

FROM OE.OE_orders_pr_mqtab t<br />

WHERE t.msgid = enq_msgid;<br />

/* Generate a sample LOB of 100 bytes: */<br />

buffer := hextoraw(rpad('FF',100,'FF'));<br />

/* Fill in the lob using LOB routines in the dbms_lob package: */<br />

dbms_lob.write(lob_loc, 90, 1, buffer);<br />

/* Issue a commit only after filling in lob contents: */<br />

COMMIT;<br />

/* Sleep until propagation is complete: */<br />

/* Perform dequeue at the Western Shipping warehouse: */<br />

dbms_aq.dequeue(<br />

queue_name => qname,<br />

dequeue_options => dopt,<br />

message_properties => mprop,<br />

payload => deq_order_data,<br />

msgid => deq_msgid);<br />

/* Get the LOB locator after dequeue: */<br />

lob_loc := deq_order_data.coupon;<br />

/* Get the length of the LOB: */<br />

length := dbms_lob.getlength(lob_loc);<br />

/* Read the LOB contents into the buffer: */<br />

dbms_lob.read(lob_loc, length, 1, buffer);<br />

Visual Basic (OO4O): Example Code<br />

This functionality is not available currently.<br />

A Sample Application Using AQ 8-113

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!