![]() |
OCILIB (C and C++ Driver for Oracle)
4.9.0
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
|
OcilibCApiInitialization
OCILIB provides two mechanisms for error handling:
Errors are raised in the following situations:
If an error handler was provided to OCI_Initialize(), the library generates an OCI_Error handle and passes it to the error handler whenever an error occurs.
To use thread-contextual error handling, pass the OCI_ENV_CONTEXT flag to OCI_Initialize(). When activated, error handles are stored per thread and the last error within a thread can be retrieved with OCI_GetLastError().
Error properties are accessible through a set of dedicated functions.
Oracle warnings are raised through the OCI_Error API. Such error handles have their error type property (OCI_ErrorGetType()) set to OCI_ERR_WARNING. Warning handling is disabled by default. To enable or disable it, use OCI_EnableWarnings().
Functions | |
| OCI_SYM_PUBLIC boolean OCI_API | OCI_SetErrorHandler (POCI_ERROR handler) |
| Set the global error user handler. | |
| OCI_SYM_PUBLIC const otext *OCI_API | OCI_GetLocaleString (unsigned int code) |
| Return the localized error message string for the given OCILIB internal error code. | |
| OCI_SYM_PUBLIC OCI_Error *OCI_API | OCI_GetLastError (void) |
| Retrieve the last error or warning that occurred during the most recent OCILIB call. | |
| OCI_SYM_PUBLIC const otext *OCI_API | OCI_ErrorGetString (OCI_Error *err) |
| Retrieve the error message string from an error handle. | |
| OCI_SYM_PUBLIC unsigned int OCI_API | OCI_ErrorGetType (OCI_Error *err) |
| Retrieve the type of error from an error handle. | |
| OCI_SYM_PUBLIC int OCI_API | OCI_ErrorGetOCICode (OCI_Error *err) |
| Retrieve the Oracle error code (ORA-XXXXX) from an error handle. | |
| OCI_SYM_PUBLIC int OCI_API | OCI_ErrorGetInternalCode (OCI_Error *err) |
| Retrieve the OCILIB internal error code from an error handle. | |
| OCI_SYM_PUBLIC OCI_Connection *OCI_API | OCI_ErrorGetConnection (OCI_Error *err) |
| Retrieve the connection handle associated with the error. | |
| OCI_SYM_PUBLIC OCI_Statement *OCI_API | OCI_ErrorGetStatement (OCI_Error *err) |
| Retrieve the statement handle associated with the error. | |
| OCI_SYM_PUBLIC unsigned int OCI_API | OCI_ErrorGetRow (OCI_Error *err) |
| Return the row index that caused an error during array DML execution. | |
| OCI_SYM_PUBLIC const otext *OCI_API | OCI_ErrorGetLocation (OCI_Error *err) |
| Return the location where the error occurred. | |
| OCI_SYM_PUBLIC boolean OCI_API OCI_SetErrorHandler | ( | POCI_ERROR | handler | ) |
#include <api.h>
Set the global error user handler.
| handler | - Pointer to the error handler procedure, or NULL to remove the current handler |
| OCI_SYM_PUBLIC const otext *OCI_API OCI_GetLocaleString | ( | unsigned int | code | ) |
#include <api.h>
Return the localized error message string for the given OCILIB internal error code.
| code | - OCILIB internal error code |
Referenced by ocilib::Environment::GetLocaleString().
| OCI_SYM_PUBLIC OCI_Error *OCI_API OCI_GetLastError | ( | void | ) |
#include <api.h>
Retrieve the last error or warning that occurred during the most recent OCILIB call.
Referenced by ocilib::core::Check().
| OCI_SYM_PUBLIC const otext *OCI_API OCI_ErrorGetString | ( | OCI_Error * | err | ) |
#include <api.h>
Retrieve the error message string from an error handle.
| err | - Error handle |
| OCI_SYM_PUBLIC unsigned int OCI_API OCI_ErrorGetType | ( | OCI_Error * | err | ) |
#include <api.h>
Retrieve the type of error from an error handle.
| err | - Error handle |
| OCI_SYM_PUBLIC int OCI_API OCI_ErrorGetOCICode | ( | OCI_Error * | err | ) |
#include <api.h>
Retrieve the Oracle error code (ORA-XXXXX) from an error handle.
| err | - Error handle |
| OCI_SYM_PUBLIC int OCI_API OCI_ErrorGetInternalCode | ( | OCI_Error * | err | ) |
#include <api.h>
Retrieve the OCILIB internal error code from an error handle.
| err | - Error handle |
| OCI_SYM_PUBLIC OCI_Connection *OCI_API OCI_ErrorGetConnection | ( | OCI_Error * | err | ) |
#include <api.h>
Retrieve the connection handle associated with the error.
| err | - Error handle |
| OCI_SYM_PUBLIC OCI_Statement *OCI_API OCI_ErrorGetStatement | ( | OCI_Error * | err | ) |
#include <api.h>
Retrieve the statement handle associated with the error.
| err | - Error handle |
| OCI_SYM_PUBLIC unsigned int OCI_API OCI_ErrorGetRow | ( | OCI_Error * | err | ) |
#include <api.h>
Return the row index that caused an error during array DML execution.
| err | - Error handle |
| OCI_SYM_PUBLIC const otext *OCI_API OCI_ErrorGetLocation | ( | OCI_Error * | err | ) |
#include <api.h>
Return the location where the error occurred.
| err | - Error handle |