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.

end;<br />

/<br />

show errors;<br />

tkaqdocp.sql: Examples of Operational Interfaces<br />

dbms_output.put_line(' **** NEXT ORDER **** ');<br />

dbms_output.put_line('order_num: ' ||<br />

deq_order_data.orderno);<br />

dbms_output.put_line('ship_state: ' ||<br />

deq_cust_data.state);<br />

END IF;<br />

dbms_output.put_line(' ---- next book ---- ');<br />

dbms_output.put_line(' book_title: ' ||<br />

deq_book_data.title ||<br />

' quantity: ' || deq_item_data.quantity);<br />

EXCEPTION<br />

WHEN end_of_group THEN<br />

dbms_output.put_line ('*** END OF ORDER ***');<br />

commit;<br />

dopt.navigation := DBMS_AQ.NEXT_TRANSACTION;<br />

END;<br />

END LOOP;<br />

EXCEPTION<br />

WHEN no_messages THEN<br />

dbms_output.put_line (' ---- NO MORE NEW ORDERS ---- ');<br />

new_orders := FALSE;<br />

END;<br />

END LOOP;<br />

grant execute on get_new_orders to OE;<br />

Rem Login into OE account<br />

connect OE/OE;<br />

set serveroutput on;<br />

Rem<br />

Rem Enqueue some orders using message grouping into OE_neworders_que<br />

Rem<br />

Rem First Order<br />

execute BOLADM.new_order_enq('My First Book', 1, 1001, 'CA');<br />

execute BOLADM.same_order_enq('My Second Book', 2);<br />

commit;<br />

/<br />

Scripts for Implementing BooksOnLine C-35

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

Saved successfully!

Ooh no, something went wrong!