The all_source view has a TYPE column. A type can have 2 values - "PACK" and "PACK BODY". So, to get the specification,
select text from all_source
where name = 'PACK_JACK'
and type = 'PACKAGE'
order by line;
and get the body
select text from all_source
where name = 'PACK_JACK'
and type = 'PACKAGE BODY'
order by line;
Alternatively, instead of using all_source, you can use user_source. all_source includes everything, including system packages. USER_SOURCE has only user-defined packages.
source
share