Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PL/SQL: Retrieve names of procedures and functions within a package

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.

like image 657
Adam Paynter Avatar asked Dec 23 '22 10:12

Adam Paynter


1 Answers

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).

like image 70
Justin Cave Avatar answered Feb 16 '23 02:02

Justin Cave