Re: selecting from all_objects

From: alexjunq <alexjunqNOalSPAM_at_softwaredesign.com.br.invalid>
Date: Wed, 08 Mar 2000 18:18:26 -0800
Message-ID: <1d624e60.da60cd07_at_usw-ex0103-024.remarq.com>


nope... it works...
try this code:



create or replace package pck1 is
  procedure p1;
  function f1 return number;
end pck1;
/

show errors package pck1;

create or replace package body pck1 is
  procedure p1 is
  begin
    null;
  end p1;
  --
  function f1 return number is
  begin
    return 0;
  end f1;
  --
end pck1;
/

show errors package body pck1;

create or replace procedure getsource (
  pName in varchar2,
  pOwner in varchar2 default user,
  pType in varchar2 default 'PACKAGE BODY' ) is
begin
  for c in (select line,

                   text
            from   all_source
            where  owner = upper(pOwner) and
                   name = upper(pName) and
                   type = upper(pType)
            order by line) loop
    dbms_output.put_line (lpad(to_char(c.line),4, '0')||': '||
                          rtrim(replace(c.text,chr(10),'')));
  end loop; -- source text
end getsource;
/

show errors procedure getsource;

set linesize 80
set serverout on size 1000000
exec getsource ('pck1');


But you should be aware about wrapped code. If its your case, you could see the package specification in clear text, but the implementation (package body) will be crypted and it'll looks like unreadable.

regards

Alexandre Junqueira

  • Sent from RemarQ http://www.remarq.com The Internet's Discussion Network * The fastest and easiest way to search and participate in Usenet - Free!
Received on Thu Mar 09 2000 - 03:18:26 CET

Original text of this message