Solved

How to DESC one procedure from a package

Posted on 2008-06-13
5
1,187 Views
Last Modified: 2013-12-19
We have a situation where we are connecting data silos with common APIs via packages.  In one situation, the packages we want to introduce can be automatically generated based on the footprint of those packages in another silo.  However, that silo includes a lot of cruft in one of the core packages.  Until we can refactor and partition the package, I'd like to create a simple Perl script (or something similar) that takes a list of procedures in the package, does something like a DESC to get the footprint, and generates the package code.  Is there a PL/SQL query using dictionary tables (or something akin) that will allow me to DESC the footprint of a single procedure from within a package?  

Thanks!
0
Comment
Question by:arktech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 21778816

Why not just invoke sqlplus and do a DESC?

0
 

Author Comment

by:arktech
ID: 21778867
Sorry, in re-reading the question as I posed it, I realized I didn't make something clear.  The package that I want to use as the basis for the footprints contains over 200 procedures, of which I only need about 30.  Rather than mirror the entire thing -- we're trying to retire many of those extra footprints -- I would like to selectively mirror the 30 I want.  Ergo, the desire to DESC just an individual procedure from the package.  Yes, I could DESC the entire package, parse it into memory in Perl, and then iterate across the list of methods that I actually want, but I was hoping there was a simpler, more elegant approach.
0
 
LVL 35

Accepted Solution

by:
Mark Geerlings earned 250 total points
ID: 21779179
I'm not aware of a built-in way to do a DESC on an individual procedure or function in a package.  Maybe DBMS_METADATA provides this, but I haven't ever explored that package very much.  Some years ago (probably with Oracle8) I used these two queries as alternatives to DESC.  They still work with Oracle9 and Oracle10. You may be able to use one of these as a starting point for what you need.

SELECT DISTINCT sa.procedure$ "Package objects", d.object_type
FROM sys.argument$ sa, dba_objects d
WHERE sa.obj# = d.object_id
AND d.object_name = upper('pkg_name');

break on package_name;
column ovload noprint
select package_name, object_name, nvl(overload,0) "ovload",
decode(min(position),0,'Function','Procedure') "Type",
count(argument_name) "Parameters"
from all_arguments
where package_name like upper('&pkg_name')
group by package_name, object_name, overload;
0
 
LVL 35

Expert Comment

by:johnsone
ID: 21779605
Unfortunately, Oracle dropped the functionality to be able to describe a procedure in a package.

You can try looking at the ALL_ARGUMENTS view, it should give you the information.  NOTE:  There is no DBA_ counterpart to this view, it is only ALL_ and USER_
0
 

Author Comment

by:arktech
ID: 21779624
Bingo!  That was the nudge I needed!  The following gives me exactly what I was looking for:

select argument_name, in_out, data_type
from all_arguments
where package_name = UPPER('mypackage')
and object_name = UPPER('sproc_name')
order by position;

Thank you very much!
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question