Home » Other » Marketplace » McUnwrap: unwrap your PL/SQL code (10gR1 to 12cR2)  () 1 Vote
McUnwrap: unwrap your PL/SQL code [message #651866] Thu, 26 May 2016 11:00 Go to next message
Michel Cadot
Messages: 65254
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

You have no source version control system, you lost the source file, you wrapped the code in the database, McUnwrap is what you need.
McUnwrap is a Windows program which allows you to unwrap your 10g+ wrapped PL/SQL codes (function, procedure, package [body], type [body], library).

Its help is the following one:
C:\>.\McUnwrap -h

McUnwrap Utility by Michel Cadot: Version 2017.09.17 on 17-SEPT.-2017 10:21:31

Copyright (c) Michel Cadot, 2016-2017. All rights reserved.

Usage: McUnwrap.exe { -h | [{ -c | -r }] [-o <outfile>] [<infile>] }

with
  -c            Compress mode: removes all blanks lines and all spaces at the end
                of the lines
  -o <outfile>  Gives the name of the result file
  -r            Raw mode: returns the unwrapped text as it is without any cleaning
  <infile>      Gives the name of the file containing the wrappped code

If input file is not given, standard input is used.
If output file is not given, standard output is used.

By default (no "-c" or "-r" option), the program removes ending blank lines,
replaces consecutive blank lines by a single empty one; the reason is that before
wrapping the code Oracle replaces the comments by blank lines and the wrapping
process adds some junk characters at the end. In addition, the code is converted
in upper case but, of course, constant strings and quoted idenfitiers.

Note: the program skips all lines before the one containing the object type, its
      name and the keyword "wrapped". It ends its analysis at the first subsequent
      blank line.

The program is provided as it is without any guarantees or warranty. Although the
author has attempted to find and correct any bugs in this free program, the author
is not responsible for any damage or losses of any kind caused by the use or misuse
of the program. The author is under no obligation to provide support, service,
corrections, or upgrades to this program.

You can freely use, copy and distribute this program but you can't modify it without
the permission of the author you can contact on http://www.orafaq.com
You can post your comments, ask for improvements, report bugs... on the program at
http://www.orafaq.com/forum/t/201028/

The program ignores all lines of the file before the one ending by the keyword "wrappped". It stops to analyze the file at the first blank line. If you get the wrapped from a query on the database take care that some rows may start by an empty line. To avoid this problem you can use the following query:
set pagesize 0 feedback off linesize 120
select regexp_replace(text,'^'||chr(10),'') text 
from all_source 
where owner = '...' 
  and name = '...' 
  and type = '...' 
order by line;

Latest version: 2017.09.17, download in Wrap wiki page.
MD5:   e7b4965128c116bac6209f79de63705d
SHA-1: 888a8678e3c101c465d2fe06bbcc75b0a16d55ba

[Updated on: Mon, 23 October 2017 23:57]

Report message to a moderator

Re: McUnwrap: unwrap your PL/SQL code [message #652075 is a reply to message #651866] Wed, 01 June 2016 01:22 Go to previous messageGo to next message
Michel Cadot
Messages: 65254
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Support of 12c (12.1).

Note: without any compression option ("-c" or "-c2") the result is a raw unwrapping which may lead to duplicate blank lines and junk characters at the end.
"-c" removes all these later ones and squeezes multiple blank lines.
"-c2" removes in addition all blank lines and trims spaces at the end of the other lines.

[Updated on: Wed, 01 June 2016 06:22]

Report message to a moderator

Re: McUnwrap: unwrap your PL/SQL code [message #652503 is a reply to message #652075] Fri, 10 June 2016 11:01 Go to previous messageGo to next message
Michel Cadot
Messages: 65254
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

To get cleaner result code by default, I changed the default option and options meaning (see the new help in first post).
What was the compress mode is now the standard mode and the previous standard mode becomes the raw mode which will be mainly for debugging purpose.

Re: McUnwrap: unwrap your PL/SQL code [message #665714 is a reply to message #652503] Sun, 17 September 2017 03:36 Go to previous message
Michel Cadot
Messages: 65254
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Support of 12.2.

Previous Topic: McOptions: a program which allows to know which options are used in a database
Next Topic: McTnsping: a tnsping-like program for Windows
Goto Forum:
  


Current Time: Thu Dec 14 12:46:28 CST 2017

Total time taken to generate the page: 0.06352 seconds