Oracle DBMS_STREAMS_MESSAGING
Version 12.1.0.2

General Information
Library Note Morgan's Library Page Footer
The Library is currently in the process of being upgraded from Oracle Database Version 12.1.0.1 to 12.1.0.2. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.

Interested in Oracle GoldenGate? Check out the IGGOUG,
Purpose API for Streams to perform messaging using AQ
AUTHID CURRENT_USER
Constants
Name Data Type Value
forever PLS_INTEGER -1
no_wait PLS_INTEGER 0
Dependencies
ANYDATA DBMS_LOGREP_UTIL DBMS_STREAMS_ADM
AQ$_AGENT DBMS_REPCAT_UTL DBMS_UTILITY
DBMS_AQ DBMS_STANDARD  
Documented No
Exceptions
Error Code Reason
ORA-25228 No more messages (nomoremsgs)
ORA-25235 End of current transaction (endofcurtrans)
First Available Not known
Security Model Owned by SYS with EXECUTE granted to the EXECUTE_CATALOG_ROLE role
Source {ORACLE_HOME}/rdbms/admin/dbmsstr.sql
Subprograms
 
DEQUEUE
Dequeue a Streams AQ message

dequeue_mode: one of 'REMOVE', 'LOCKED', 'BROWSE'.
navigation: one of 'FIRST MESSAGE', 'NEXT MESSAGE', 'NEXT TRANSACTION'
dbms_streams_messaging.dequeue(
queue_name   IN  VARCHAR2,
streams_name IN  VARCHAR2,
payload      OUT SYS.ANYDATA,
dequeue_mode IN  VARCHAR2       DEFAULT 'REMOVE',
navigation   IN  VARCHAR2       DEFAULT 'NEXT MESSAGE',
wait         IN  BINARY_INTEGER DEFAULT FOREVER);
DECLARE
 ad_msg sys.anyData;
BEGIN
  dbms_streams_messaging.dequeue('SCOTT_CAPTURE_Q', 'SCOTT_REP', ad_msg);
END;
/
Overload 2 dbms_streams_messaging.dequeue(
queue_name   IN  VARCHAR2,
streams_name IN  VARCHAR2,
payload      OUT SYS.ANYDATA,
dequeue_mode IN  VARCHAR2       DEFAULT 'REMOVE',
navigation   IN  VARCHAR2       DEFAULT 'NEXT MESSAGE',
wait         IN  BINARY_INTEGER DEFAULT FOREVER,
msgid        OUT RAW);
DECLARE
 ad_msg sys.anyData;
 mid    RAW;
BEGIN
  dbms_streams_messaging.dequeue('SCOTT_CAPTURE_Q', 'SCOTT_REP', ad_msg, 'BROWSE', 'FIRST_MESSAGE', 'FOREVER', mid);
END;
/
 
ENQUEUE
Enqueue a Streams AQ message dbms_streams_messaging.enqueue(
queue_name IN VARCHAR2,
payload    IN sys.anydata);
DECLARE
 msg sys.anydata := sys.anyData.convertVarchar2('hello world'))
BEGIN
  dbms_streams_messaging.enqueue('SCOTT_CAPTURE_Q', msg);
END;
/
Overload 2 dbms_streams_messaging.enqueue(
queue_name IN  VARCHAR2,
payload    IN  sys.anydata,
msgid      OUT RAW);
DECLARE
 msg sys.anydata := sys.anyData.convertVarchar2('hello world');
 mid RAW;
BEGIN
  dbms_streams_messaging.enqueue('SCOTT_CAPTURE_Q', msg);
  dbms_output.put_line(mid);
END;
/

Related Topics
ANYDATA
Packages
DBMS_STREAMS
DBMS_STREAMS_ADM
DBMS_STREAMS_AUTH

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2014 Daniel A. Morgan All Rights Reserved