views:

389

answers:

2

Is it possible to retrieve the names of all procedures and functions that reside within a particular package? I understand that they can be gleaned (smells hack-ish) from the ALL_SOURCE view, but I would prefer a more canonical strategy.

+6  A: 

DBA_PROCEDURES has the public methods within a package

SELECT owner, 
       object_name AS package_name, 
       procedure_name AS method_name
  FROM dba_procedures
 WHERE object_type = 'PACKAGE'

If you also want private methods, that information is not directly accessible in the data dictionary. In that case, you'd need to parse the source (which would obviously be rather painful, particularly if you happen to have nested private methods within public or private methods in the package).

Justin Cave
+1, you would also get this information in the USER_PROCEDURES and ALL_PROCEDURES public views
Vincent Malgrat
+1  A: 

the following will return all procedure and function names from a specific package:

SELECT procedure_name FROM user_procedures WHERE object_name='mypackagename';
akf