Locations of visitors to this page

Thursday, April 2, 2009

unwrapping plsql code in 10g 解包10g存储过程

unwrapping plsql code in 10g
10g下解包存储过程

原理见Unwrapping 10G wrapped PL/SQL by Anton Scheffer


比如,'create package a'打包后变为:
create package a wrapped --打包后加上了标记"wrapped"
a000000 --固定值, 总是a000000
369 --数据库版本相关. 系统自带的.plb文件中好像都是1
abcd --填充符,共15行
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
9 --7:procedure 8:function 9:package b:package body d:type e:type body 16:library
a 34 --第1个数:打包前原文'\0'的长度(不包括"create "或"create or replace ") 第2个数:打包后的长度
g0a2d/TfdrHiIe3evJs3xeAzTzYwg5m49TOf9b9cWpGmpsvE4Ug= --BASE64编码


WRAP打包过程首先是ZLIB压缩, 然后简单的替换加密, 最后BASE64编码
第2步替换加密中的替换表是ORACLE内部制定的

解包过程则相反
with
src as
(select 'package a' txt from dual)
, wrap as
(select src.txt
, dbms_ddl.wrap('create '||src.txt) wrap
from src)
, base64_dcd as
(select substr(
utl_encode.base64_decode(
utl_raw.cast_to_raw(
rtrim(
substr(
wrap.wrap
,instr(wrap.wrap,chr(10),1,20)+1) --跳过前20行
,chr(10)) --去掉行尾回车, 也可以不去, UTL_ENCODE.BASE64_DECODE能处理回车
)
) --BASE64解码
, 41) x --前40个字符是SHA-1的散列值
from wrap)
, subst as 
(select utl_raw.translate( --码表转换 (这里的替换表是假的)
utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(x)),
utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(
'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'||
'202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F'||
'404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F'||
'606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F'||
'808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F'||
'A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF'||
'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF'||
'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'))
,utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(
'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'||
'202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F'||
'404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F'||
'606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F'||
'808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F'||
'A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF'||
'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF'||
'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'))
) s
from base64_dcd)
select mycompress.inflate(s) --zlib解压
from subst;

MYCOMPRESS.INFLATE(S)--ZLIB解压
----------------------------------------------------------------------------------------------------------------------------------
PACKAGE a




解一个系统的, rdbms/admin/dbmsrmge.plb中的一部分
with
wrap as
(select
'xQaGj1mCrsgW3+RaZh0GMWKlijswgw33f64df3QCkxMP7i1akFTarfShhBKhXRRbWfcvTV49'||chr(10)||
'/KYmJJ2/sYRpdytaSTQi+BByn2cNooSlksJCltfJVYkyA3NojcRzSAXPpougS6vDyRuc8krb'||chr(10)||
'qcznL7hPkPI82mlZdU1QXnUjOlCfulvR6vEwG3BlN+InBrSBYQnw2G+Fv4J/EUocbXFCDTZP'||chr(10)||
'tkZcVjxsZdvE4XUJi7tYvlfp/dTfPZObsxIW/Q3b3HPu+ZW7AHr+pZox4tsc96sDYZwJte8r'||chr(10)||
'AyjqTZxrjCyOTwtwusZBP0HrzZ+bwsy07tuqj0rg8esOAZSZ6kBtOE/4HRLcThMdCFDr3g=='||chr(10)||
''||chr(10)
wrap
from dual)
, base64_dcd as
(select substr(
utl_encode.base64_decode(
utl_raw.cast_to_raw(
wrap.wrap
)
) --BASE64解码
, 41) x --前40个字符是SHA-1的散列值
from wrap)
, subst as 
(select utl_raw.translate( --码表转换 (这里的替换表是假的)
utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(x)),
utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(
'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'||
'202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F'||
'404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F'||
'606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F'||
'808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F'||
'A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF'||
'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF'||
'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'))
,utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(
'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'||
'202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F'||
'404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F'||
'606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F'||
'808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F'||
'A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF'||
'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF'||
'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'))
) s
from base64_dcd)
select mycompress.inflate(s) --zlib解压
from subst;

PACKAGE dbms_rmgr_group_export AUTHID CURRENT_USER AS


FUNCTION CREATE_EXP(OBJID IN NUMBER,
VERSION IN VARCHAR2,
NEW_BLOCK OUT PLS_INTEGER)
RETURN VARCHAR2;



FUNCTION GRANT_EXP(OBJID IN NUMBER,
ISDBA IN PLS_INTEGER,
GRANTOR OUT VARCHAR2,
VERSION IN VARCHAR2,
NEW_BLOCK OUT PLS_INTEGER)
RETURN VARCHAR2;



FUNCTION AUDIT_EXP(OBJID IN NUMBER,
VERSION IN VARCHAR2,
NEW_BLOCK OUT PLS_INTEGER)
RETURN VARCHAR2;



FUNCTION DROP_EXP(OBJID IN NUMBER,
VERSION IN VARCHAR2,
NEW_BLOCK OUT PLS_INTEGER)
RETURN VARCHAR2;



FUNCTION GRANT_SYSPRIVS_EXP(VERSION IN VARCHAR2,
NEW_BLOCK OUT PLS_INTEGER)
RETURN VARCHAR2;



FUNCTION  AUDIT_SYSPRIVS_EXP(VERSION IN VARCHAR2,
NEW_BLOCK OUT PLS_INTEGER)
RETURN VARCHAR2;

END DBMS_RMGR_GROUP_EXPORT;



如果语句太大了就会报错
utl_raw.cast_to_raw(
*
ERROR at line 67:
ORA-06502: PL/SQL: numeric or value error: raw variable length too long
ORA-06512: at "SYS.UTL_RAW", line 224


编写存储过程解包
create or replace java source named MY_COMPRESS
as
import java.io.*;
import java.util.zip.*;
public class MY_COMPRESS
{
public static String Inflate( byte[] src )
{
try
{
ByteArrayInputStream bis = new ByteArrayInputStream( src );
InflaterInputStream iis = new InflaterInputStream( bis );
StringBuffer sb = new StringBuffer();
for( int c = iis.read(); c != -1; c = iis.read() )
{
sb.append( (char) c );
}
return sb.toString();
} catch ( Exception e )
{
}
return null;
}
public static byte[] Deflate( String src, int quality )
{
try
{
byte[] tmp = new byte[ src.length() + 100 ];
Deflater defl = new Deflater( quality );
defl.setInput( src.getBytes( "UTF-8" ) );
defl.finish();
int cnt = defl.deflate( tmp );
byte[] res = new byte[ cnt ];
for( int i = 0; i < cnt; i++ )
res[i] = tmp[i];
return res;
} catch ( Exception e )
{
}
return null;
}
}
/

alter java source MY_COMPRESS compile
/

create or replace package mycompress
is
function deflate(src in varchar2) return raw;
function deflate(src in varchar2, quality in number) return raw;
function inflate(src in raw) return varchar2;
end;
/

create or replace package body mycompress
is
function deflate(src in varchar2) return raw
is
begin
return deflate(src, 6);
end;

function deflate(src in varchar2, quality in number) return raw
as language java
name 'MY_COMPRESS.Deflate(java.lang.String, int) return byte[]';

function inflate(src in raw) return varchar2
as language java
name 'MY_COMPRESS.Inflate(byte[]) return java.lang.String';

end;
/

create or replace package mypkg
is
function unwrap(s in varchar2) return varchar2;
function unwrap_obj(p_name in varchar2, p_type in varchar2, p_owner in varchar2 default user) return varchar2;
procedure unwrap_obj_a(p_name in varchar2, p_type in varchar2, p_owner in varchar2 default user);
end;
/

create or replace package body mypkg
is
S_SUB_FROM constant varchar2(1000) := --假的
'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'||
'202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F'||
'404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F'||
'606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F'||
'808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F'||
'A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF'||
'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF'||
'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF';
S_SUB_TO constant varchar2(1000) :=
'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'||
'202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F'||
'404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F'||
'606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F'||
'808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F'||
'A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF'||
'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF'||
'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF';
S_SUB_FROM_RAW constant raw(1000) := utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(s_sub_from));
S_SUB_TO_RAW   constant raw(1000) := utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(s_sub_to));
S_SHA1_DIGEST_LENGTH constant pls_integer := 41;

function unitesql(s in dbms_sql.varchar2a, nl in varchar2 default chr(10)) return varchar2
is
lb pls_integer := 1;
ub pls_integer := s.count;
t varchar2(32767);
begin
for i in lb..ub loop
t := t || s(i);
--dbms_output.put_line('['||t||']');
if i != ub then
t := t || nl;
end if;
end loop;
return t;
end;
function dividesql(s in varchar2) return dbms_sql.varchar2a
is
nl varchar2(100) := chr(10);
len pls_integer := length(s);
t   dbms_sql.varchar2a;
i   pls_integer := 1;
p   pls_integer := 1;
np  pls_integer := 0;
begin
loop
exit when p > len;
np := instr(s,nl,p);
--dbms_output.put_line('p='||p||':'||'np='||np);
if np = 0 then
t(i) := substr(s,p);
--dbms_output.put_line('t('||i||')='||t(i)||']');
exit;
end if;
t(i) := substr(s,p,np-p);
--dbms_output.put_line('s="'||s||'"');
--dbms_output.put_line('p='||p||':'||'np='||np);
--dbms_output.put_line('t('||i||')='||t(i)||'}');
p := np + 1;
i := i + 1;
end loop;
return t;
end;

--将BASE64前的转换成ZLIB后的
function translate_r_raw(x in raw) return raw
is
begin
return utl_raw.translate(x,S_SUB_TO_RAW,S_SUB_FROM_RAW);
end;
function translate_r(x in varchar2) return raw
is
begin
return translate_r_raw(utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(x)));
end;

