Calling the Security API Package
For every program that you run from outside Oracle LSH to call an Oracle LSH API, you must first call a special security API: CDR_PUB_API_INITIALIZATION. This API contains three functions:
- EnableApis
- DisableApis
- AreApisEnabled
When you initialize any API, the AreApisEnabled function of the security API, CDR_PUB_API_INITIALIZATION, is called to check the calling program. If the program does not have the EnableAPIs flag set to True, the initialization fails.
To set the EnableApis flag to True, call the EnableApis function from your program. To call the EnableApis function, you need a schema/user account with an Execute privilege on the CDR_PUB_API_INITIALIZATION API granted by a system administrator.
Therefore, when you write a program that calls an API and is intended for use outside Oracle LSH, set the EnableApis flag to True in your program and then set it to False at the end to force the security check on the schema the next time the program is run:
Parent topic: Calling APIs from Outside Oracle LSH