09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

General Features of <strong>Advanced</strong> <strong>Queuing</strong><br />

You can also create payloads that contain <strong>Oracle</strong> objects with XMLType attributes.<br />

These can be used for transmitting and storing messages that contain XML<br />

documents. By defining <strong>Oracle</strong> objects with XMLType attributes, you can do the<br />

following:<br />

Store more than one type of XML document in the same queue. The documents<br />

<br />

are stored internally as CLOBs.<br />

Query XMLType attributes using the operators XMLType.existsNode(),<br />

<br />

XMLType.extract(), and so on.<br />

PL/SQL (DBMS_AQADM Package): Scenario and Code<br />

The BooksOnLine application uses a rich set of data types to model book orders as<br />

message content.<br />

Customers are modeled as an object type called customer_typ.<br />

CREATE OR REPLACE TYPE customer_typ AS OBJECT (<br />

custno NUMBER,<br />

name VARCHAR2(100),<br />

street VARCHAR2(100),<br />

city VARCHAR2(30),<br />

state VARCHAR2(2),<br />

zip NUMBER,<br />

country VARCHAR2(100));<br />

Books are modeled as an object type called book_typ.<br />

<br />

CREATE OR REPLACE TYPE book_typ AS OBJECT (<br />

title VARCHAR2(100),<br />

authors VARCHAR2(100),<br />

ISBN NUMBER,<br />

price NUMBER);<br />

An order item that represents an order line item is modeled as an object type<br />

<br />

called orderitem_typ. An order item is a nested type that includes the book<br />

type.<br />

CREATE OR REPLACE TYPE orderitem_typ AS OBJECT (<br />

quantity NUMBER,<br />

item BOOK_TYP,<br />

subtotal NUMBER);<br />

An order item list is used to represent a list of order line items and is modeled<br />

<br />

as a varray of order items;<br />

8-12 <strong>Oracle</strong>9i Application Developer’s Guide - <strong>Advanced</strong> <strong>Queuing</strong>

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

Saved successfully!

Ooh no, something went wrong!