Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to wrap PL/SQL source code in Oracle?

Tags:

sql

oracle

plsql

How can I use user defined wrap function or unwrapped method in Oracle? Because default wrapping code is can be unwrapped.

like image 367
Ramin Darvishov Avatar asked Feb 27 '17 08:02

Ramin Darvishov


People also ask

How do I wrap a Plsql code?

You can wrap PL/SQL source code with either the wrap utility or DBMS_DDL subprograms. The wrap utility wraps a single source file, such as a SQL*Plus script. The DBMS_DDL subprograms wrap a single dynamically generated PL/SQL unit, such as a single CREATE PROCEDURE statement.

How do I wrap a SQL query in SQL Developer?

Configure > Preferences > User Interface - Editor > Tabs & Wrapping - Wrap lines.

What is Oracle wrap?

The wrap utility is a command line utility that obfuscates the contents of a PL/SQL source file. The syntax for the wrap utility is shown below. wrap iname=input_file [oname=output_file] The iname parameter specifies the source file, while the oname parameter specifies the destination file.


2 Answers

Use the wrapped procedure the same way that you use an unwrapped procedure. Call it from SQL or PL/SQL. Wrapping has no effect on calling the run-time behaviour of the stored procedure. The procedure is still in ALL_OBJECTS and its parameters are still in ALL_ARGUMENTS.

like image 72
Steven Ensslen Avatar answered Oct 04 '22 05:10

Steven Ensslen


Oracle's documentation says:

Wrapping a PL/SQL unit prevents most users from examining the source code, but might not stop all of them.

If you read Pete Finnigan's analyis of the wrapping mechanism, the wrapped code is just an encoding of the DIANA or Interface Description Languange (IDL) version of your source code. I don't see any way how you can change the wrapping mechanism and still be valid IDL.

After unwrapping, I normally give up if the PL/SQL package calls C functions. So you might try writing C libraries. They seem to be much harder to re-engineer...

like image 32
wolφi Avatar answered Oct 04 '22 03:10

wolφi