function base64_decode(s in varchar2) return varchar2
is
x dbms_sql.varchar2a;
y dbms_sql.varchar2a;
begin
x := dividesql(s);
for i in 1..x.count loop
--dbms_output.put_line('x'||i||':'||x(i)||':');
if rtrim(x(i),chr(10)) is not null then
y(i) := utl_encode.base64_decode(utl_raw.cast_to_raw(x(i)));
end if;
--dbms_output.put_line('y'||i||':'||y(i)||':');
end loop;
return unitesql(y,'');
end;

--解包WRAPPED后的代码
function unwrap_s(s in varchar2) return varchar2
is
begin
return
mycompress.inflate(
translate_r(
substr(
base64_decode(s)
, S_SHA1_DIGEST_LENGTH
)
)
);
end;
function unwrap(s in varchar2) return varchar2
is
begin
return unwrap_s(substr(s,instr(s,chr(10),1,20)+1));
end;

function unwrap(s in dbms_sql.varchar2a) return varchar2
is
begin
return unwrap(unitesql(s,''));
end;
function unwrap_obj(p_name in varchar2, p_type in varchar2, p_owner in varchar2 default user) return varchar2
is
v_text all_source.text%type;
s dbms_sql.varchar2a;
begin
begin
select text
into v_text
from all_source
where owner = p_owner
and name = p_name
and type = p_type
and line = 1
and rtrim(substr(text,1,instr(text,chr(10))-1)) like '%wrapped';
exception
when no_data_found then
dbms_output.put_line('not found, or not wrapped');
raise;
end;
for x in (select rownum,text
from all_source
where owner=p_owner
and name=p_name
and type=p_type
order by line)
loop
s(x.rownum) := x.text;
end loop;
return unwrap(s);
end;
procedure unwrap_obj_a(p_name in varchar2, p_type in varchar2, p_owner in varchar2 default user)
is
x dbms_sql.varchar2a;
begin
x := dividesql(unwrap_obj(p_name,p_type,p_owner));
for i in 1..x.count loop
dbms_output.put_line(x(i));
end loop;
end;

end;
/

运行解包过程可以得到源码
set pages 50000 line 130
set serveroutput on size unlimited
drop procedure prc1;
exec dbms_ddl.create_wrapped('create or replace procedure prc1 is begin dbms_output.put_line(''Hello World!''); end;')
select mypkg.unwrap(dbms_ddl.wrap('create or replace procedure prc1 is begin dbms_output.put_line(''Hello World!''); end;')) from dual;
select mypkg.unwrap_obj('PRC1','PROCEDURE') from dual;
exec mypkg.unwrap_obj_a(upper('dbms_aq'),'PACKAGE','SYS')
exec mypkg.unwrap_obj_a(upper('dbms_aq'),'PACKAGE BODY','SYS')

SQL> select mypkg.unwrap(dbms_ddl.wrap('create or replace procedure prc1 is begin dbms_output.put_line(''Hello World!''); end;')) from dual;

MYPKG.UNWRAP(DBMS_DDL.WRAP('CREATEORREPLACEPROCEDUREPRC1ISBEGINDBMS_OUTPUT.PUT_LINE(''HELLOWORLD!'');END;'))
----------------------------------------------------------------------------------------------------------------------------------
PROCEDURE prc1 IS BEGIN DBMS_OUTPUT.PUT_LINE('Hello World!'); END;

SQL> select mypkg.unwrap_obj('PRC1','PROCEDURE') from dual;

MYPKG.UNWRAP_OBJ('PRC1','PROCEDURE')
----------------------------------------------------------------------------------------------------------------------------------
PROCEDURE prc1 IS BEGIN DBMS_OUTPUT.PUT_LINE('Hello World!'); END;

