Wrap PL/SQL Block [message #543149] |
Mon, 13 February 2012 03:55  |
 |
parthiv_t
Messages: 15 Registered: July 2011 Location: ahmedabad
|
Junior Member |
|
|
Hello everybody
I am familiar with WRAP command.
It is used in command prompt.
C:\> wrap iname=filename.sql
and this thing will convert filename.plb file.
but now I want to wrap my stored Procedure or function.
how can i do this thing?
where it is saved in my disk?
|
|
|
Re: Wrap PL/SQL Block [message #543150 is a reply to message #543149] |
Mon, 13 February 2012 03:57   |
 |
ramoradba
Messages: 2457 Registered: January 2009 Location: AndhraPradesh,Hyderabad,I...
|
Senior Member |
|
|
http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/wrap.htm#i3532
Quote:
The wrap utility processes an input SQL file and wraps only the PL/SQL units in the file, such as a package specification, package body, function, procedure, type specification, or type body. It does not wrap PL/SQL content in anonymous blocks or triggers or non-PL/SQL code.
wrap iname=input_file [ oname=output_file ]
input_file is the name of a file containing SQL statements, that you typically run using SQL*Plus. If you omit the file extension, an extension of .sql is assumed. For example, the following commands are equivalent:
output_file is the name of the wrapped file that is created. The defaults to that of the input file and its extension default is .plb. For example, the following commands are equivalent:
ex:
wrap iname=/mydir/myfile.sql oname=/mydir/myfile.plb
You can use the option oname to specify a different file name and extension:
[Updated on: Mon, 13 February 2012 04:00] Report message to a moderator
|
|
|
|
|
|
|
Re: Wrap PL/SQL Block [message #543181 is a reply to message #543178] |
Mon, 13 February 2012 05:28   |
cookiemonster
Messages: 13972 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If you use wrap on the command line then the function code must be in a file.
If you use dbms_wrap you can pass it the code directly.
However there is no way of telling oracle to wrap a function in the DB.
|
|
|
|
Re: Wrap PL/SQL Block [message #543306 is a reply to message #543182] |
Tue, 14 February 2012 01:37   |
nikhilk411
Messages: 33 Registered: September 2010 Location: Mumbai
|
Member |
|
|
You can also do the same using dynamic SQL and DBMS_DDL.WRAP function.
Clue: v_func = 'CREATE OR REPLACE FUNCTION abc .... ....';
DBMS_DDL.WRAP(ddl => v_func);
|
|
|
|
|