Is there any way to call a SERIALLY_REUSABLE package dynamically from PL/SQL? Access to some 3rd party software we have, is controlled by Pl/SQL packages that need to be determined and executed dynamically at runtime:
g_package_name := 'xyz_access_package';
EXECUTE IMMEDIATE g_package_name;
If I do this from PHP it works fine, but if I try to do it from a pl/sql package I get:
Error:
ORA-06534 cannot access Serially Reusable package %s in the context of a trigger ---------------------------------------------------------------------------
Cause:
The program attempted to access a Serially Reusable package in the context of a trigger. Such an access is currently unsupported.
Action:
Check the program logic and remove any references to Serially Reusable packages (procedure, function or variable references) which might happen in the context of a trigger.
Without SERIALLY_REUSABLE we get frequent ORA-04068 errors calling the packages dynamically from PL/SQL (even when objects aren't being changed), which can not be easily resolved--the object still shows as valid, recompiling them doesn't resolve the issue. We have to manually kill all the sessions.
There should be some way to call packages dynamically from PL/sql that doesn't cause ORA-04068 errors. Any thoughts?