Oracle database dependencies in PL/SQL

怎甘沉沦 提交于 2021-02-07 04:00:56

问题


I need to find dependencies between functions/procedures(defined inside package bodies) and tables which they use.

I've tried all_dependencies but it works only on the package-level, not the inner function/procedure-level. Is there any possibilty to find this dependencies using e.g. all_source?

Thanks in advance for your help.


回答1:


It is not possible to find the dependencies between procedures (in a package) and tables.

There are several tools to examine dependencies. As you've already discovered, *_DEPENDENCIES only tracks object dependencies on a per-package level. There is a neat tool PL/Scope that tracks dependencies between parts of a package. But it does it does not track all table references.

Theoretically you could use *_SOURCE. In practice, this is impossible unless your code uses a limited set of features. For any moderately complicated code, forget about using string functions or regular expressions to parse code. Unfortunately there does not seem to be any PL/SQL parser that is both programmable and capable of accurately parsing complex code.

Saying "it's not possible" isn't a great answer. But in this case it might save you a lot of time. This is one of those tasks where it's very easy to hit a dead end and waste a lot of effort.



来源:https://stackoverflow.com/questions/28044294/oracle-database-dependencies-in-pl-sql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!