⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bz_enqueue_eg2.sql

📁 oracle9i+j2ee开发aq oracle9i+j2ee开发aq oracle9i+j2ee开发aq
💻 SQL
字号:
REM script name: bz_enqueue_eg.sqlREM Shows various ways to do an enqueueREMREM version: 9iREM====================================================================REM I. Normal Enqueue REM====================================================================declare	enqopt	dbms_aq.enqueue_options_t;	mprop	dbms_aq.message_properties_t;	enq_msgid	RAW(16);begin	dbms_aq.enqueue(		queue_name => 'bzcardorders_q',		enqueue_options => enqopt,		message_properties => mprop,		payload => bzcardorder_typ(101, 'Brajesh', 'Goyal','NORMAL'),		msgid => enq_msgid);--	You can perform multiple database operations in the same transaction-- 	You need not commit here Or you can use visibility immediate to commit	commit;end;/REM====================================================================REM II. Enqueue with a delayREM====================================================================declare	enqopt	dbms_aq.enqueue_options_t;	mprop	dbms_aq.message_properties_t;	enq_msgid	RAW(16);	rcpt_list dbms_aq.aq$_recipient_list_t;begin	rcpt_list(0) := sys.aq$_agent('Billing', null, null);	rcpt_list(1) := sys.aq$_agent('Shipping', null, null);	mprop.delay := 30; -- 30 seconds delay	mprop.recipient_list := rcpt_list;	dbms_aq.enqueue(		queue_name => 'bzcardorders_q',		enqueue_options => enqopt,		message_properties => mprop,		payload => bzcardorder_typ(102, 'Shailendra','Mishra','NORMAL'),		msgid => enq_msgid);--	You can perform multiple database operations in the same transaction-- 	You need not commit here Or you can use visibility immediate to commit	commit;end;/REM====================================================================REM III. Enqueue with an expiration REM====================================================================declare	enqopt	dbms_aq.enqueue_options_t;	mprop	dbms_aq.message_properties_t;	enq_msgid	RAW(16);	rcpt_list dbms_aq.aq$_recipient_list_t;begin	rcpt_list(0) := sys.aq$_agent('Billing', null, null);	rcpt_list(1) := sys.aq$_agent('Shipping', null, null);	mprop.expiration := 30; -- expires after 30 seconds	mprop.recipient_list := rcpt_list;	dbms_aq.enqueue(		queue_name => 'bzcardorders_q',		enqueue_options => enqopt,		message_properties => mprop,		payload => bzcardorder_typ(101,'Brajesh','Goyal','RUSH'),		msgid => enq_msgid);--	You can perform multiple database operations in the same transaction-- 	You need not commit here Or you can use visibility immediate to commit	commit;end;/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -