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
select text from all_source where name = 'PADCAMPAIGN' and type = 'PACKAGE BODY' order by line; Oracle doesn't store the source for a sub-program separately, so you need to look through the package source for it. If you're selecting from ALL_SOURCE you should include the OWNER in the WHERE clause.
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.
Use the ALTER PACKAGE statement to explicitly recompile a package specification, body, or both. Explicit recompilation eliminates the need for implicit run-time recompilation and prevents associated run-time compilation errors and performance overhead.
You can find the package body in all_source view. SELECT * FROM all_source WHERE TYPE = 'PACKAGE BODY' AND name = '<your package name>' ORDER BY line; I think you are probably trying to search using function name and not able to find it.
If you use SQL*Plus for compiling and creating a package body, you type forward slash (/) as follows: If you manage package body using files, you can compile the package body using the following command: In SQL Developer, you click the Run Script button to create a package body from a file.
A PL/SQL package consists of two parts: package specification and package body. If the package specification has cursors or subprograms, then the package body is mandatory. Otherwise, it is optional.
There is a TYPE column in all_source view. The type can have 2 values - 'PACKAGE' and 'PACKAGE BODY'. So to get the spec, Additionally, instead of using all_source, you can use user_source. all_source includes everything including system packages.
The type can have 2 values - 'PACKAGE' and 'PACKAGE BODY'. So to get the spec, 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. Show activity on this post. But chances are you don't have the right to see the 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;
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With