使用dbms_ddl包创建
declare
ddl varchar2(1000):='create or replace procedure p1(i number) is begin dbms_output.put_line(to_char(i));end;';
begin
dbms_ddl.create_wrapped(ddl);
end;
/
设置环境变量
set NLS_LANG=AMERICAN_AMERICA.USACII7
或
set NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
1.创建文件/oracle/test.sql
===========================================================
create or replace procedure test(i in number)
as
begin
dbms_output.put_line('That you input is '||to_char(i));
end;
/
===========================================================
2.运行wrap iname=test.sql
============================================================================
[oracle@redhat oracle]$ wrap iname=test.sql
PL/SQL Wrapper: Release 10.2.0.1.0- Production on Wed Sep 02 23:56:05 2009
Copyright (c) 1993, 2004, Oracle. All rights reserved.
Processing test.sql to test.plb
============================================================================
3.运行test.plb
=========================
SQL> @/oracle/test.plb
Procedure created.
=========================
4.运行存储过程
=========================
SQL> set serveroutput on
SQL> execute test(1);
=========================
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17012874/viewspace-693812/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/17012874/viewspace-693812/