Is it possible to write a PL/SQL query to identify a complete list of a stored procedures dependencies? I'm only interested in identifying other stored procedures and I'd prefer not to limit the depth of nesting that it gets too either. For example, if A calls B, which calls C, which calls D, I'd want B, C and D reported as dependencies for A.
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- What is the best way to cache a table from a (SQL)
- php PDO::FETCH_ASSOC doesnt detect select after ba
On this page, you will find the following query which uses the PUBLIC_DEPENDENCY dictionary table:
To get all details:
Something else worth pointing out here, is that there are certain cases where the dependency may only be at runtime, which unfortunately will not show up in the metadata.
For example, if you are constructing a SQL statement at runtime, you may have code similar to:
I've been burnt by this a few times, but there's unfortunately no way to find these types of dependencies in advance since it potentially depends on user input.
I agree with EddieAwad.
Its valuable to point out that Oracle only tracks the dependencies down to the object level. If you have your stored procedures in a package you can only track the dependencies if the package, not the individual functions/procedures within the package.
If you're looking to track intra-package dependencies then you'll need a PLSQL parser.