OCILIB (C and C++ Driver for Oracle)
4.6.3
|
OCILIB provides two mechanisms for error handling:
Exceptions are raised:
If an error handler was provided to OCI_Initialize(), when an error occurs, the library generates an OCI_Error handle and pass it to the error handler.
In order to use the thread contextual error handling, you must call OCI_Initialize() with the flag OCI_ENV_CONTEXT for the mode parameter. When activated, error handles are stored per thread and the last error within a thread can be retrieved with OCI_GetLastError()
Exception properties are accessible through a set of functions
Oracle warnings are raised through OCI_Error API. Such error handles have their error type property (OCI_ErrorGetType()) set to OCI_ERR_WARNING. Warning handing is disabled by default. To activate/deactivate it, use OCI_EnableWarnings()
Functions | |
OCI_EXPORT OCI_Error *OCI_API | OCI_GetLastError (void) |
Retrieve the last error or warning occurred within the last OCILIB call. More... | |
OCI_EXPORT const otext *OCI_API | OCI_ErrorGetString (OCI_Error *err) |
Retrieve error message from error handle. More... | |
OCI_EXPORT unsigned int OCI_API | OCI_ErrorGetType (OCI_Error *err) |
Retrieve the type of error from error handle. More... | |
OCI_EXPORT int OCI_API | OCI_ErrorGetOCICode (OCI_Error *err) |
Retrieve Oracle Error code from error handle. More... | |
OCI_EXPORT int OCI_API | OCI_ErrorGetInternalCode (OCI_Error *err) |
Retrieve Internal Error code from error handle. More... | |
OCI_EXPORT OCI_Connection *OCI_API | OCI_ErrorGetConnection (OCI_Error *err) |
Retrieve connection handle within the error occurred. More... | |
OCI_EXPORT OCI_Statement *OCI_API | OCI_ErrorGetStatement (OCI_Error *err) |
Retrieve statement handle within the error occurred. More... | |
OCI_EXPORT unsigned int OCI_API | OCI_ErrorGetRow (OCI_Error *err) |
Return the row index which caused an error during statement execution. More... | |
OCI_EXPORT OCI_Error* OCI_API OCI_GetLastError | ( | void | ) |
#include <ocilib.h>
Retrieve the last error or warning occurred within the last OCILIB call.
Referenced by ocilib::Check().
OCI_EXPORT const otext* OCI_API OCI_ErrorGetString | ( | OCI_Error * | err | ) |
#include <ocilib.h>
Retrieve error message from error handle.
err | - Error handle |
Referenced by ocilib::Exception::~Exception().
OCI_EXPORT unsigned int OCI_API OCI_ErrorGetType | ( | OCI_Error * | err | ) |
#include <ocilib.h>
Retrieve the type of error from error handle.
err | - Error handle |
Referenced by ocilib::Exception::~Exception().
OCI_EXPORT int OCI_API OCI_ErrorGetOCICode | ( | OCI_Error * | err | ) |
#include <ocilib.h>
Retrieve Oracle Error code from error handle.
err | - Error handle |
Referenced by ocilib::Exception::~Exception().
OCI_EXPORT int OCI_API OCI_ErrorGetInternalCode | ( | OCI_Error * | err | ) |
#include <ocilib.h>
Retrieve Internal Error code from error handle.
err | - Error handle |
Referenced by ocilib::Exception::~Exception().
OCI_EXPORT OCI_Connection* OCI_API OCI_ErrorGetConnection | ( | OCI_Error * | err | ) |
#include <ocilib.h>
Retrieve connection handle within the error occurred.
err | - Error handle |
Referenced by ocilib::Exception::~Exception().
OCI_EXPORT OCI_Statement* OCI_API OCI_ErrorGetStatement | ( | OCI_Error * | err | ) |
#include <ocilib.h>
Retrieve statement handle within the error occurred.
err | - Error handle |
Referenced by ocilib::Exception::~Exception().
OCI_EXPORT unsigned int OCI_API OCI_ErrorGetRow | ( | OCI_Error * | err | ) |
#include <ocilib.h>
Return the row index which caused an error during statement execution.
err | - Error handle |
Referenced by ocilib::Exception::~Exception().