Say I have a package that exposes just one procedure publicly. The purpose of this procedure, however, is to call private procedures within the package, based on the argument that's passed to it.
Ideally, I would want to define a hash table (e.g., an associative array or even a table) that maps arguments to internal procedures, and then do something like:
execute immediate 'begin ' || internalProc(myArgument) || '; end;';
However, this won't work because the dynamic begin ... end PL/SQL block is executed outside the scope of the package. I can't even do 'begin myPkg.' || internalProc... because the internal procedures are all private.
As such, is the only way I can achieve this (without exposing private procedures) is by having a massive, hard-coded switch?
case myArgument
when 'something' then someProc;
when 'foo' then fooProc;
when 'bar' then barProc;
...
else raise_application_error('-20001, 'No such process.')
end case;
'something'->somethingProc,'foo'->fooProc, etc.) - Xophmeister