|PL/SQL User's Guide and Reference
This appendix shows you how to run the PL/SQL Wrapper, a stand-alone utility that converts PL/SQL source code into portable object code. You can use the Wrapper to deliver PL/SQL applications without exposing your source code.
The PL/SQL Wrapper converts PL/SQL source code into an intermediate form of object code. By hiding application internals, the Wrapper prevents
Wrapped code is as portable as source code. The PL/SQL compiler recognizes and loads wrapped compilation units automatically. Other advantages include
To run the PL/SQL Wrapper, enter the
WRAP command at your system prompt using the following syntax:
You can use uppercase or lowercase. Leave no space around the equal signs because spaces delimit individual arguments.
WRAP command requires only one argument, which is
input_file is the path and name of the Wrapper input file. You need not specify the file extension because it defaults to
sql. For example, the following commands are equivalent:
However, you can specify a different file extension as the following example shows:
WRAP command takes a second argument, which is
output_file is the path and name of the Wrapper output file. You need not specify the output file because its name defaults to that of the input file and its extension defaults to
plb (PL/SQL binary). For example, the following commands are equivalent:
However, you can use the option
ONAME to specify a different file name and extension, as the following example shows:
The input file can contain any combination of SQL statements. However, the PL/SQL Wrapper wraps only the following
CREATE statements, which define PL/SQL packages and stand-alone subprograms:
CREATE [OR REPLACE]
CREATE [OR REPLACE] FUNCTION
CREATE [OR REPLACE] PROCEDURE
All other SQL statements are passed intact to the output file. Comment lines (beginning with
--) are deleted unless they appear in a package or subprogram definition.
A wrapped package or subprogram definition has the form
header begins with the reserved word
CREATE and ends with the name of the package or subprogram, and
body is an intermediate form of object code that looks like a random sequence of characters. The keyword
WRAPPED tells the PL/SQL compiler that the package or subprogram is wrapped.
The header can contain comments. For example, the Wrapper converts
Generally, the output file is much larger than the input file.
If your input file contains syntactic errors, the PL/SQL Wrapper detects and reports them. However, the Wrapper cannot detect semantic errors because it does not resolve external references. That is done at compile time. So, only the PL/SQL compiler can detect semantic errors.