CREATE OR REPLACE PACKAGE plch_ovld_pkg IS PROCEDURE my_program (d_in IN DATE, n_in IN NUMBER); [OTHER_SUBPROGRAMS] END plch_ovld_pkg; /and asked:
Which of the choices can I put in place of [OTHER_SUBPROGRAMS] that will allow me to compile the package specification without any errors?
Several players raised the same objection:
In other words, they felt that the following choice should have been marked as incorrect:
PROCEDURE my_program (date_in IN DATE, n_in IN NUMBER);Sadly, this is one of those cases in which the Oracle documentation is incorrect.
It is certainly possible to compile a package specification without errors even if two subprograms differ only by the names of one or more of their formal parameters. The verification code shows this.
When, however, you overload in this manner (differences only in formal parameter names), you will either (a) have to use named notation to distinguish between the overloadings or (b) you may not be able to actually call the overloaded subprogram.
In the case of the plch_ovld_pkg code, it turns out that there is no way to call successfully the original subprogram:
PROCEDURE my_program (d_in IN DATE, n_in IN NUMBER);I can call the overloading that uses the date_in argument, but when I try to call the my_program procedure above, every form that I use raises the "PLS-00307: too many declarations of 'MY_PROGRAM' match this call" error - even when I use named notation.
The reason is that if I use named notation to distinguish this from the "date_in" version, as in:
BEGIN plch_ovld_pkg.my_program (d_in => SYSDATE, n_in => 1); plch_ovld_pkg.my_program (date_in => SYSDATE, n_in => 1); END; /the PL/SQL compiler cannot distinguish the first invocation from this other overloading:
PROCEDURE my_program (n_in IN NUMBER, d_in IN DATE);and the block fails to execute.
I will add more of this explanation to the answer for this quiz. But there is no doubt about it: Oracle will let you compile the package specification without error. You just won't be able to call all of the subprograms you defined.