1.建立测试存储过程
[oracle@TDSHUIFU admin]$ cat test.sql
CREATE OR REPLACE PROCEDURE wraptest IS
BEGIN
FOR i IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE('Emp Id: ' || i);
END LOOP;
END;
2.使用warp命令
[oracle@TDSHUIFU admin]$ wrap iname=test.sql oname=test.plb
PL/SQL Wrapper: Release 11.2.0.3.0- 64bit Production on Mon Feb 13 17:40:11 2017
Copyright (c) 1993, 2009, Oracle. All rights reserved.
Processing test.sql to test.plb
3.执行test.plb
SP2-0310: unable to open file "ORACLE_HOME/network/admin/test.plb"
SQL> @?/network/admin/test.plb
Procedure created.
4.测试执行
SQL> set serverout on
SQL> exec wraptest;
Emp Id: 1
Emp Id: 2
Emp Id: 3
Emp Id: 4
Emp Id: 5
Emp Id: 6
Emp Id: 7
Emp Id: 8
Emp Id: 9
Emp Id: 10
PL/SQL procedure successfully completed.
SQL> select text from user_source where name='WRAPTEST';
TEXT
--------------------------------------------------------------------------------
PROCEDURE wraptest wrapped
a000000
1
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
TEXT
--------------------------------------------------------------------------------
abcd
abcd
abcd
abcd
abcd
abcd
abcd
7
7c b6
jmRj7E1kqaGO7kMTznz63qxw6Dgwg6Rtf5nWfI5G2sHqaOjRa+JF3ofZHdeZs0cJEcasEd2V
LCBHuKUQxpBOJbe9Qbh+Tyr5M+dBpj2zE2LTppYIcBQKDeJPBKJxufvr8OtmOJ84PD7Z3aeX
TEXT
--------------------------------------------------------------------------------
rPnVzgUO3UKsCt/Q+uzkNGJSmWMcH+1bpI8=
[oracle@TDSHUIFU admin]$ cat test.sql
CREATE OR REPLACE PROCEDURE wraptest IS
BEGIN
FOR i IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE('Emp Id: ' || i);
END LOOP;
END;
2.使用warp命令
[oracle@TDSHUIFU admin]$ wrap iname=test.sql oname=test.plb
PL/SQL Wrapper: Release 11.2.0.3.0- 64bit Production on Mon Feb 13 17:40:11 2017
Copyright (c) 1993, 2009, Oracle. All rights reserved.
Processing test.sql to test.plb
3.执行test.plb
SP2-0310: unable to open file "ORACLE_HOME/network/admin/test.plb"
SQL> @?/network/admin/test.plb
Procedure created.
4.测试执行
SQL> set serverout on
SQL> exec wraptest;
Emp Id: 1
Emp Id: 2
Emp Id: 3
Emp Id: 4
Emp Id: 5
Emp Id: 6
Emp Id: 7
Emp Id: 8
Emp Id: 9
Emp Id: 10
PL/SQL procedure successfully completed.
SQL> select text from user_source where name='WRAPTEST';
TEXT
--------------------------------------------------------------------------------
PROCEDURE wraptest wrapped
a000000
1
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
TEXT
--------------------------------------------------------------------------------
abcd
abcd
abcd
abcd
abcd
abcd
abcd
7
7c b6
jmRj7E1kqaGO7kMTznz63qxw6Dgwg6Rtf5nWfI5G2sHqaOjRa+JF3ofZHdeZs0cJEcasEd2V
LCBHuKUQxpBOJbe9Qbh+Tyr5M+dBpj2zE2LTppYIcBQKDeJPBKJxufvr8OtmOJ84PD7Z3aeX
TEXT
--------------------------------------------------------------------------------
rPnVzgUO3UKsCt/Q+uzkNGJSmWMcH+1bpI8=
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7569309/viewspace-2133484/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7569309/viewspace-2133484/