Is it possible to define package procedure/function outside of package body block (for Oracle)?
Simplified syntax for defining package body is:
create or replace package body <package_name> IS
function <function_name>
<function_body>
procedure <procedure_name>
<procedure_body>
end <package_name>;
/
Is it possible to define procedure within package like:
procedure <package_name>.<procedure_name>
<procedure_body>
I ask this question as I am newbie and don't understand why I need to compile whole package when I need only to apply changes form a single procedure…
RELATED
- What are the benefits of packages over standalone procedures and functions?
- https://stackoverflow.com/questions/1812049/performance-standalone-procedure-vs-packaged-procedure-in-oracle
Tom says:
- Always use a package.
- Never use a standalone procedure except for demos, tests and standalone utilities (that call nothing and are called by nothing)
Best Answer
You always need to compile the entire package body -- it is one item of code. You can create functions and procedures inside other procedures, but that does not change the need to recompile the package body.
What problem are you trying to solve here?