Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • All source code is stored, line by line, in a system table called all_source. Try

    select distinct owner from all_source where type='PACKAGE BODY' and name='PACKAGE_NAME'
    (where you replace PACKAGE_NAME by the real name of your package) and you'll probably be closer to home. If you're allowed to touch that source.

    Well, you probably can work something out from there.
    • But the problem I was trying to resolve involved an identical package in two different schemas, which in that solution would result in duplicate results from ALL_SOURCE, and leave me with the same conundrum.

      FWIW, there's a record in ALL_SOURCE for every line of code. A quicker query to get the same result would be FROM all_objects WHERE object_type = 'PACKAGE'

      --
      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
      • I knew you'd find a solution once you were pointed in the right direction! :)

        One uses what one has used before, and I had used ALL_SOURCE (and USER_SOURCE) but not the many other stuff in a similar vein. In the meantime, I've played a little with other options, and I found that

        • If you decide to use ALL_SOURCE, it's better to select on type='PACKAGE' instead of type='PACKAGE BODY', because the latter only shows items you have write access to (usually just your own packages), while the former shows you all items you can use. And, of course, the number of records/lines is much less in the PACKAGE and in the PACKAGE BODY.
        • ALL_OBJECTS is indeed a nice directory list of everything you have access to