Oracle9i Application Developer's Guide - Advanced Queuing Release 1 (9.0.1) Part Number A88890-02 |
|
Scripts for Implementing 'BooksOnLine', 4 of 6
Rem Rem $Header: tkaqdoce.sql 26-jan-99.17:51:28 aquser1 Exp $ Rem Rem tkaqdocl.sql Rem Rem Copyright (c) Oracle Corporation 1998, 1999. All Rights Reserved. Rem set echo on Rem ================================================================== Rem Demonstrate enqueuing a backorder with delay time set Rem to 1 day. This will guarantee that each backorder will Rem be processed only once a day until the order is filled. Rem ================================================================== Rem Create a package that enqueue with delay set to one day connect BOLADM/BOLADM create or replace procedure requeue_unfilled_order(sale_region varchar2, backorder order_typ) as back_order_queue_name varchar2(62); enqopt dbms_aq.enqueue_options_t; msgprop dbms_aq.message_properties_t; enq_msgid raw(16); begin -- Choose a back order queue based the the region IF sale_region = 'WEST' THEN back_order_queue_name := 'WS.WS_backorders_que'; ELSIF sale_region = 'EAST' THEN back_order_queue_name := 'ES.ES_backorders_que'; ELSE back_order_queue_name := 'OS.OS_backorders_que'; END IF; -- Enqueue the order with delay time set to 1 day msgprop.delay := 60*60*24; dbms_aq.enqueue(back_order_queue_name, enqopt, msgprop, backorder, enq_msgid); end;
|
![]() Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|