SQL> exec mypkg.unwrap_obj_a(upper('dbms_aq'),'PACKAGE','SYS')
PACKAGE dbms_aq AUTHID CURRENT_USER AS
NAMESPACE_ANONYMOUS CONSTANT BINARY_INTEGER := 0;
NAMESPACE_AQ        CONSTANT BINARY_INTEGER := 1;
NAMESPACE_DBCHANGE CONSTANT BINARY_INTEGER := 2;
NTFN_QOS_RELIABLE        CONSTANT BINARY_INTEGER := 1;
NTFN_QOS_PAYLOAD         CONSTANT BINARY_INTEGER := 2;
NTFN_QOS_REPLICATE       CONSTANT BINARY_INTEGER := 4;
NTFN_QOS_SECURE          CONSTANT BINARY_INTEGER := 8;
NTFN_QOS_PURGE_ON_NTFN   CONSTANT BINARY_INTEGER := 16;
NTFN_QOS_MULTICBK        CONSTANT BINARY_INTEGER := 32;
NOTIFICATION_SUBSCRIBER  CONSTANT BINARY_INTEGER := 16;
PUBLIC_SUBSCRIBER        CONSTANT BINARY_INTEGER := 32;
IMMEDIATE           CONSTANT BINARY_INTEGER := 1;
ON_COMMIT           CONSTANT BINARY_INTEGER := 2;
BROWSE              CONSTANT BINARY_INTEGER := 1;
LOCKED              CONSTANT BINARY_INTEGER := 2;
REMOVE              CONSTANT BINARY_INTEGER := 3;
REMOVE_NODATA       CONSTANT BINARY_INTEGER := 4;
GET_SIGNATURE       CONSTANT BINARY_INTEGER := 5;
FIRST_MESSAGE             CONSTANT BINARY_INTEGER := 1;
FIRST                     CONSTANT BINARY_INTEGER := 1;
FIRST_MESSAGE_ONE_GROUP   CONSTANT BINARY_INTEGER := 1;
FIRST_MESSAGE_MULTI_GROUP CONSTANT BINARY_INTEGER := 4;
NEXT_MESSAGE              CONSTANT BINARY_INTEGER := 3;
NEXT                      CONSTANT BINARY_INTEGER := 3;
NEXT_MESSAGE_ONE_GROUP    CONSTANT BINARY_INTEGER := 3;
NEXT_MESSAGE_MULTI_GROUP  CONSTANT BINARY_INTEGER := 5;
NEXT_TRANSACTION          CONSTANT BINARY_INTEGER := 2;
WAITING             CONSTANT BINARY_INTEGER := 1;
READY               CONSTANT BINARY_INTEGER := 0;
PROCESSED           CONSTANT BINARY_INTEGER := 2;
EXPIRED             CONSTANT BINARY_INTEGER := 3;
SPILLED             CONSTANT BINARY_INTEGER := 7;
DEFERRED            CONSTANT BINARY_INTEGER := 8;
DEFRSPIL            CONSTANT BINARY_INTEGER := 9;
BUFFERED_EXPIRED    CONSTANT BINARY_INTEGER := 10;
BEFORE              CONSTANT BINARY_INTEGER := 2;
TOP                 CONSTANT BINARY_INTEGER := 3;
FOREVER             CONSTANT BINARY_INTEGER := -1;
NO_WAIT             CONSTANT BINARY_INTEGER := 0;
NO_DELAY            CONSTANT BINARY_INTEGER := 0;
NEVER               CONSTANT BINARY_INTEGER := -1;
OBJECT_TYPE         CONSTANT BINARY_INTEGER := 1;
RAW_TYPE            CONSTANT BINARY_INTEGER := 2;
BUFFERED_MESSAGE    CONSTANT BINARY_INTEGER := 1;
PERSISTENT               CONSTANT BINARY_INTEGER := 1;
BUFFERED                 CONSTANT BINARY_INTEGER := 2;
PERSISTENT_OR_BUFFERED   CONSTANT BINARY_INTEGER := 3;
JMS_TEXT_MESSAGE   CONSTANT BINARY_INTEGER := 0;
JMS_BYTES_MESSAGE  CONSTANT BINARY_INTEGER := 1;
JMS_STREAM_MESSAGE CONSTANT BINARY_INTEGER := 2;
JMS_MAP_MESSAGE    CONSTANT BINARY_INTEGER := 3;
JMS_OBJECT_MESSAGE CONSTANT BINARY_INTEGER := 4;
TYPE AQ$_RECIPIENT_LIST_T IS TABLE OF SYS.AQ$_AGENT
INDEX BY BINARY_INTEGER;
TYPE AQ$_AGENT_LIST_T IS TABLE OF SYS.AQ$_AGENT INDEX BY BINARY_INTEGER;
TYPE MESSAGE_PROPERTIES_T IS
RECORD(
PRIORITY          BINARY_INTEGER NOT NULL DEFAULT 1,
DELAY             BINARY_INTEGER NOT NULL DEFAULT NO_DELAY,
EXPIRATION        BINARY_INTEGER NOT NULL DEFAULT NEVER,
CORRELATION       VARCHAR2(128) DEFAULT NULL,
ATTEMPTS          BINARY_INTEGER,
RECIPIENT_LIST    AQ$_RECIPIENT_LIST_T,
EXCEPTION_QUEUE   VARCHAR2(61) DEFAULT NULL,
ENQUEUE_TIME      DATE,
STATE             BINARY_INTEGER,
SENDER_ID         SYS.AQ$_AGENT DEFAULT NULL,
ORIGINAL_MSGID    RAW(16)       DEFAULT NULL,
SIGNATURE         AQ$_SIG_PROP  DEFAULT NULL,
TRANSACTION_GROUP VARCHAR2(30)  DEFAULT NULL,
USER_PROPERTY     SYS.ANYDATA   DEFAULT NULL,
DELIVERY_MODE     PLS_INTEGER   NOT NULL DEFAULT PERSISTENT);
TYPE MESSAGE_PROPERTIES_ARRAY_T IS VARRAY(2147483647)
OF MESSAGE_PROPERTIES_T;
TYPE ERROR_INFO_T IS RECORD (
ERROR_POSITION    NUMBER,
ERROR_NO          NUMBER,
ERROR_MSG         VARCHAR2(4000));
TYPE ERROR_ARRAY_T IS VARRAY(2147483647) OF ERROR_INFO_T;
TYPE MSGID_ARRAY_T IS VARRAY(2147483647)  OF RAW(16);
TYPE ENQUEUE_OPTIONS_T IS
RECORD(
VISIBILITY          BINARY_INTEGER NOT NULL DEFAULT ON_COMMIT,
RELATIVE_MSGID      RAW(16)  DEFAULT NULL,
SEQUENCE_DEVIATION  BINARY_INTEGER DEFAULT NULL,
TRANSFORMATION      VARCHAR2(61) DEFAULT NULL,
BUFMESG_PROP        BINARY_INTEGER DEFAULT NULL,
DELIVERY_MODE     PLS_INTEGER   NOT NULL DEFAULT PERSISTENT);
TYPE DEQUEUE_OPTIONS_T IS
RECORD(
CONSUMER_NAME     VARCHAR2(30) DEFAULT NULL,
DEQUEUE_MODE      BINARY_INTEGER NOT NULL DEFAULT REMOVE,
NAVIGATION        BINARY_INTEGER NOT NULL DEFAULT NEXT_MESSAGE,
VISIBILITY        BINARY_INTEGER NOT NULL DEFAULT ON_COMMIT,
WAIT              BINARY_INTEGER NOT NULL DEFAULT FOREVER,
MSGID             RAW(16)                 DEFAULT NULL,
CORRELATION       VARCHAR2(128)           DEFAULT NULL,
DEQ_CONDITION     VARCHAR2(4000)          DEFAULT NULL,
SIGNATURE         AQ$_SIG_PROP            DEFAULT NULL,
TRANSFORMATION    VARCHAR2(61)            DEFAULT NULL,
BUFMESG_PROP      BINARY_INTEGER          DEFAULT NULL,
DELIVERY_MODE     PLS_INTEGER   NOT NULL  DEFAULT PERSISTENT);
PROCEDURE ENQUEUE(
QUEUE_NAME           IN    VARCHAR2,
ENQUEUE_OPTIONS      IN    ENQUEUE_OPTIONS_T,
MESSAGE_PROPERTIES   IN    MESSAGE_PROPERTIES_T,
PAYLOAD              IN    "<OPAQUE_1>",
MSGID                OUT   RAW);
PROCEDURE ENQUEUE(
QUEUE_NAME           IN    VARCHAR2,
ENQUEUE_OPTIONS      IN    ENQUEUE_OPTIONS_T,
MESSAGE_PROPERTIES   IN    MESSAGE_PROPERTIES_T,
PAYLOAD              IN    "<ADT_1>",
MSGID                OUT   RAW);
PROCEDURE ENQUEUE(
QUEUE_NAME           IN    VARCHAR2,
ENQUEUE_OPTIONS      IN    ENQUEUE_OPTIONS_T,
MESSAGE_PROPERTIES   IN    MESSAGE_PROPERTIES_T,
PAYLOAD              IN    RAW,
MSGID                OUT   RAW);
FUNCTION ENQUEUE_ARRAY (
QUEUE_NAME                IN     VARCHAR2,
ENQUEUE_OPTIONS           IN     ENQUEUE_OPTIONS_T,
ARRAY_SIZE                IN     PLS_INTEGER,
MESSAGE_PROPERTIES_ARRAY  IN     MESSAGE_PROPERTIES_ARRAY_T,
PAYLOAD_ARRAY             IN     "<COLLECTION_1>",
MSGID_ARRAY               OUT    MSGID_ARRAY_T)
RETURN PLS_INTEGER;
FUNCTION ENQUEUE_ARRAY (
QUEUE_NAME                IN     VARCHAR2,
ENQUEUE_OPTIONS           IN     ENQUEUE_OPTIONS_T,
ARRAY_SIZE                IN     PLS_INTEGER,
MESSAGE_PROPERTIES_ARRAY  IN     MESSAGE_PROPERTIES_ARRAY_T,
PAYLOAD_ARRAY             IN     "<COLLECTION_1>",
MSGID_ARRAY               OUT    MSGID_ARRAY_T,
ERROR_ARRAY               OUT    ERROR_ARRAY_T)
RETURN PLS_INTEGER;
PROCEDURE DEQUEUE(
QUEUE_NAME           IN    VARCHAR2,
DEQUEUE_OPTIONS      IN    DEQUEUE_OPTIONS_T,
MESSAGE_PROPERTIES   OUT   MESSAGE_PROPERTIES_T,
PAYLOAD              OUT   "<OPAQUE_1>",
MSGID                OUT   RAW);
PROCEDURE DEQUEUE(
QUEUE_NAME           IN    VARCHAR2,
DEQUEUE_OPTIONS      IN    DEQUEUE_OPTIONS_T,
MESSAGE_PROPERTIES   OUT   MESSAGE_PROPERTIES_T,
PAYLOAD              OUT   "<ADT_1>",
MSGID                OUT   RAW);
PROCEDURE DEQUEUE(
QUEUE_NAME           IN    VARCHAR2,
DEQUEUE_OPTIONS      IN    DEQUEUE_OPTIONS_T,
MESSAGE_PROPERTIES   OUT   MESSAGE_PROPERTIES_T,
PAYLOAD              OUT   RAW,
MSGID                OUT   RAW);
FUNCTION DEQUEUE_ARRAY(
QUEUE_NAME                IN    VARCHAR2,
DEQUEUE_OPTIONS           IN    DEQUEUE_OPTIONS_T,
ARRAY_SIZE                IN    PLS_INTEGER,
MESSAGE_PROPERTIES_ARRAY  OUT   MESSAGE_PROPERTIES_ARRAY_T,
PAYLOAD_ARRAY             OUT   "<COLLECTION_1>",
MSGID_ARRAY               OUT   MSGID_ARRAY_T)
RETURN PLS_INTEGER;
FUNCTION DEQUEUE_ARRAY(
QUEUE_NAME                IN    VARCHAR2,
DEQUEUE_OPTIONS           IN    DEQUEUE_OPTIONS_T,
ARRAY_SIZE                IN    PLS_INTEGER,
MESSAGE_PROPERTIES_ARRAY  OUT   MESSAGE_PROPERTIES_ARRAY_T,
PAYLOAD_ARRAY             OUT   "<COLLECTION_1>",
MSGID_ARRAY               OUT   MSGID_ARRAY_T,
ERROR_ARRAY               OUT   ERROR_ARRAY_T)
RETURN PLS_INTEGER;
PROCEDURE LISTEN(
AGENT_LIST           IN    AQ$_AGENT_LIST_T,
WAIT                 IN    BINARY_INTEGER DEFAULT FOREVER,
AGENT                OUT   SYS.AQ$_AGENT);
PROCEDURE LISTEN(
AGENT_LIST            IN    AQ$_AGENT_LIST_T,
WAIT                  IN    BINARY_INTEGER DEFAULT FOREVER,
LISTEN_DELIVERY_MODE  IN    PLS_INTEGER DEFAULT PERSISTENT,
AGENT                 OUT   SYS.AQ$_AGENT,
MESSAGE_DELIVERY_MODE OUT   PLS_INTEGER);
PROCEDURE BIND_AGENT(
AGENT                IN    AQ$_AGENT,
CERTIFICATE_LOCATION IN    VARCHAR2 DEFAULT NULL);
PROCEDURE UNBIND_AGENT(
AGENT                IN    AQ$_AGENT);
PROCEDURE REGISTER(
REG_LIST      IN       SYS.AQ$_REG_INFO_LIST,
REG_COUNT     IN       NUMBER);
PROCEDURE UNREGISTER(
REG_LIST      IN       SYS.AQ$_REG_INFO_LIST,
REG_COUNT     IN       NUMBER);
PROCEDURE POST(
POST_LIST     IN       SYS.AQ$_POST_INFO_LIST,
POST_COUNT    IN       NUMBER);
PROCEDURE AQ$_ENQUEUE(
QUEUE_NAME           IN      VARCHAR2,
SENDER_NAME          IN      VARCHAR2         DEFAULT NULL,
SENDER_ADDR          IN      VARCHAR2         DEFAULT NULL,
SENDER_PROTOCOL      IN      BINARY_INTEGER   DEFAULT NULL,
ORIGINAL_MSGID       IN      RAW              DEFAULT NULL,
CORRELATION          IN      VARCHAR2         DEFAULT NULL,
VISIBILITY           IN      BINARY_INTEGER   DEFAULT ON_COMMIT,
PRIORITY             IN      BINARY_INTEGER   DEFAULT 1,
DELAY                IN      BINARY_INTEGER   DEFAULT 0,
EXPIRATION           IN      BINARY_INTEGER   DEFAULT NEVER,
RELATIVE_MSGID       IN      RAW              DEFAULT NULL,
SEQUENCE_DEVIATION   IN      BINARY_INTEGER   DEFAULT NULL,
EXCEPTION_QUEUE      IN      VARCHAR2         DEFAULT NULL,
RECIPIENTS           IN      AQ$_RECIPIENT_LIST_T,
PAYLOAD_TYPE         IN      BINARY_INTEGER   DEFAULT OBJECT_TYPE,
RAW_USER_DATA        IN      RAW              DEFAULT NULL,
OBJECT_USER_DATA     IN      "<ADT_1>",
MSGID                OUT     RAW,
SIGNATURE            IN      AQ$_SIG_PROP     DEFAULT NULL,
TRANSFORMATION       IN      VARCHAR2         DEFAULT NULL,
BUFMESG_PROP         IN      BINARY_INTEGER   DEFAULT NULL,
ANYDATA_CONVERT      IN      BOOLEAN          DEFAULT FALSE,
LCR2XML_CONVERT      IN      BOOLEAN          DEFAULT FALSE,
USER_PROPERTY        IN      SYS.ANYDATA      DEFAULT NULL,
DELIVERY_MODE        IN      PLS_INTEGER      DEFAULT PERSISTENT);
PROCEDURE AQ$_DEQUEUE(
QUEUE_NAME              IN      VARCHAR2,
SUBSCRIBER              IN      VARCHAR2        DEFAULT NULL,
MSGID                   IN      RAW             DEFAULT NULL,
CORRELATION             IN      VARCHAR2        DEFAULT NULL,
DEQUEUE_MODE            IN      BINARY_INTEGER  DEFAULT REMOVE,
NAVIGATION              IN      BINARY_INTEGER  DEFAULT FIRST,
VISIBILITY              IN      BINARY_INTEGER  DEFAULT ON_COMMIT,
WAIT                    IN      BINARY_INTEGER  DEFAULT FOREVER,
ENQUEUE_TIME            OUT     DATE,
STATE                   OUT     BINARY_INTEGER,
OUT_MSGID               OUT     RAW,
OUT_CORRELATION         OUT     VARCHAR2,
PRIORITY                OUT     BINARY_INTEGER,
DELAY                   OUT     BINARY_INTEGER,
EXPIRATION              OUT     BINARY_INTEGER,
ATTEMPTS                OUT     BINARY_INTEGER,
EXCEPTION_QUEUE         OUT     VARCHAR2,
REMOTE_RECIPIENTS       OUT     AQ$_RECIPIENT_LIST_T,
SENDER_NAME             OUT     VARCHAR2,
SENDER_ADDR             OUT     VARCHAR2,
SENDER_PROTOCOL         OUT     BINARY_INTEGER,
ORIGINAL_MSGID          OUT     RAW,
PAYLOAD_TYPE            IN      BINARY_INTEGER    DEFAULT OBJECT_TYPE,
RAW_USER_DATA           OUT     RAW,
OBJECT_USER_DATA        OUT     "<ADT_1>",
DEQ_CONDITION           IN      VARCHAR2          DEFAULT NULL,
SIGNATURE               IN      SYS.AQ$_SIG_PROP  DEFAULT NULL,
OUT_SIGN                OUT     SYS.AQ$_SIG_PROP,
TRANSFORMATION          IN      VARCHAR2        DEFAULT NULL,
BUFMESG_PROP            IN      BINARY_INTEGER  DEFAULT NULL,
LCR2XML_CONVERT         IN      BOOLEAN         DEFAULT FALSE);
PROCEDURE AQ$_DEQUEUE(
QUEUE_NAME              IN      VARCHAR2,
SUBSCRIBER              IN      VARCHAR2        DEFAULT NULL,
MSGID                   IN      RAW             DEFAULT NULL,
CORRELATION             IN      VARCHAR2        DEFAULT NULL,
DEQUEUE_MODE            IN      BINARY_INTEGER  DEFAULT REMOVE,
NAVIGATION              IN      BINARY_INTEGER  DEFAULT FIRST,
VISIBILITY              IN      BINARY_INTEGER  DEFAULT ON_COMMIT,
WAIT                    IN      BINARY_INTEGER  DEFAULT FOREVER,
ENQUEUE_TIME            OUT     DATE,
STATE                   OUT     BINARY_INTEGER,
OUT_MSGID               OUT     RAW,
OUT_CORRELATION         OUT     VARCHAR2,
PRIORITY                OUT     BINARY_INTEGER,
DELAY                   OUT     BINARY_INTEGER,
EXPIRATION              OUT     BINARY_INTEGER,
ATTEMPTS                OUT     BINARY_INTEGER,
EXCEPTION_QUEUE         OUT     VARCHAR2,
REMOTE_RECIPIENTS       OUT     AQ$_RECIPIENT_LIST_T,
SENDER_NAME             OUT     VARCHAR2,
SENDER_ADDR             OUT     VARCHAR2,
SENDER_PROTOCOL         OUT     BINARY_INTEGER,
ORIGINAL_MSGID          OUT     RAW,
PAYLOAD_TYPE            IN      BINARY_INTEGER    DEFAULT OBJECT_TYPE,
RAW_USER_DATA           OUT     RAW,
OBJECT_USER_DATA        OUT     "<ADT_1>",
DEQ_CONDITION           IN      VARCHAR2          DEFAULT NULL,
SIGNATURE               IN      SYS.AQ$_SIG_PROP  DEFAULT NULL,
OUT_SIGN                OUT     SYS.AQ$_SIG_PROP,
TRANSFORMATION          IN      VARCHAR2        DEFAULT NULL,
BUFMESG_PROP            IN      BINARY_INTEGER  DEFAULT NULL,
LCR2XML_CONVERT         IN      BOOLEAN         DEFAULT FALSE,
USER_PROPERTY           OUT     SYS.ANYDATA
);
PROCEDURE AQ$_DEQUEUE(
QUEUE_NAME              IN      VARCHAR2,
SUBSCRIBER              IN      VARCHAR2        DEFAULT NULL,
MSGID                   IN      RAW             DEFAULT NULL,
CORRELATION             IN      VARCHAR2        DEFAULT NULL,
DEQUEUE_MODE            IN      BINARY_INTEGER  DEFAULT REMOVE,
NAVIGATION              IN      BINARY_INTEGER  DEFAULT FIRST,
VISIBILITY              IN      BINARY_INTEGER  DEFAULT ON_COMMIT,
WAIT                    IN      BINARY_INTEGER  DEFAULT FOREVER,
ENQUEUE_TIME            OUT     DATE,
STATE                   OUT     BINARY_INTEGER,
OUT_MSGID               OUT     RAW,
OUT_CORRELATION         OUT     VARCHAR2,
PRIORITY                OUT     BINARY_INTEGER,
DELAY                   OUT     BINARY_INTEGER,
EXPIRATION              OUT     BINARY_INTEGER,
ATTEMPTS                OUT     BINARY_INTEGER,
EXCEPTION_QUEUE         OUT     VARCHAR2,
REMOTE_RECIPIENTS       OUT     AQ$_RECIPIENT_LIST_T,
SENDER_NAME             OUT     VARCHAR2,
SENDER_ADDR             OUT     VARCHAR2,
SENDER_PROTOCOL         OUT     BINARY_INTEGER,
ORIGINAL_MSGID          OUT     RAW,
PAYLOAD_TYPE            IN      BINARY_INTEGER    DEFAULT OBJECT_TYPE,
RAW_USER_DATA           OUT     RAW,
OBJECT_USER_DATA        OUT     "<ADT_1>",
DEQ_CONDITION           IN      VARCHAR2          DEFAULT NULL,
SIGNATURE               IN      SYS.AQ$_SIG_PROP  DEFAULT NULL,
OUT_SIGN                OUT     SYS.AQ$_SIG_PROP,
TRANSFORMATION          IN      VARCHAR2        DEFAULT NULL,
BUFMESG_PROP            IN      BINARY_INTEGER  DEFAULT NULL,
LCR2XML_CONVERT         IN      BOOLEAN         DEFAULT FALSE,
USER_PROPERTY           OUT     SYS.ANYDATA,
DELIVERY_MODE           IN      PLS_INTEGER      DEFAULT PERSISTENT,
OUT_DELIVERY_MODE       OUT     PLS_INTEGER
);
END DBMS_AQ;

