Error compiling some wrapped packages

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Error compiling some wrapped packages

Post by jdorlon » Wed 07 Nov 2012 19:55

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error compiling some wrapped packages

Post by AlexP » Thu 08 Nov 2012 10:55

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.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: Error compiling some wrapped packages

Post by jdorlon » Thu 08 Nov 2012 17:53

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.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error compiling some wrapped packages

Post by AlexP » Tue 13 Nov 2012 11:11

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.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: Error compiling some wrapped packages

Post by jdorlon » Tue 13 Nov 2012 19:09

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.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error compiling some wrapped packages

Post by AlexP » Fri 16 Nov 2012 11:06

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.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: Error compiling some wrapped packages

Post by jdorlon » Fri 16 Nov 2012 13:59

Hi Alex,

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

-John

Post Reply