OCILIB (C Driver for Oracle) 3.9.1
|
To use OCILIB, it first needs to be initialized through a call to OCI_Initialize().
Then, the application connects to server, executes queries...
Finally, OCILIB resources must be released by OCI_Cleanup()
The following objects are automatically freed by the library:
All other standalone object instances (mutexes, threads, dates, lobs, ...) ARE NOT freed.
#include "ocilib.h" int main(void) { if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT)) return EXIT_FAILURE; /* ... application code here ... */ OCI_Cleanup(); return EXIT_SUCCESS; }
Functions | |
OCI_EXPORT boolean OCI_API | OCI_Initialize (POCI_ERROR err_handler, const mtext *lib_path, unsigned int mode) |
Initialize the library. | |
OCI_EXPORT boolean OCI_API | OCI_Cleanup (void) |
Clean up all resources allocated by the library. | |
OCI_EXPORT unsigned int OCI_API | OCI_GetOCICompileVersion (void) |
Return the version of OCI used for compilation. | |
OCI_EXPORT unsigned int OCI_API | OCI_GetOCIRuntimeVersion (void) |
Return the version of OCI used at runtime. | |
OCI_EXPORT unsigned int OCI_API | OCI_GetImportMode (void) |
Return the Oracle shared library import mode. | |
OCI_EXPORT unsigned int OCI_API | OCI_GetCharsetMetaData (void) |
Return the metadata charset type. | |
OCI_EXPORT unsigned int OCI_API | OCI_GetCharsetUserData (void) |
Return the user data charset type. | |
OCI_EXPORT void OCI_API | OCI_EnableWarnings (boolean value) |
Enable or disable Oracle warning notifications. | |
OCI_EXPORT void OCI_API | OCI_SetErrorHandler (POCI_ERROR handler) |
Set the global error user handler. | |
OCI_EXPORT boolean OCI_API | OCI_SetHAHandler (POCI_HA_HANDLER handler) |
Set the High availabality (HA) user handler. |
OCI_EXPORT boolean OCI_API OCI_Initialize | ( | POCI_ERROR | err_handler, |
const mtext * | lib_path, | ||
unsigned int | mode | ||
) |
Initialize the library.
err_handler | - Pointer to error handler procedure (optional) |
lib_path | - Oracle shared library path (optional) |
mode | - Environment mode |
Possible values for parameter mode:
This function must be called before any OCILIB library function.
The parameter 'home' is only used if OCILIB has been built with the option OCI_IMPORT_RUNTIME (default on MS windows but NOT on Unix systems
If the parameter 'lib_path' is NULL, the Oracle library is loaded from system environment variables
OCI_Initialize() should be called ONCE per application
TRUE on success otherwise FALSE (only with Oracle runtime loading mode if the oracle shared libraries can't be loaded or if OCI subsystem cannot be initialized)
OCI_EXPORT boolean OCI_API OCI_Cleanup | ( | void | ) |
Clean up all resources allocated by the library.
This function must be the last OCILIB library function call.
OCI_Cleanup() should be called ONCE per application
OCI_EXPORT unsigned int OCI_API OCI_GetOCICompileVersion | ( | void | ) |
Return the version of OCI used for compilation.
OCI_EXPORT unsigned int OCI_API OCI_GetOCIRuntimeVersion | ( | void | ) |
Return the version of OCI used at runtime.
Definition at line 1368 of file library.c.
Referenced by OCI_GetVersionConnection().
OCI_EXPORT unsigned int OCI_API OCI_GetImportMode | ( | void | ) |
OCI_EXPORT unsigned int OCI_API OCI_GetCharsetMetaData | ( | void | ) |
OCI_EXPORT unsigned int OCI_API OCI_GetCharsetUserData | ( | void | ) |
OCI_EXPORT void OCI_API OCI_EnableWarnings | ( | boolean | value | ) |
OCI_EXPORT void OCI_API OCI_SetErrorHandler | ( | POCI_ERROR | handler | ) |
Set the global error user handler.
handler | - Pointer to error handler procedure |
OCI_EXPORT boolean OCI_API OCI_SetHAHandler | ( | POCI_HA_HANDLER | handler | ) |
Set the High availabality (HA) user handler.
handler | - Pointer to HA handler procedure |