when you define a package in oracle there is a like a header and then a body.
One must define all parameters in both locations. I want to make one of the parameters optional for the calling program (IBM message broker). Do I have to add the default value in both the header and body definition?
Addionally, can anyone confirm that messagebroker will be able to call the proc with out specifying any value for the parameter with a default?
Thanks!
Update: I notice that I can add the default into the header and not the body, or I can add it into both. I cannot add it into just the body.
What is the differance between adding it to both vs just the header?
Update:
I can do this where I only specify the default in the spec and not the body. Or i can also specify the default in both places. What is the differance?
create or replace
package myPackage is
PROCEDURE myProc (
parm1 IN varchar2,
parm1 IN date,
parm1 IN number default null
);
end myPackage;
create or replace
package body myPackage is
PROCEDURE myProc (
parm1 IN varchar2,
parm1 IN date,
parm1 IN number
) is
...
...
...
end myProc;
end myPackage;