Home » SQL & PL/SQL » SQL & PL/SQL » Wrap Tool - Subquery Issue
Wrap Tool - Subquery Issue [message #385836] Wed, 11 February 2009 05:46 Go to next message
mia.max
Messages: 2
Registered: February 2009
Junior Member
Hi,
I saw there is another thread running about the wrap util, but I thought this might be different problem.

After I got problems with wrapping a package I analyzed it and found that there must exist a problem with wrapping a SQL query that contains sub-queries.

Wrapping works with:
CREATE OR REPLACE PACKAGE BODY s100270.phil_wraptest
IS

PROCEDURE sayhello
IS
CURSOR cHelloWorld IS
SELECT 'Hello World' hello
FROM DUAL;
BEGIN

FOR rHelloWorld IN cHelloWorld LOOP
dbms_output.put_line(rHelloWorld.hello);
END LOOP;

END sayhello;

END;

-----------------------------------------------------------------

Wrapping does NOT work with:
CREATE OR REPLACE PACKAGE BODY s100270.phil_wraptest
IS

PROCEDURE sayhello
IS
CURSOR cHelloWorld IS
SELECT 'Hello' hello,
(SELECT 'World' FROM DUAL) world
FROM DUAL;
BEGIN

FOR rHelloWorld IN cHelloWorld LOOP
dbms_output.put_line(rHelloWorld.hello);
dbms_output.put_line(rHelloWorld.world);
END LOOP;

END sayhello;

END;

Error:
> wrap iname=sayHello.pkb

PL/SQL Wrapper: Release 9.2.0.8.0- 64bit Production on Wed Feb 11 12:42:17 2009

Copyright (c) Oracle Corporation 1993, 2001. All Rights Reserved.

Processing sayHello.pkb to sayHello.plb
PSU(103,1,8,16):Encountered the symbol "SELECT" when expecting one of the following:

( - + case mod new not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall merge time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe

PSU(103,1,8,42):Encountered the symbol "WORLD" when expecting one of the following:

; return returning and or

PL/SQL Wrapper error: Compilation error(s) for:
CREATE OR REPLACE PACKAGE BODY s100270.phil_wraptest
Outputting source and continuing.

-----------------------------------------------------------------

I'm sure that I'm not the first one who got this problem...

If anyone has an idea how to solve this I really would appreciate !
Re: Wrap Tool - Subquery Issue [message #385838 is a reply to message #385836] Wed, 11 February 2009 05:57 Go to previous messageGo to next message
Michel Cadot
Messages: 64117
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I saw there is another thread running about the wrap uti

I think you then saw that we request to format the post.

Thanks for the test case, next time remember to post a FULL one and to NOT post schema name (nor storage parameters), we have not your schema.
> wrap iname=t.sql

PL/SQL Wrapper: Release 9.2.0.6.0- 64bit Production on Wed Feb 11 12:53:45 2009

Copyright (c) Oracle Corporation 1993, 2001.  All Rights Reserved.

Processing t.sql to t.plb
PSU(103,1,8,2):Encountered the symbol "SELECT" when expecting one of the following:

   ( - + case mod new not null others <an identifier>
   <a double-quoted delimited-identifier> <a bind variable> avg
   count current exists max min prior sql stddev sum variance
   execute forall merge time timestamp interval date
   <a string literal with character set specification>
   <a number> <a single-quoted SQL string> pipe

PSU(103,1,8,28):Encountered the symbol "WORLD" when expecting one of the following:

   ; return returning and or

PL/SQL Wrapper error: Compilation error(s) for:
CREATE OR REPLACE PACKAGE BODY phil_wraptest
Outputting source and continuing.

It is not supported in 9i, I recommend you to upgrade to 10g.
If you are really blocked, you can use an hidden parameter for developement or AFTER ASKING ORACLE SUPPORT (open a SR) to know if it is safe in your case.
> wrap iname=t.sql edebug=wrap_new_sql

PL/SQL Wrapper: Release 9.2.0.6.0- 64bit Production on Wed Feb 11 12:54:24 2009

Copyright (c) Oracle Corporation 1993, 2001.  All Rights Reserved.

Processing t.sql to t.plb

Regards
Michel
Re: Wrap Tool - Subquery Issue [message #385854 is a reply to message #385836] Wed, 11 February 2009 08:02 Go to previous message
mia.max
Messages: 2
Registered: February 2009
Junior Member
Thanks for the very fast answer! You're great !

Because its not possible to update Oracle in the next months I'll have to find another solution for this.

It's sad that this version of wrap is almost unusable in Oracle9i but I have to live with that.
Previous Topic: How to Write a Timer Trigger (merged)
Next Topic: Job schedule (merged)
Goto Forum:
  


Current Time: Tue Dec 06 04:27:44 CST 2016

Total time taken to generate the page: 0.17447 seconds