SqlPlus 查询问题(包规格和正文)
我试图通过这样做从 sqlplus 获取包规范和主体..
select text from all_source
where name = 'PACK_JACK'
order by line;
但我只获取其主体而不是规范..我必须更改什么才能将它们作为一个文件获取..谢谢
I am trying to get package spec and body from sqlplus by doing so..
select text from all_source
where name = 'PACK_JACK'
order by line;
but I am only getting its body not the spec.. what I have to change to get both of them as one file.. Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
all_source 视图中有一个 TYPE 列。该类型可以有 2 个值 - 'PACKAGE' 和 'PACKAGE BODY'。因此,要获取规范
并获取主体
,您可以使用 user_source,而不是使用 all_source。 all_source 包含所有内容,包括系统包。 USER_SOURCE 仅具有用户定义的包。
There is a TYPE column in all_source view. The type can have 2 values - 'PACKAGE' and 'PACKAGE BODY'. So to get the spec,
and to get the body
Additionally, instead of using all_source, you can use user_source. all_source includes everything including system packages. USER_SOURCE only has user defined packages.
要获取包主体,您可以运行:
与:
但很可能您无权查看包主体。因此它在 ALL_SOURCE 表中是隐藏的。
To get the package body, you run:
As opposed to:
But chances are you don't have the right to see the package body. So it's hidden from the ALL_SOURCE table.