Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Oracle Advanced queue

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you the example analysis of the Oracle advanced queue, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Simple example of Oracle Advanced queue (Advanced Queue)

The simplest advanced queue exercises basically use default parameters.

-- Create Typecreate or replace type note as Object (subject varchar2), Content varchar2 (2000), CreateTime date);-- Create queue tablebegin sys.dbms_aqadm.create_queue_table (queue_table = > 'NOTETAB', queue_payload_type = >' TEST.NOTE'end -- create queuebegin sys.dbms_aqadm.create_queue (queue_name = > 'NOTEQ', queue_table = >' NOTETAB', queue_type = > sys.dbms_aqadm.normal_queue, max_retries = > 5, retry_delay = > 0, retention_time = > 0); end;--enqueuedeclarev_Message note;v_MsgId RAW (16); v_options DBMS_AQ.ENQUEUE_OPTIONS_T;v_properties DBMS_AQ.MESSAGE_PROPERTIES_T;v_Recipients DBMS_AQ.AQ$_RECIPIENT_LIST_T Begin v_Message:=note (subject = > 'note3',Content = >' content3',createTime = > sysdate);-- v_Recipients (0): = sys.aq$_agent ('NOTE','MTQ',0);-- v_properties.recipient_list: = vested Reciptions; v_options.visibility: = DBMS_AQ.IMMEDIATE; dbms_aq.enqueue (queue_name = >' noteq',enqueue_options = > vsignoptionsMagnum messagestationproperties = > vested propertiespaybooks load = > vested MessagePageMsgid = > v_MsgId) Dbms_output.put_line ('encode success,msgid is' | | v_MsgId); end;--dequeuedeclarev_Message note;v_MsgId RAW (16); v_options DBMS_AQ.DEQUEUE_OPTIONS_T;v_properties DBMS_AQ.MESSAGE_PROPERTIES_T;v_Recipients DBMS_AQ.AQ$_RECIPIENT_LIST_T;begin-- v_Recipients (0): = sys.aq$_agent ('NOTE','MTQ',0);-- v_properties.recipient_list: = v_Recipients V_options.visibility: = DBMS_AQ.IMMEDIATE; dbms_aq.dequeue (queue_name = > 'noteq',dequeue_options = > v_MsgId); dbms_output.put_line (' decode success,msgid is'| | v_MsgId); dbms_output.put_line ('subject is' | | v_Message.subject); dbms_output.put_line ('Content is' | | v_Message.Content) Dbms_output.put_line ('createTime is' | | to_char (vicious message. CreateTime hh34:mi:ss'). The above end; is all the content of the article "sample Analysis of Oracle Advanced queue". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report