Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: problem executing plb files

Re: problem executing plb files

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Tue, 27 Jan 2004 14:48:54 -0800
Message-ID: <1075243673.182401@yasure>


roger wrote:
> OK, so I'm using the wrap utility to encrypt a .sql
> file that contains a pl/sql package definition and body.
>
> The problem is that when I attempt to execute the resulting
> plb, I get some SQL errors that were not present in the
> original sql source version.
>
> The problem seems to be related to the use of package
> defined types, but I don't see what it is.
>
> Here is a simple file that illustrates the problem:
>
> bash$ cat tst.sql
>
> create or replace package wraptst
> authid current_user
> as
> type idrec is record (id int);
> type idtab is table of idrec;
>
> function func1 return idtab pipelined;
> function func2 return idtab pipelined;
> function func3 return idtab pipelined;
>
> end wraptst;
> /
> show errors;
>
> create or replace package body wraptst
> as
>
> function func1
> return idtab pipelined
> is
> irec idrec;
> begin
> for c in (select 123 id from dual)
> loop
> irec := c;
> pipe row(irec);
> end loop;
> return;
> end;
>
>
> function func2
> return idtab pipelined
> is
> irec idrec;
> begin
> irec.id := 123;
> pipe row(irec);
> return;
> end;
>
> function func3
> return idtab pipelined
> is
> irec idrec;
> begin
> for c in (select 123 id from dual)
> loop
> null;
> end loop;
> return;
> end;
>
> end wraptst;
> /
> show errors;
>
>
>
> bash$ sqlplus / @tst.sql
> .. No errors ...
>
> bash$ wrap iname=tst.sql oname=tst.plb
>
> bash$ sqlplus / @tst.plb
> Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
> With the Partitioning, OLAP and Oracle Data Mining options
> JServer Release 9.2.0.3.0 - Production
>
>
> Package created.
>
> No errors.
>
> Warning: Package Body created with compilation errors.
>
> Errors for PACKAGE BODY WRAPTST:
>
> LINE/COL ERROR
> --------
> -----------------------------------------------------------------
> 9/5 PLS-00707: unsupported construct or internal error [2603]
> 11/8 PL/SQL: Statement ignored
> 11/16 PLS-00382: expression is of wrong type
> 12/8 PL/SQL: Statement ignored
> SQL>
>
>
>
>
> Now, the part I don't get is that it is only func1 that is
> broken. If I remove it, and leave func2 and func3, then it
> loads fine. So it's like some combination of a cursor loop,
> and assigning to the idrec variable, or something.
>
>
> Anybody else seen this kind of thing?
>
> Thanks.

Nothing jumps out at me except the following vague comments ... I presume this is not your real package but a test package and not necessarily related to your problem.

Looks like a bug in WRAP from here. Using 9.2.0.4 on W2K SP4 and RedHat EL AS I reproduced it with several pipelined table functions.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Tue Jan 27 2004 - 16:48:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US