{"id":134,"date":"2010-12-13T10:42:47","date_gmt":"2010-12-13T15:42:47","guid":{"rendered":"http:\/\/www.dev-notes.com\/blog\/2010\/12\/13\/creating-a-queue-in-oracle\/"},"modified":"2010-12-13T10:42:47","modified_gmt":"2010-12-13T15:42:47","slug":"creating-a-queue-in-oracle","status":"publish","type":"post","link":"https:\/\/www.dev-notes.com\/blog\/2010\/12\/13\/creating-a-queue-in-oracle\/","title":{"rendered":"Creating a Queue in Oracle"},"content":{"rendered":"<p>For this particular example, let us assume that the information being between application takes on the form of two fields, row_id and row_status.  Given that, we will create this following object type, which will be used by the queue shortly.<\/p>\n<pre class=\"code\">\ncreate or replace type obj_stuff as object (\n\trow_id\tnumber,\n\trow_status\tvarchar2(10)\n);\n<\/pre>\n<p>With the object type created, we will first create a queue table based on this object type, followed by a queue.<\/p>\n<pre class=\"code\">\ndeclare\nbegin\n\tdbms_aqadm.create_queue_table (\n\t\tqueue_table\t=>\t'myschema.stuff_queue_table',\n\t\tqueue_payload_type\t=>\t'myschema.obj_stuff'\n\t);\n\tdbms_aqadm.create_queue (\n\t\tqueue_name\t=>\t'myschema.stuff_queue',\n\t\tqueue_table\t=>\t'myschema.stuff_queue_table'\n\t);\nend;\n<\/pre>\n<p>With the script above, we now have the queue table and the queue set up.  To start the queue, use the .start_queue script, as below.<\/p>\n<pre class=\"code\">\ndeclare\nbegin\n\tdbms_aqadm.start_queue (\n\t\tqueue_name\t=>\t'myschema.stuff_queue',\n\t\tenqueue\t=>\ttrue\n\t);\nend;\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Oracle Advanced Queuing provides a medium for various applications to communicate with each other, providing the infrastructure for SOA, for example.  This note provides an example on how to set up a queue.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-134","post","type-post","status-publish","format-standard","hentry","category-oracle"],"_links":{"self":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/comments?post=134"}],"version-history":[{"count":0,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/134\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/media?parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/categories?post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/tags?post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}