PL/SQL procedure successfully completed.

SQL> exec mypkg.unwrap_obj_a(upper('dbms_aq'),'PACKAGE BODY','SYS')
PACKAGE BODY dbms_aq AS
PROCEDURE AQ$_ENQUEUE(
QUEUE_NAME           IN      VARCHAR2,
SENDER_NAME          IN      VARCHAR2         DEFAULT NULL,
SENDER_ADDR          IN      VARCHAR2         DEFAULT NULL,
SENDER_PROTOCOL      IN      BINARY_INTEGER   DEFAULT NULL,
ORIGINAL_MSGID       IN      RAW              DEFAULT NULL,
CORRELATION          IN      VARCHAR2         DEFAULT NULL,
VISIBILITY           IN      BINARY_INTEGER   DEFAULT ON_COMMIT,
PRIORITY             IN      BINARY_INTEGER   DEFAULT 1,
DELAY                IN      BINARY_INTEGER   DEFAULT 0,
EXPIRATION           IN      BINARY_INTEGER   DEFAULT NEVER,
RELATIVE_MSGID       IN      RAW              DEFAULT NULL,
SEQUENCE_DEVIATION   IN      BINARY_INTEGER   DEFAULT NULL,
EXCEPTION_QUEUE      IN      VARCHAR2         DEFAULT NULL,
RECIPIENTS           IN      AQ$_RECIPIENT_LIST_T,
PAYLOAD_TYPE         IN      BINARY_INTEGER   DEFAULT OBJECT_TYPE,
RAW_USER_DATA        IN      RAW              DEFAULT NULL,
OBJECT_USER_DATA     IN      "<ADT_1>",
MSGID                OUT     RAW,
SIGNATURE            IN      AQ$_SIG_PROP     DEFAULT NULL,
TRANSFORMATION       IN      VARCHAR2         DEFAULT NULL,
BUFMESG_PROP         IN      BINARY_INTEGER   DEFAULT NULL,
ANYDATA_CONVERT      IN      BOOLEAN          DEFAULT FALSE,
LCR2XML_CONVERT      IN      BOOLEAN          DEFAULT FALSE,
USER_PROPERTY        IN      SYS.ANYDATA      DEFAULT NULL,
DELIVERY_MODE        IN      PLS_INTEGER      DEFAULT PERSISTENT
) IS
EXTERNAL
NAME "kwqiexenqueue"
WITH CONTEXT
PARAMETERS(CONTEXT,
QUEUE_NAME          OCISTRING,   QUEUE_NAME         INDICATOR SB4,
SENDER_NAME         OCISTRING,   SENDER_NAME        INDICATOR SB4,
SENDER_ADDR         OCISTRING,   SENDER_ADDR        INDICATOR SB4,
SENDER_PROTOCOL     SB4,         SENDER_PROTOCOL    INDICATOR SB4,
ORIGINAL_MSGID      OCIRAW,      ORIGINAL_MSGID     INDICATOR SB4,
CORRELATION         OCISTRING,   CORRELATION        INDICATOR SB4,
VISIBILITY          SB4,         VISIBILITY         INDICATOR SB4,
PRIORITY            SB4,         PRIORITY           INDICATOR SB4,
DELAY               SB4,         DELAY              INDICATOR SB4,
EXPIRATION          SB4,         EXPIRATION         INDICATOR SB4,
RELATIVE_MSGID      OCIRAW,      RELATIVE_MSGID     INDICATOR SB4,
SEQUENCE_DEVIATION  SB4,
SEQUENCE_DEVIATION  INDICATOR SB4,
EXCEPTION_QUEUE     OCISTRING,
EXCEPTION_QUEUE     INDICATOR SB4,
PAYLOAD_TYPE        SB4,
RAW_USER_DATA       OCIRAW,      RAW_USER_DATA      INDICATOR SB4,
OBJECT_USER_DATA,
OBJECT_USER_DATA     INDICATOR STRUCT,
OBJECT_USER_DATA     TDO OCITYPE,
RECIPIENTS           OCICOLL,
MSGID                OCIRAW,
SIGNATURE,
SIGNATURE            INDICATOR STRUCT,
SIGNATURE            TDO OCITYPE,
TRANSFORMATION       OCISTRING,
TRANSFORMATION       INDICATOR SB4,
BUFMESG_PROP         SB4,
BUFMESG_PROP         INDICATOR SB4,
ANYDATA_CONVERT      SB4,
ANYDATA_CONVERT      INDICATOR  SB4,
LCR2XML_CONVERT      SB4,
LCR2XML_CONVERT      INDICATOR SB4,
USER_PROPERTY,
USER_PROPERTY        INDICATOR SB4,
DELIVERY_MODE        SB4
)
LIBRARY DBMS_AQ_LIB;
PROCEDURE AQ$_DEQUEUE(
QUEUE_NAME              IN      VARCHAR2,
SUBSCRIBER              IN      VARCHAR2        DEFAULT NULL,
MSGID                   IN      RAW             DEFAULT NULL,
CORRELATION             IN      VARCHAR2        DEFAULT NULL,
DEQUEUE_MODE            IN      BINARY_INTEGER  DEFAULT REMOVE,
NAVIGATION              IN      BINARY_INTEGER  DEFAULT FIRST,
VISIBILITY              IN      BINARY_INTEGER  DEFAULT ON_COMMIT,
WAIT                    IN      BINARY_INTEGER  DEFAULT FOREVER,
ENQUEUE_TIME            OUT     DATE,
STATE                   OUT     BINARY_INTEGER,
OUT_MSGID               OUT     RAW,
OUT_CORRELATION         OUT     VARCHAR2,
PRIORITY                OUT     BINARY_INTEGER,
DELAY                   OUT     BINARY_INTEGER,
EXPIRATION              OUT     BINARY_INTEGER,
ATTEMPTS                OUT     BINARY_INTEGER,
EXCEPTION_QUEUE         OUT     VARCHAR2,
REMOTE_RECIPIENTS       OUT     AQ$_RECIPIENT_LIST_T,
SENDER_NAME             OUT     VARCHAR2,
SENDER_ADDR             OUT     VARCHAR2,
SENDER_PROTOCOL         OUT     BINARY_INTEGER,
ORIGINAL_MSGID          OUT     RAW,
PAYLOAD_TYPE            IN      BINARY_INTEGER  DEFAULT OBJECT_TYPE,
RAW_USER_DATA           OUT     RAW,
OBJECT_USER_DATA        OUT     "<ADT_1>",
DEQ_CONDITION           IN      VARCHAR2        DEFAULT NULL,
SIGNATURE               IN      SYS.AQ$_SIG_PROP  DEFAULT NULL,
OUT_SIGN                OUT     SYS.AQ$_SIG_PROP,
TRANSFORMATION          IN      VARCHAR2          DEFAULT NULL,
BUFMESG_PROP            IN      BINARY_INTEGER    DEFAULT NULL,
LCR2XML_CONVERT         IN      BOOLEAN           DEFAULT FALSE,
USER_PROPERTY           OUT     SYS.ANYDATA
)
IS
EXTERNAL
NAME "kwqidxdequeue101"
WITH CONTEXT
PARAMETERS(CONTEXT,
QUEUE_NAME      OCISTRING,        QUEUE_NAME        INDICATOR SB4,
SUBSCRIBER      OCISTRING,        SUBSCRIBER        INDICATOR SB4,
MSGID           OCIRAW,           MSGID             INDICATOR SB4,
CORRELATION     OCISTRING,        CORRELATION       INDICATOR SB4,
DEQUEUE_MODE    SB4,
WAIT            SB4,              WAIT              INDICATOR SB4,
VISIBILITY      SB4,              VISIBILITY        INDICATOR SB4,
NAVIGATION      SB4,
OUT_MSGID       OCIRAW,
OUT_CORRELATION OCISTRING,        OUT_CORRELATION   INDICATOR SB4,
PRIORITY        SB4,              PRIORITY          INDICATOR SB4,
DELAY           SB4,              DELAY             INDICATOR SB4,
EXPIRATION      SB4,              EXPIRATION        INDICATOR SB4,
STATE           SB4,              STATE             INDICATOR SB4,
ENQUEUE_TIME    OCIDATE,          ENQUEUE_TIME      INDICATOR SB4,
ATTEMPTS        SB4,              ATTEMPTS          INDICATOR SB4,
EXCEPTION_QUEUE OCISTRING,           EXCEPTION_QUEUE   INDICATOR SB4,
REMOTE_RECIPIENTS         OCICOLL,
REMOTE_RECIPIENTS         INDICATOR SB2,
SENDER_NAME     OCISTRING,        SENDER_NAME       INDICATOR SB4,
SENDER_ADDR     OCISTRING,           SENDER_ADDR       INDICATOR SB4,
SENDER_PROTOCOL SB4,                 SENDER_PROTOCOL   INDICATOR SB4,
ORIGINAL_MSGID  OCIRAW,           ORIGINAL_MSGID    INDICATOR SB4,
PAYLOAD_TYPE    SB4,
RAW_USER_DATA   OCIRAW,           RAW_USER_DATA     INDICATOR SB4,
RAW_USER_DATA   MAXLEN    SB4,
OBJECT_USER_DATA,
OBJECT_USER_DATA INDICATOR STRUCT,
OBJECT_USER_DATA TDO OCITYPE,
OBJECT_USER_DATA DURATION OCIDURATION,
DEQ_CONDITION   OCISTRING,        DEQ_CONDITION     INDICATOR SB4,
SIGNATURE,
SIGNATURE INDICATOR STRUCT,
SIGNATURE TDO OCITYPE,
OUT_SIGN,
OUT_SIGN INDICATOR STRUCT,
OUT_SIGN TDO OCITYPE,
OUT_SIGN DURATION OCIDURATION,
TRANSFORMATION  OCISTRING,
TRANSFORMATION  INDICATOR SB4,
BUFMESG_PROP         SB4,
BUFMESG_PROP         INDICATOR SB4,
LCR2XML_CONVERT      SB4,
LCR2XML_CONVERT      INDICATOR SB4,
USER_PROPERTY,
USER_PROPERTY        INDICATOR SB4
)
LIBRARY DBMS_AQ_LIB;
PROCEDURE ENQUEUE(
QUEUE_NAME          IN  VARCHAR2,
ENQUEUE_OPTIONS     IN  ENQUEUE_OPTIONS_T,
MESSAGE_PROPERTIES  IN  MESSAGE_PROPERTIES_T,
PAYLOAD             IN  "<ADT_1>",
MSGID               OUT RAW) IS
EXTERNAL
NAME "kwqiadtenqueue"
WITH CONTEXT
PARAMETERS(CONTEXT,
QUEUE_NAME OCISTRING, QUEUE_NAME INDICATOR SB4,
ENQUEUE_OPTIONS,
ENQUEUE_OPTIONS INDICATOR STRUCT,
MESSAGE_PROPERTIES,
MESSAGE_PROPERTIES INDICATOR STRUCT,
PAYLOAD, PAYLOAD INDICATOR STRUCT, PAYLOAD TDO OCITYPE,
MSGID   OCIRAW)
LIBRARY DBMS_AQ_LIB;
PROCEDURE ENQUEUE(
QUEUE_NAME          IN  VARCHAR2,
ENQUEUE_OPTIONS     IN  ENQUEUE_OPTIONS_T,
MESSAGE_PROPERTIES  IN  MESSAGE_PROPERTIES_T,
PAYLOAD             IN  RAW,
MSGID               OUT RAW) IS
SNAME VARCHAR2(30) := NULL;
SADDR VARCHAR2(1024) := NULL;
SPROTOCOL NUMBER := NULL;
ORIG_MID RAW(16) := NULL;
BEGIN
IF MESSAGE_PROPERTIES.SENDER_ID IS NOT NULL THEN
SNAME := MESSAGE_PROPERTIES.SENDER_ID.NAME;
SADDR := MESSAGE_PROPERTIES.SENDER_ID.ADDRESS;
SPROTOCOL := MESSAGE_PROPERTIES.SENDER_ID.PROTOCOL;
END IF;
IF MESSAGE_PROPERTIES.ORIGINAL_MSGID IS NOT NULL THEN
ORIG_MID := MESSAGE_PROPERTIES.ORIGINAL_MSGID;
END IF;
AQ$_ENQUEUE(
QUEUE_NAME => QUEUE_NAME,
SENDER_NAME => SNAME,
SENDER_ADDR => SADDR,
SENDER_PROTOCOL => SPROTOCOL,
ORIGINAL_MSGID => ORIG_MID,
VISIBILITY => ENQUEUE_OPTIONS.VISIBILITY,
RELATIVE_MSGID => ENQUEUE_OPTIONS.RELATIVE_MSGID,
SEQUENCE_DEVIATION => ENQUEUE_OPTIONS.SEQUENCE_DEVIATION,
CORRELATION => MESSAGE_PROPERTIES.CORRELATION,
PRIORITY => MESSAGE_PROPERTIES.PRIORITY,
DELAY => MESSAGE_PROPERTIES.DELAY,
EXPIRATION => MESSAGE_PROPERTIES.EXPIRATION,
EXCEPTION_QUEUE => MESSAGE_PROPERTIES.EXCEPTION_QUEUE,
TRANSFORMATION => ENQUEUE_OPTIONS.TRANSFORMATION,
RECIPIENTS => MESSAGE_PROPERTIES.RECIPIENT_LIST,
MSGID => MSGID,
PAYLOAD_TYPE => RAW_TYPE,
RAW_USER_DATA => PAYLOAD,
OBJECT_USER_DATA => NULL,
SIGNATURE => MESSAGE_PROPERTIES.SIGNATURE,
BUFMESG_PROP => ENQUEUE_OPTIONS.BUFMESG_PROP,
USER_PROPERTY => MESSAGE_PROPERTIES.USER_PROPERTY,
DELIVERY_MODE => ENQUEUE_OPTIONS.DELIVERY_MODE);
END;
PROCEDURE ENQUEUE(
QUEUE_NAME          IN  VARCHAR2,
ENQUEUE_OPTIONS     IN  ENQUEUE_OPTIONS_T,
MESSAGE_PROPERTIES  IN  MESSAGE_PROPERTIES_T,
PAYLOAD             IN  "<OPAQUE_1>",
MSGID               OUT RAW) IS
EXTERNAL
NAME "kwqiopqenqueue"
WITH CONTEXT
PARAMETERS(CONTEXT,
QUEUE_NAME OCISTRING, QUEUE_NAME INDICATOR SB4,
ENQUEUE_OPTIONS,
ENQUEUE_OPTIONS INDICATOR STRUCT,
MESSAGE_PROPERTIES,
MESSAGE_PROPERTIES INDICATOR STRUCT,
PAYLOAD, PAYLOAD INDICATOR SB2, PAYLOAD TDO OCITYPE,
MSGID   OCIRAW)
LIBRARY DBMS_AQ_LIB;
FUNCTION ENQUEUE_ARRAY (
QUEUE_NAME                IN    VARCHAR2,
ENQUEUE_OPTIONS           IN    ENQUEUE_OPTIONS_T,
ARRAY_SIZE                IN    PLS_INTEGER,
MESSAGE_PROPERTIES_ARRAY  IN    MESSAGE_PROPERTIES_ARRAY_T,
PAYLOAD_ARRAY             IN    "<COLLECTION_1>",
MSGID_ARRAY               OUT   MSGID_ARRAY_T) RETURN PLS_INTEGER IS
EXTERNAL
NAME "kwqienqarray0"
WITH CONTEXT
PARAMETERS(CONTEXT,
QUEUE_NAME OCISTRING, QUEUE_NAME INDICATOR SB4,
ENQUEUE_OPTIONS,
ENQUEUE_OPTIONS INDICATOR STRUCT,
ARRAY_SIZE UB4,
MESSAGE_PROPERTIES_ARRAY,
MESSAGE_PROPERTIES_ARRAY INDICATOR,
PAYLOAD_ARRAY, PAYLOAD_ARRAY INDICATOR, PAYLOAD_ARRAY TDO OCITYPE,
MSGID_ARRAY,
RETURN UB4)
LIBRARY DBMS_AQ_LIB;
FUNCTION ENQUEUE_ARRAY (
QUEUE_NAME                IN    VARCHAR2,
ENQUEUE_OPTIONS           IN    ENQUEUE_OPTIONS_T,
ARRAY_SIZE                IN    PLS_INTEGER,
MESSAGE_PROPERTIES_ARRAY  IN    MESSAGE_PROPERTIES_ARRAY_T,
PAYLOAD_ARRAY             IN    "<COLLECTION_1>",
MSGID_ARRAY               OUT   MSGID_ARRAY_T,
ERROR_ARRAY               OUT   ERROR_ARRAY_T) RETURN PLS_INTEGER IS
EXTERNAL
NAME "kwqienqarray"
WITH CONTEXT
PARAMETERS(CONTEXT,
QUEUE_NAME OCISTRING, QUEUE_NAME INDICATOR SB4,
ENQUEUE_OPTIONS,
ENQUEUE_OPTIONS INDICATOR STRUCT,
ARRAY_SIZE UB4,
MESSAGE_PROPERTIES_ARRAY,
MESSAGE_PROPERTIES_ARRAY INDICATOR,
PAYLOAD_ARRAY, PAYLOAD_ARRAY INDICATOR, PAYLOAD_ARRAY TDO OCITYPE,
MSGID_ARRAY,
ERROR_ARRAY,ERROR_ARRAY INDICATOR SB2,
ERROR_ARRAY DURATION OCIDURATION,
RETURN UB4)
LIBRARY DBMS_AQ_LIB;
PROCEDURE DEQUEUE(
QUEUE_NAME           IN         VARCHAR2,
DEQUEUE_OPTIONS      IN         DEQUEUE_OPTIONS_T,
MESSAGE_PROPERTIES   OUT        MESSAGE_PROPERTIES_T,
PAYLOAD              OUT       "<OPAQUE_1>",
MSGID                OUT        RAW) IS
EXTERNAL
NAME "kwqiopqdequeue"
WITH CONTEXT
PARAMETERS(CONTEXT,
QUEUE_NAME      OCISTRING,        QUEUE_NAME        INDICATOR SB4,
DEQUEUE_OPTIONS,
DEQUEUE_OPTIONS INDICATOR STRUCT,
MESSAGE_PROPERTIES,
MESSAGE_PROPERTIES INDICATOR STRUCT,
MESSAGE_PROPERTIES DURATION OCIDURATION,
PAYLOAD, PAYLOAD INDICATOR SB2,
PAYLOAD TDO OCITYPE, PAYLOAD DURATION OCIDURATION,
MSGID   OCIRAW)
LIBRARY DBMS_AQ_LIB;
PROCEDURE DEQUEUE(
QUEUE_NAME           IN         VARCHAR2,
DEQUEUE_OPTIONS      IN         DEQUEUE_OPTIONS_T,
MESSAGE_PROPERTIES   OUT        MESSAGE_PROPERTIES_T,
PAYLOAD              OUT        "<ADT_1>",
MSGID                OUT        RAW) IS
EXTERNAL
NAME "kwqiadtdequeue"
WITH CONTEXT
PARAMETERS(CONTEXT,
QUEUE_NAME      OCISTRING,        QUEUE_NAME        INDICATOR SB4,
DEQUEUE_OPTIONS,
DEQUEUE_OPTIONS INDICATOR STRUCT,
MESSAGE_PROPERTIES,
MESSAGE_PROPERTIES INDICATOR STRUCT,
MESSAGE_PROPERTIES DURATION OCIDURATION,
PAYLOAD, PAYLOAD INDICATOR STRUCT,
PAYLOAD TDO OCITYPE, PAYLOAD DURATION OCIDURATION,
MSGID   OCIRAW)
LIBRARY DBMS_AQ_LIB;
PROCEDURE AQ$_DEQUEUE(
QUEUE_NAME              IN      VARCHAR2,
SUBSCRIBER              IN      VARCHAR2        DEFAULT NULL,
MSGID                   IN      RAW             DEFAULT NULL,
CORRELATION             IN      VARCHAR2        DEFAULT NULL,
DEQUEUE_MODE            IN      BINARY_INTEGER  DEFAULT REMOVE,
NAVIGATION              IN      BINARY_INTEGER  DEFAULT FIRST,
VISIBILITY              IN      BINARY_INTEGER  DEFAULT ON_COMMIT,
WAIT                    IN      BINARY_INTEGER  DEFAULT FOREVER,
ENQUEUE_TIME            OUT     DATE,
STATE                   OUT     BINARY_INTEGER,
OUT_MSGID               OUT     RAW,
OUT_CORRELATION         OUT     VARCHAR2,
PRIORITY                OUT     BINARY_INTEGER,
DELAY                   OUT     BINARY_INTEGER,
EXPIRATION              OUT     BINARY_INTEGER,
ATTEMPTS                OUT     BINARY_INTEGER,
EXCEPTION_QUEUE         OUT     VARCHAR2,
REMOTE_RECIPIENTS       OUT     AQ$_RECIPIENT_LIST_T,
SENDER_NAME             OUT     VARCHAR2,
SENDER_ADDR             OUT     VARCHAR2,
SENDER_PROTOCOL         OUT     BINARY_INTEGER,
ORIGINAL_MSGID          OUT     RAW,
PAYLOAD_TYPE            IN      BINARY_INTEGER  DEFAULT OBJECT_TYPE,
RAW_USER_DATA           OUT     RAW,
OBJECT_USER_DATA        OUT     "<ADT_1>",
DEQ_CONDITION           IN      VARCHAR2        DEFAULT NULL,
SIGNATURE               IN      SYS.AQ$_SIG_PROP  DEFAULT NULL,
OUT_SIGN                OUT     SYS.AQ$_SIG_PROP,
TRANSFORMATION          IN      VARCHAR2          DEFAULT NULL,
BUFMESG_PROP            IN      BINARY_INTEGER    DEFAULT NULL,
LCR2XML_CONVERT         IN      BOOLEAN           DEFAULT FALSE,
USER_PROPERTY           OUT     SYS.ANYDATA,
DELIVERY_MODE           IN      PLS_INTEGER       DEFAULT PERSISTENT,
OUT_DELIVERY_MODE       OUT     PLS_INTEGER
)
IS
EXTERNAL
NAME "kwqidxdequeue102"
WITH CONTEXT
PARAMETERS(CONTEXT,
QUEUE_NAME      OCISTRING,        QUEUE_NAME        INDICATOR SB4,
SUBSCRIBER      OCISTRING,        SUBSCRIBER        INDICATOR SB4,
MSGID           OCIRAW,           MSGID             INDICATOR SB4,
CORRELATION     OCISTRING,        CORRELATION       INDICATOR SB4,
DEQUEUE_MODE    SB4,
WAIT            SB4,              WAIT              INDICATOR SB4,
VISIBILITY      SB4,              VISIBILITY        INDICATOR SB4,
NAVIGATION      SB4,
OUT_MSGID       OCIRAW,
OUT_CORRELATION OCISTRING,        OUT_CORRELATION   INDICATOR SB4,
PRIORITY        SB4,              PRIORITY          INDICATOR SB4,
DELAY           SB4,              DELAY             INDICATOR SB4,
EXPIRATION      SB4,              EXPIRATION        INDICATOR SB4,
STATE           SB4,              STATE             INDICATOR SB4,
ENQUEUE_TIME    OCIDATE,          ENQUEUE_TIME      INDICATOR SB4,
ATTEMPTS        SB4,              ATTEMPTS          INDICATOR SB4,
EXCEPTION_QUEUE OCISTRING,           EXCEPTION_QUEUE   INDICATOR SB4,
REMOTE_RECIPIENTS         OCICOLL,
REMOTE_RECIPIENTS         INDICATOR SB2,
SENDER_NAME     OCISTRING,        SENDER_NAME       INDICATOR SB4,
SENDER_ADDR     OCISTRING,           SENDER_ADDR       INDICATOR SB4,
SENDER_PROTOCOL SB4,                 SENDER_PROTOCOL   INDICATOR SB4,
ORIGINAL_MSGID  OCIRAW,           ORIGINAL_MSGID    INDICATOR SB4,
PAYLOAD_TYPE    SB4,
RAW_USER_DATA   OCIRAW,           RAW_USER_DATA     INDICATOR SB4,
RAW_USER_DATA   MAXLEN    SB4,
OBJECT_USER_DATA,
OBJECT_USER_DATA INDICATOR STRUCT,
OBJECT_USER_DATA TDO OCITYPE,
OBJECT_USER_DATA DURATION OCIDURATION,
DEQ_CONDITION   OCISTRING,        DEQ_CONDITION     INDICATOR SB4,
SIGNATURE,
SIGNATURE INDICATOR STRUCT,
SIGNATURE TDO OCITYPE,
OUT_SIGN,
OUT_SIGN INDICATOR STRUCT,
OUT_SIGN TDO OCITYPE,
OUT_SIGN DURATION OCIDURATION,
TRANSFORMATION  OCISTRING,
TRANSFORMATION  INDICATOR SB4,
BUFMESG_PROP         SB4,
BUFMESG_PROP         INDICATOR SB4,
LCR2XML_CONVERT      SB4,
LCR2XML_CONVERT      INDICATOR SB4,
USER_PROPERTY,
USER_PROPERTY        INDICATOR SB4,
USER_PROPERTY        DURATION OCIDURATION,
DELIVERY_MODE        SB4,
OUT_DELIVERY_MODE    SB4
)
LIBRARY DBMS_AQ_LIB;
PROCEDURE AQ$_DEQUEUE(
QUEUE_NAME              IN      VARCHAR2,
SUBSCRIBER              IN      VARCHAR2        DEFAULT NULL,
MSGID                   IN      RAW             DEFAULT NULL,
CORRELATION             IN      VARCHAR2        DEFAULT NULL,
DEQUEUE_MODE            IN      BINARY_INTEGER  DEFAULT REMOVE,
NAVIGATION              IN      BINARY_INTEGER  DEFAULT FIRST,
VISIBILITY              IN      BINARY_INTEGER  DEFAULT ON_COMMIT,
WAIT                    IN      BINARY_INTEGER  DEFAULT FOREVER,
ENQUEUE_TIME            OUT     DATE,
STATE                   OUT     BINARY_INTEGER,
OUT_MSGID               OUT     RAW,
OUT_CORRELATION         OUT     VARCHAR2,
PRIORITY                OUT     BINARY_INTEGER,
DELAY                   OUT     BINARY_INTEGER,
EXPIRATION              OUT     BINARY_INTEGER,
ATTEMPTS                OUT     BINARY_INTEGER,
EXCEPTION_QUEUE         OUT     VARCHAR2,
REMOTE_RECIPIENTS       OUT     AQ$_RECIPIENT_LIST_T,
SENDER_NAME             OUT     VARCHAR2,
SENDER_ADDR             OUT     VARCHAR2,
SENDER_PROTOCOL         OUT     BINARY_INTEGER,
ORIGINAL_MSGID          OUT     RAW,
PAYLOAD_TYPE            IN      BINARY_INTEGER  DEFAULT OBJECT_TYPE,
RAW_USER_DATA           OUT     RAW,
OBJECT_USER_DATA        OUT     "<ADT_1>",
DEQ_CONDITION           IN      VARCHAR2        DEFAULT NULL,
SIGNATURE               IN      SYS.AQ$_SIG_PROP  DEFAULT NULL,
OUT_SIGN                OUT     SYS.AQ$_SIG_PROP,
TRANSFORMATION          IN      VARCHAR2         DEFAULT NULL,
BUFMESG_PROP            IN      BINARY_INTEGER   DEFAULT NULL,
LCR2XML_CONVERT         IN      BOOLEAN          DEFAULT FALSE)
IS
EXTERNAL
NAME "kwqidxdequeue92"
WITH CONTEXT
PARAMETERS(CONTEXT,
QUEUE_NAME      OCISTRING,        QUEUE_NAME        INDICATOR SB4,
SUBSCRIBER      OCISTRING,        SUBSCRIBER        INDICATOR SB4,
MSGID           OCIRAW,           MSGID             INDICATOR SB4,
CORRELATION     OCISTRING,        CORRELATION       INDICATOR SB4,
DEQUEUE_MODE    SB4,
WAIT            SB4,              WAIT              INDICATOR SB4,
VISIBILITY      SB4,              VISIBILITY        INDICATOR SB4,
NAVIGATION      SB4,
OUT_MSGID       OCIRAW,
OUT_CORRELATION OCISTRING,        OUT_CORRELATION   INDICATOR SB4,
PRIORITY        SB4,              PRIORITY          INDICATOR SB4,
DELAY           SB4,              DELAY             INDICATOR SB4,
EXPIRATION      SB4,              EXPIRATION        INDICATOR SB4,
STATE           SB4,              STATE             INDICATOR SB4,
ENQUEUE_TIME    OCIDATE,          ENQUEUE_TIME      INDICATOR SB4,
ATTEMPTS        SB4,              ATTEMPTS          INDICATOR SB4,
EXCEPTION_QUEUE OCISTRING,           EXCEPTION_QUEUE   INDICATOR SB4,
REMOTE_RECIPIENTS         OCICOLL,
REMOTE_RECIPIENTS         INDICATOR SB2,
SENDER_NAME     OCISTRING,        SENDER_NAME       INDICATOR SB4,
SENDER_ADDR     OCISTRING,           SENDER_ADDR       INDICATOR SB4,
SENDER_PROTOCOL SB4,                 SENDER_PROTOCOL   INDICATOR SB4,
ORIGINAL_MSGID  OCIRAW,           ORIGINAL_MSGID    INDICATOR SB4,
PAYLOAD_TYPE    SB4,
RAW_USER_DATA   OCIRAW,           RAW_USER_DATA     INDICATOR SB4,
RAW_USER_DATA   MAXLEN    SB4,
OBJECT_USER_DATA,
OBJECT_USER_DATA INDICATOR STRUCT,
OBJECT_USER_DATA TDO OCITYPE,
OBJECT_USER_DATA DURATION OCIDURATION,
DEQ_CONDITION   OCISTRING,        DEQ_CONDITION     INDICATOR SB4,
SIGNATURE,
SIGNATURE INDICATOR STRUCT,
SIGNATURE TDO OCITYPE,
OUT_SIGN,
OUT_SIGN INDICATOR STRUCT,
OUT_SIGN TDO OCITYPE,
OUT_SIGN DURATION OCIDURATION,
TRANSFORMATION  OCISTRING,
TRANSFORMATION  INDICATOR SB4,
BUFMESG_PROP         SB4,
BUFMESG_PROP         INDICATOR SB4,
LCR2XML_CONVERT      SB4,
LCR2XML_CONVERT      INDICATOR SB4
)
LIBRARY DBMS_AQ_LIB;
PROCEDURE DEQUEUE(
QUEUE_NAME           IN         VARCHAR2,
DEQUEUE_OPTIONS      IN         DEQUEUE_OPTIONS_T,
MESSAGE_PROPERTIES   OUT        MESSAGE_PROPERTIES_T,
PAYLOAD              OUT        RAW,
MSGID                OUT        RAW) IS
DUMMY_BUFFER   SYS.AQ$_DUMMY_T;
SENDER_NAME    VARCHAR2(30);
SENDER_ADDRESS VARCHAR2(1024);
SENDER_PROTOCOL NUMBER;
SENDER_ID      SYS.AQ$_AGENT;
BEGIN
SENDER_ID := SYS.AQ$_AGENT('name', 'address', 0);
AQ$_DEQUEUE(
QUEUE_NAME  => QUEUE_NAME,
SUBSCRIBER => DEQUEUE_OPTIONS.CONSUMER_NAME,
MSGID  => DEQUEUE_OPTIONS.MSGID,
CORRELATION => DEQUEUE_OPTIONS.CORRELATION,
DEQ_CONDITION => DEQUEUE_OPTIONS.DEQ_CONDITION,
DEQUEUE_MODE => DEQUEUE_OPTIONS.DEQUEUE_MODE,
NAVIGATION => DEQUEUE_OPTIONS.NAVIGATION,
WAIT => DEQUEUE_OPTIONS.WAIT,
VISIBILITY => DEQUEUE_OPTIONS.VISIBILITY,
OUT_MSGID => MSGID,
OUT_CORRELATION => MESSAGE_PROPERTIES.CORRELATION,
ENQUEUE_TIME => MESSAGE_PROPERTIES.ENQUEUE_TIME,
STATE =>  MESSAGE_PROPERTIES.STATE,
PRIORITY => MESSAGE_PROPERTIES.PRIORITY,
DELAY => MESSAGE_PROPERTIES.DELAY,
EXPIRATION => MESSAGE_PROPERTIES.EXPIRATION,
ATTEMPTS => MESSAGE_PROPERTIES.ATTEMPTS,
EXCEPTION_QUEUE => MESSAGE_PROPERTIES.EXCEPTION_QUEUE,
TRANSFORMATION => DEQUEUE_OPTIONS.TRANSFORMATION,
REMOTE_RECIPIENTS => MESSAGE_PROPERTIES.RECIPIENT_LIST,
SENDER_NAME => SENDER_NAME,
SENDER_ADDR => SENDER_ADDRESS,
SENDER_PROTOCOL => SENDER_PROTOCOL,
ORIGINAL_MSGID => MESSAGE_PROPERTIES.ORIGINAL_MSGID,
PAYLOAD_TYPE => RAW_TYPE,
RAW_USER_DATA => PAYLOAD,
OBJECT_USER_DATA => DUMMY_BUFFER,
SIGNATURE => DEQUEUE_OPTIONS.SIGNATURE,
OUT_SIGN => MESSAGE_PROPERTIES.SIGNATURE,
BUFMESG_PROP => DEQUEUE_OPTIONS.BUFMESG_PROP,
USER_PROPERTY => MESSAGE_PROPERTIES.USER_PROPERTY,
DELIVERY_MODE => DEQUEUE_OPTIONS.DELIVERY_MODE,
OUT_DELIVERY_MODE => MESSAGE_PROPERTIES.DELIVERY_MODE);
IF (SENDER_NAME IS NULL AND SENDER_ADDRESS IS NULL AND
SENDER_PROTOCOL IS NULL) THEN
MESSAGE_PROPERTIES.SENDER_ID := NULL;
ELSE
IF SENDER_NAME IS NOT NULL THEN
SENDER_ID.NAME := SENDER_NAME;
ELSE
SENDER_ID.NAME := NULL;
END IF;
IF SENDER_ADDRESS IS NOT NULL THEN
SENDER_ID.ADDRESS := SENDER_ADDRESS;
ELSE
SENDER_ID.ADDRESS := NULL;
END IF;
IF SENDER_PROTOCOL IS NOT NULL THEN
SENDER_ID.PROTOCOL := SENDER_PROTOCOL;
ELSE
SENDER_ID.PROTOCOL := NULL;
END IF;
MESSAGE_PROPERTIES.SENDER_ID := SENDER_ID;
END IF;
END;
FUNCTION DEQUEUE_ARRAY(
QUEUE_NAME                IN    VARCHAR2,
DEQUEUE_OPTIONS           IN    DEQUEUE_OPTIONS_T,
ARRAY_SIZE                IN    PLS_INTEGER,
MESSAGE_PROPERTIES_ARRAY  OUT   MESSAGE_PROPERTIES_ARRAY_T,
PAYLOAD_ARRAY             OUT   "<COLLECTION_1>",
MSGID_ARRAY               OUT   MSGID_ARRAY_T) RETURN PLS_INTEGER IS
EXTERNAL
NAME "kwqideqarray0"
WITH CONTEXT
PARAMETERS(CONTEXT,
QUEUE_NAME      OCISTRING,        QUEUE_NAME        INDICATOR SB4,
DEQUEUE_OPTIONS,
DEQUEUE_OPTIONS INDICATOR STRUCT,
ARRAY_SIZE UB4,
MESSAGE_PROPERTIES_ARRAY,
MESSAGE_PROPERTIES_ARRAY INDICATOR,
MESSAGE_PROPERTIES_ARRAY TDO OCITYPE,
MESSAGE_PROPERTIES_ARRAY DURATION OCIDURATION,
PAYLOAD_ARRAY, PAYLOAD_ARRAY INDICATOR SB2,
PAYLOAD_ARRAY TDO OCITYPE, PAYLOAD_ARRAY DURATION OCIDURATION,
MSGID_ARRAY,MSGID_ARRAY INDICATOR, MSGID_ARRAY DURATION OCIDURATION,
RETURN UB4)
LIBRARY DBMS_AQ_LIB;
FUNCTION DEQUEUE_ARRAY(
QUEUE_NAME                IN    VARCHAR2,
DEQUEUE_OPTIONS           IN    DEQUEUE_OPTIONS_T,
ARRAY_SIZE                IN    PLS_INTEGER,
MESSAGE_PROPERTIES_ARRAY  OUT   MESSAGE_PROPERTIES_ARRAY_T,
PAYLOAD_ARRAY             OUT   "<COLLECTION_1>",
MSGID_ARRAY               OUT   MSGID_ARRAY_T,
ERROR_ARRAY               OUT   ERROR_ARRAY_T) RETURN PLS_INTEGER IS
EXTERNAL
NAME "kwqideqarray"
WITH CONTEXT
PARAMETERS(CONTEXT,
QUEUE_NAME      OCISTRING,        QUEUE_NAME        INDICATOR SB4,
DEQUEUE_OPTIONS,
DEQUEUE_OPTIONS INDICATOR STRUCT,
ARRAY_SIZE UB4,
MESSAGE_PROPERTIES_ARRAY,
MESSAGE_PROPERTIES_ARRAY INDICATOR,
MESSAGE_PROPERTIES_ARRAY TDO OCITYPE,
MESSAGE_PROPERTIES_ARRAY DURATION OCIDURATION,
PAYLOAD_ARRAY, PAYLOAD_ARRAY INDICATOR SB2,
PAYLOAD_ARRAY TDO OCITYPE, PAYLOAD_ARRAY DURATION OCIDURATION,
MSGID_ARRAY,MSGID_ARRAY INDICATOR, MSGID_ARRAY DURATION OCIDURATION,
ERROR_ARRAY,ERROR_ARRAY INDICATOR SB2,
ERROR_ARRAY DURATION OCIDURATION,
RETURN UB4)
LIBRARY DBMS_AQ_LIB;
PROCEDURE LISTEN(
AGENT_LIST            IN    AQ$_AGENT_LIST_T,
WAIT                  IN    BINARY_INTEGER DEFAULT FOREVER,
LISTEN_DELIVERY_MODE  IN    PLS_INTEGER DEFAULT PERSISTENT,
AGENT                 OUT   SYS.AQ$_AGENT,
MESSAGE_DELIVERY_MODE OUT   PLS_INTEGER) IS
EXTERNAL
NAME "kwqilisten"
WITH CONTEXT
PARAMETERS(CONTEXT,
AGENT_LIST OCICOLL,
WAIT                   SB4,  WAIT                  INDICATOR SB4,
LISTEN_DELIVERY_MODE   SB4,
AGENT,                       AGENT                 INDICATOR STRUCT,
MESSAGE_DELIVERY_MODE  SB4)
LIBRARY DBMS_AQ_LIB;
PROCEDURE LISTEN(
AGENT_LIST           IN     AQ$_AGENT_LIST_T,
WAIT                 IN     BINARY_INTEGER DEFAULT FOREVER,
AGENT                OUT    SYS.AQ$_AGENT) IS
DELIV_MODE     PLS_INTEGER;
BEGIN
LISTEN(AGENT_LIST             => AGENT_LIST,
WAIT                   => WAIT,
LISTEN_DELIVERY_MODE   => PERSISTENT,
AGENT                  => AGENT,
MESSAGE_DELIVERY_MODE  => DELIV_MODE);
END LISTEN;
PROCEDURE BIND_AGENT(
AGENT                IN    AQ$_AGENT,
CERTIFICATE_LOCATION IN    VARCHAR2 DEFAULT NULL) IS
BEGIN
DBMS_AQADM_SYS.I_BIND_AGENT(AGENT => AGENT,
CERTIFICATE_LOCATION => CERTIFICATE_LOCATION);
END BIND_AGENT;
PROCEDURE UNBIND_AGENT(
AGENT                IN   AQ$_AGENT) IS
BEGIN
DBMS_AQADM_SYS.I_UNBIND_AGENT(AGENT => AGENT);
END UNBIND_AGENT;
PROCEDURE REGISTER(
REG_LIST      IN       SYS.AQ$_REG_INFO_LIST,
REG_COUNT     IN       NUMBER) IS
EXTERNAL
NAME "kwqiplsregister"
WITH CONTEXT
PARAMETERS(CONTEXT,
REG_LIST    OCICOLL,
REG_COUNT   OCINUMBER)
LIBRARY DBMS_AQ_LIB;
PROCEDURE UNREGISTER(
REG_LIST      IN       SYS.AQ$_REG_INFO_LIST,
REG_COUNT     IN       NUMBER) IS
EXTERNAL
NAME "kwqiplsunregister"
WITH CONTEXT
PARAMETERS(CONTEXT,
REG_LIST    OCICOLL,
REG_COUNT   OCINUMBER)
LIBRARY DBMS_AQ_LIB;
PROCEDURE POST(
POST_LIST     IN       SYS.AQ$_POST_INFO_LIST,
POST_COUNT    IN       NUMBER) IS
EXTERNAL
NAME "kwqiplspost"
WITH CONTEXT
PARAMETERS(CONTEXT,
POST_LIST    OCICOLL,
POST_COUNT   OCINUMBER)
LIBRARY DBMS_AQ_LIB;

END;

PL/SQL procedure successfully completed.

SQL>


这真不错,一定要改成java的



外部链接:
ZLIB Compressed Data Format Specification version 3.3
GZIP file format specification version 4.3
Multipurpose Internet Mail Extensions - (MIME) Part One: - Format of Internet Message Bodies
Adler-32
Cyclic redundancy check


加密方法见:how to protect your plsql code



-fin-

No comments:

Website Analytics

Followers