提取有关包、过程和函数的元数据的本机方法?
我希望能够向 Oracle 查询属于某个包的公共过程和函数的列表,大致如下:
select procedure_name from all_package_procedures where package_name = :my_package_name;
我也希望成为能够查询 Oracle 以获取给定过程或函数的参数列表,类似于:
selectparameter_name, in_or_out,parameter_type from all_function_parameters where function_name = :my_function_name;
这本身可能吗?如果没有,有人知道现有代码可以实现这一目标吗?
I wish to be able to query Oracle for a list of public procedures and functions that belong to a package, something along the lines of:
select procedure_name from all_package_procedures where package_name = :my_package_name;
I also wish to be able to query Oracle for a list of parameters for a given procedure or function, something along the lines of:
select parameter_name, in_or_out, parameter_type from all_function_parameters where function_name = :my_function_name;
Is this possible natively? If not, does anyone know of existing code to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以查询
USER_OBJECTS
&USER_PROCEDURES
获取所有过程的列表属于特定包的函数替换
user_objects
&user_procedures
与all_objects
&all_procedures
分别用于获取包和其他用户拥有的程序。为此,您可以查询
user_arguments
或all_arguments
来获取对象的参数由当前用户拥有分别为所有用户You can query
USER_OBJECTS
&USER_PROCEDURES
to get a list of all procedures & functions belonging to a particular packageReplace
user_objects
&user_procedures
withall_objects
&all_procedures
respectively to fetch packages & procedures owned by other users.For this, you can query
user_arguments
orall_arguments
to fetch parameters of on object owned by the current user & all users respectively我自己的回答,源自萨迪亚斯,供其他人参考。下面是一个查询,用于提取给定包的所有过程及其参数的非规范化结果:
My own answer, derived from Sathyas, for the reference of others. Here is a single query to pull out a denormalized result of all procedures and their arguments for a given package: