SqlPlus查询问题(软件包规格和正文) [英] SqlPlus query issue (Package Spec and Body)
问题描述
我正在尝试从sqlplus中获取程序包规范和主体.
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
推荐答案
all_source视图中有一个TYPE列.该类型可以有2个值-'PACKAGE'和'PACKAGE BODY'.所以要获得规格,
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;
并获得身体
select text from all_source
where name = 'PACK_JACK'
and type = 'PACKAGE BODY'
order by line;
此外,您可以使用user_source来代替all_source. all_source包括所有内容,包括系统软件包. USER_SOURCE仅具有用户定义的程序包.
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.
这篇关于SqlPlus查询问题(软件包规格和正文)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!