SqlPlus 查询问题(包规格和正文)

发布于 2024-11-28 15:42:38 字数 177 浏览 0 评论 0原文

我试图通过这样做从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

未蓝澄海的烟 2024-12-05 15:42:38

all_source 视图中有一个 TYPE 列。该类型可以有 2 个值 - 'PACKAGE' 和 'PACKAGE BODY'。因此,要获取规范

select text from all_source
where name = 'PACK_JACK'
and type = 'PACKAGE'
order by line;

并获取主体

select text from all_source
where name = 'PACK_JACK'
and type = 'PACKAGE BODY'
order by line;

,您可以使用 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,

select text from all_source
where name = 'PACK_JACK'
and type = 'PACKAGE'
order by line;

and to get the body

select text from all_source
where name = 'PACK_JACK'
and type = 'PACKAGE BODY'
order by line;

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.

在风中等你 2024-12-05 15:42:38

要获取包主体,您可以运行:

select text from all_source
where name = 'PACK_JACK'
  and type = 'PACKAGE BODY'
order by line;

与:

select text from all_source
where name = 'PACK_JACK'
  and type = 'PACKAGE'
order by line;

但很可能您无权查看包主体。因此它在 ALL_SOURCE 表中是隐藏的。

To get the package body, you run:

select text from all_source
where name = 'PACK_JACK'
  and type = 'PACKAGE BODY'
order by line;

As opposed to:

select text from all_source
where name = 'PACK_JACK'
  and type = 'PACKAGE'
order by line;

But chances are you don't have the right to see the package body. So it's hidden from the ALL_SOURCE table.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文