Page 1 of 1

Error compiling some wrapped packages

Posted: Wed 07 Nov 2012 19:55
by jdorlon
Hello,

When I wrap a package with Oracle's WRAP utility, the wrapped code usually has one blank line at the end (before the slash). Sometimes it has two.

When it has two blank lines, and I compile the wrapped code with a TOraQuery, I always get an 'PLS-00753: malformed or currupted wrapped unit' error. If there is only one blank line at the end of the wrapped code, there is no problem. Also, if I use SQL*Plus to compile the wrapped code with two blank lines at the end, it compiles without errors.

I think ODAC is trimming out one or both of the blank lines before sending the code to Oracle.

Here is a procedure source code that wraps with two blank lines at the end.

Code: Select all

CREATE OR REPLACE PROCEDURE do_nothing is
  TYPE CURSOR_TYPE IS REF CURSOR;
  a_username  VARCHAR2(30); 
  p_cursor    CURSOR_TYPE;
BEGIN
  a_username   := 'z';
  null;
  null;
  null;  null;
  null;  null;  null;  null;
  null;
  null;
END do_nothing;
/
here is the wrapped code (My Oracle client version is 11.2.0.1).

Code: Select all

CREATE OR REPLACE PROCEDURE do_nothing wrapped 
a000000
b2
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
7
eb db
VvIVu2tyJMltn30t1dd1XSmCTUcwg3lZmMsVfC8Lueow1X7n32ZAUHZ5GsD00bLTXm8UcN4f
G7xBpS/maZYzkCyHcekbnu5XGj9TQZZzvd+OZ7+lRsXyuPFBgznneZqWjbZ7lWcVI4Ddhww9
EZNZnE5Y5t8QI0T3CA1RGLI9p6qDVDvMGZfGFsZhc4YIx2jkfC03UvRMsVTiPV3LeWh7tQ==


/
To get a package that wraps with only one blank line, remove the first line from the procedure source ( a_username := 'z';)

Can you reproduce this and can it be fixed? If there is some code somewhere that is causing the blank lines to be trimmed, please let me know.

Thank you.

John Dorlon

Re: Error compiling some wrapped packages

Posted: Thu 08 Nov 2012 10:55
by AlexP
Hello,

We have checked your problem on the latest ODAC version 8.5.10 - the provided error didn't occur when executing the obfuscated code in TOraQuery. Please try downloading the latest ODAC version and run the query one more time.

Re: Error compiling some wrapped packages

Posted: Thu 08 Nov 2012 17:53
by jdorlon
I wasn't able to make it work in .10 at first, but I had been trimming off the '/' at the end. I tried leaving the '/' in there and it worked! I guess I thought we had to remove those as we do for non-wrapped packages.

It works fine in older versions too when I leave the slash in.

Thanks.

Re: Error compiling some wrapped packages

Posted: Tue 13 Nov 2012 11:11
by AlexP
Hello,

For correct execution in OraQuery, the PL/SQL block must end with ';' , '/', or both symbols. Since there is no ';' symbol in the obfuscated procedure, you should add/leave '/' or ';' symbols. In the original code for creating procedure, there is a ';' symbol after the END operator, therefore the '/' symbol is not necessary.

Re: Error compiling some wrapped packages

Posted: Tue 13 Nov 2012 19:09
by jdorlon

Code: Select all

Hello,
For correct execution in OraQuery, the PL/SQL block must end with ';' , '/', or both symbols. Since there is no ';' symbol in the obfuscated procedure, you should add/leave '/' or ';' symbols. In the original code for creating procedure, there is a ';' symbol after the END operator, therefore the '/' symbol is not necessary.
I don't think that is completely true. If a wrapped package has only one blank line at the end, as most of them do, they will compile just fine in a TOraQuery with or without the trailing slash or semicolon. I only need to include the slash when there are two blank lines before it.

Re: Error compiling some wrapped packages

Posted: Fri 16 Nov 2012 11:06
by AlexP
Hello,

As I wrote you earlier, when executing your obfuscated code on the latest ODAC version, the problem occurs only when there is no "/" or ";" symbol, and the number of spaces before the "/" symbol doesn't matter - the procedure is created successfully.

Re: Error compiling some wrapped packages

Posted: Fri 16 Nov 2012 13:59
by jdorlon
Hi Alex,

Clearly we have observed different things. Thank you for your help.

-John