Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get list of all the procedure inside a package oracle

Can I get the name of all the function inside a package. Suppose I have a package PKG_OWA and I want to list all the procedure inside the package.

like image 276
शेखर Avatar asked Dec 28 '11 09:12

शेखर


People also ask

How do I view the contents of a package in Oracle?

select text from all_source where name = 'PADCAMPAIGN' and type = 'PACKAGE BODY' order by line; Oracle doesn't store the source for a sub-program separately, so you need to look through the package source for it. Show activity on this post. Show activity on this post.

Where can we see procedure function package code?

You can use user_source or all_source data dictionary view to view the procedure or function code.


2 Answers

The data dictionary view ALL_PROCEDURES (or USER_PROCEDURES if you just want your packages). Find out more.

 select procedure_name  from all_procedures  where owner = 'YOU'  and object_name = 'YOUR_PACKAGE' 

This lists the public procedures exposed in the package specification. There is no easy way of retrieving the private procedures (that is, those specified only in the package body) except by processing the source text. Oracle do provide a utility PL/SCOPE which we can use to gather this information, but it requires us to change session settings and recompile our code, so it may not be suitable in all situations. Find out more.

like image 141
APC Avatar answered Oct 14 '22 01:10

APC


I use this one:

your package:

SELECT * FROM ALL_OBJECTS WHERE OBJECT_TYPE = 'PACKAGE'      and owner = 'owner_name'     and object_name = 'package_name' 

your procedures (only from specs, i.e. global):

select *  from all_procedures  where owner = 'owner_name'  and object_name = 'package_name' 

and in/out arguments from procedure:

select *  from ALL_ARGUMENTS  where owner = 'owner_name'     and package_name = 'package_name'     and object_name = 'procedure_name' 

enjoy!

like image 21
Andrey Khmelev Avatar answered Oct 14 '22 01:10

Andrey Khmelev