Oracle PL/SQL/System Packages/DBMS AQADM

Материал из SQL эксперт
Перейти к: навигация, поиск

DBMS_AQADM.CREATE_QUEUE

 
SQL>
SQL> SET ECHO ON
SQL>
SQL> BEGIN
  2      DBMS_AQADM.CREATE_QUEUE (
  3          "EMP_DEPT_CHANGES",
  4          "EMP_CHANGES");
  5  END;
  6  /
BEGIN
*
ERROR at line 1:
ORA-24006: cannot create QUEUE,
sqle.EMP_DEPT_CHANGES already exists
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 3131
ORA-06512: at "SYS.DBMS_AQADM", line 119
ORA-06512: at line 2

SQL>
SQL>
SQL> --



DBMS_AQADM.CREATE_QUEUE_TABLE

 
SQL>
SQL> SET ECHO ON
SQL>
SQL>
SQL> CREATE OR REPLACE TYPE emp_chg AS OBJECT (
  2      emp_id NUMBER,
  3      pay_rate NUMBER(9,2),
  4      pay_type CHAR(1),
  5      leave_dept NUMBER
  6      );
  7  /

SQL>
SQL> BEGIN
  2      DBMS_AQADM.CREATE_QUEUE_TABLE (
  3          "EMP_CHANGES",
  4          "EMP_CHG",
  5          NULL,
  6          "priority,enq_time",
  7          TRUE,
  8          DBMS_AQADM.NONE,
  9          "For pay rate and department changes.",
 10          TRUE,0,0,
 11          "8.1"
 12          );
 13  END;
 14  /

SQL>
SQL> --



DBMS_AQADM.START_QUEUE

 
SQL>
SQL> SET ECHO ON
SQL>
SQL> BEGIN
  2      DBMS_AQADM.START_QUEUE("EMP_DEPT_CHANGES");
  3  END;
  4  /
PL/SQL procedure successfully completed.
SQL>
SQL>
SQL> --