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 -> problem executing plb files

problem executing plb files

From: roger <rsr_at_rogerware.com>
Date: Tue, 27 Jan 2004 21:52:29 GMT
Message-ID: <Xns947D8DAFD71C0rsrrogerwarecom@204.127.199.17>


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. Received on Tue Jan 27 2004 - 15:52:29 CST

Original text of this message

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