Home » SQL & PL/SQL » SQL & PL/SQL » Wrap PL/SQL Block (oracle 10g)
Wrap PL/SQL Block [message #543149] Mon, 13 February 2012 03:55 Go to next message
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 Go to previous messageGo to next message
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 #543151 is a reply to message #543150] Mon, 13 February 2012 04:06 Go to previous messageGo to next message
Michel Cadot
Messages: 68770
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
In 10g, you can use DMS_DDL.WRAP to create your function...

Regards
Michel
Re: Wrap PL/SQL Block [message #543155 is a reply to message #543150] Mon, 13 February 2012 04:13 Go to previous messageGo to next message
parthiv_t
Messages: 15
Registered: July 2011
Location: ahmedabad
Junior Member
Thanks you ramoradba

I know If we have a fielename.sql file is available then it will be defiantly warped.


But.. suppose

I had created a database function named
"TEST_fnct" in my test databse.

now i am try to wrap this function using my Operating system
console.

but it reply:PL/SQL Wrapper error: Couldn't open input file TEST_fnct.sql

Re: Wrap PL/SQL Block [message #543160 is a reply to message #543155] Mon, 13 February 2012 04:19 Go to previous messageGo to next message
Michel Cadot
Messages: 68770
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
So there is no TEST_fnct.sql file or you have no access right to it.

Regards
Michel
Re: Wrap PL/SQL Block [message #543178 is a reply to message #543160] Mon, 13 February 2012 05:21 Go to previous messageGo to next message
parthiv_t
Messages: 15
Registered: July 2011
Location: ahmedabad
Junior Member
I am using toad 9.0.1 instead of sqlplus

I had created a function as a stored function named "TEST_fnct".

now I want to wrap function "TEST_fnct"

and if the wrap process successfully finished,SO i will get "TEST_fnct.plb"

After that I want to delete original source of "TEST_fnct".

Re: Wrap PL/SQL Block [message #543181 is a reply to message #543178] Mon, 13 February 2012 05:28 Go to previous messageGo to next message
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.
icon7.gif  Re: Wrap PL/SQL Block [message #543182 is a reply to message #543181] Mon, 13 February 2012 05:33 Go to previous messageGo to next message
parthiv_t
Messages: 15
Registered: July 2011
Location: ahmedabad
Junior Member
Thanks a lot...... Smile
Re: Wrap PL/SQL Block [message #543306 is a reply to message #543182] Tue, 14 February 2012 01:37 Go to previous messageGo to next message
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);
Re: Wrap PL/SQL Block [message #543309 is a reply to message #543306] Tue, 14 February 2012 01:41 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
How does it different from Michel`s post ?
Re: Wrap PL/SQL Block [message #543310 is a reply to message #543309] Tue, 14 February 2012 01:43 Go to previous message
nikhilk411
Messages: 33
Registered: September 2010
Location: Mumbai
Member
Sorry missed that - my mistake Sad
Previous Topic: Date Issue
Next Topic: HAVING query
Goto Forum:
  


Current Time: Sat Sep 06 16:40:33 CDT 2025