How to view content of packages procedures

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Post Reply
EdilsonAndrade
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 7
Joined: Wed, 29 Jun 2016 5:45 pm

Dear,

I started playing these days with Oracle, and I have a doubt for how much.

I know that this command

Select all

select * 
 from all_procedures 
 where owner = 'OWNER' AND 
  object_name = 'packagename' 
  AND PROCEDURE_NAME= 'procedure'
Monstrates the procedure of this package

But how do I see the code, body, her content?

Thanks.
spernega
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 238
Joined: Tue, 19 Jun 2007 2:12 pm
Location: São Paulo - SP

Good morning,

Use the ALL_SOURCE.

Select all

select text 
from all_source 
where owner = 'OWNER' 
AND name = 'PACKAGENAME';
EdilsonAndrade
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 7
Joined: Wed, 29 Jun 2016 5:45 pm

Show, thank you very much, they showed only the header or the name and parameters of entry and exit, but it is already good
spernega
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 238
Joined: Tue, 19 Jun 2007 2:12 pm
Location: São Paulo - SP

Show all structure, specification and body.
or two blocks.

ex.

Select all

package pck_gera_xlsx
and

Select all

package body pck_gera_xlsx
EdilsonAndrade
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 7
Joined: Wed, 29 Jun 2016 5:45 pm

beleza, so I can connect again that now I'm having another mistake I see calmly if I lost something, thank you
EdilsonAndrade
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 7
Joined: Wed, 29 Jun 2016 5:45 pm

Hi,

Then I made another here

Select all

   select text 
from all_source 
where name = 'OTN_REF_CURSOR';
He returns:

Select all

"package otn_ref_cursor as 
" 
"  -- used to illustrate passing a ref cursor 
" 
"  -- as a return value from a function 
" 
"  -- or as an output parameter from a procedure 
" 
" 
" 
"  function get_emp_info return sys_refcursor; 
" 
"  procedure get_emp_info(p_rc out sys_refcursor); 
" 
" 
" 
"  procedure get_multiple_cursors(p_rc1 out sys_refcursor, p_rc2 out sys_refcursor, p_rc3 out sys_refcursor); 
" 
end;
realize that it does not show the contents of the procedure get_multiple_cursors, which is the one that has the code that makes the select at the base, I know why I saw the structure I'm using it as an example for this post,

How do I show the tb content of this Package within this package?

Thanks
EdilsonAndrade
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 7
Joined: Wed, 29 Jun 2016 5:45 pm

Hello friend,


Thank you very much, it really shows all the content of PROC, is that I had to descend more pages from the result to see.

Thanks,
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests