Home » Other » Marketplace » McUnwrap: unwrap your PL/SQL code (10gR1 to 21c)  () 1 Vote
McUnwrap: unwrap your PL/SQL code [message #651866] Thu, 26 May 2016 11:00 Go to next message
Michel Cadot
Messages: 68624
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 2018.11.27 on 27-NOV.-2018 10:22:05

Copyright (c) Michel Cadot, 2016-2018. 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/
I encourage you to subscribe to this topic (link at top of the page) if you want to
be informed when a new version is released.
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: 2021.12.03, download in Wrap wiki page.
MD5:   9a0e7cfc9e97eaad9982d491e3e6e4be
SHA-1: a63216f650d12a4723342a08b1c8acfecce606f6

[Updated on: Fri, 03 December 2021 03:15]

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: 68624
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: 68624
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 messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Support of 12.2.

Re: McUnwrap: unwrap your PL/SQL code [message #673612 is a reply to message #665714] Tue, 27 November 2018 03:28 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

McUnwrap now supports Oracle version 18c.

Re: McUnwrap: unwrap your PL/SQL code [message #680220 is a reply to message #673612] Wed, 29 April 2020 03:30 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

McUnwrap now supports Oracle version 19c.

Re: McUnwrap: unwrap your PL/SQL code [message #685275 is a reply to message #680220] Fri, 03 December 2021 03:16 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

McUnwrap now supports Oracle version 21c.

Previous Topic: Oracle SCM Functional Training
Next Topic: McPwfile: check your Oracle password files
Goto Forum:
  


Current Time: Thu Mar 28 10:55:55 CDT 2024