C Driver API 3.0.0
API for the NuoDB C Driver Library
Loading...
Searching...
No Matches
error.h File Reference

NuoDB Error information. More...

#include "nuodb/utils.h"
#include "nuodb/structs.h"

Go to the source code of this file.

Data Structures

struct  NuoDB_Error
 NuoDB error information data structure More...
 

Typedefs

typedef enum NuoDB_Status_enum NuoDB_Status
 Status codes used by the C Driver.
 

Enumerations

enum  NuoDB_Status_enum {
  NUODB_NO_DATA = 1 ,
  NUODB_SUCCESS = 0 ,
  NUODB_SYNTAX_ERROR = -1 ,
  NUODB_FEATURE_NOT_YET_IMPLEMENTED = -2 ,
  NUODB_BUG_CHECK = -3 ,
  NUODB_COMPILE_ERROR = -4 ,
  NUODB_RUNTIME_ERROR = -5 ,
  NUODB_OCS_ERROR = -6 ,
  NUODB_NETWORK_ERROR = -7 ,
  NUODB_CONVERSION_ERROR = -8 ,
  NUODB_TRUNCATION_ERROR = -9 ,
  NUODB_CONNECTION_ERROR = -10 ,
  NUODB_DDL_ERROR = -11 ,
  NUODB_APPLICATION_ERROR = -12 ,
  NUODB_SECURITY_ERROR = -13 ,
  NUODB_DATABASE_CORRUPTION = -14 ,
  NUODB_VERSION_ERROR = -15 ,
  NUODB_LICENSE_ERROR = -16 ,
  NUODB_INTERNAL_ERROR = -17 ,
  NUODB_DEBUG_ERROR = -18 ,
  NUODB_LOST_BLOB = -19 ,
  NUODB_INCONSISTENT_BLOB = -20 ,
  NUODB_DELETED_BLOB = -21 ,
  NUODB_LOG_ERROR = -22 ,
  NUODB_DATABASE_DAMAGED = -23 ,
  NUODB_UPDATE_CONFLICT = -24 ,
  NUODB_NO_SUCH_TABLE = -25 ,
  NUODB_INDEX_OVERFLOW = -26 ,
  NUODB_UNIQUE_DUPLICATE = -27 ,
  NUODB_UNCOMMITTED_UPDATES = -28 ,
  NUODB_DEADLOCK = -29 ,
  NUODB_OUT_OF_MEMORY_ERROR = -30 ,
  NUODB_OUT_OF_RECORD_MEMORY_ERROR = -31 ,
  NUODB_LOCK_TIMEOUT = -32 ,
  NUODB_PLATFORM_ERROR = -36 ,
  NUODB_NO_SCHEMA = -37 ,
  NUODB_CONFIGURATION_ERROR = -38 ,
  NUODB_READ_ONLY_ERROR = -39 ,
  NUODB_NO_GENERATED_KEYS = -40 ,
  NUODB_THROWN_EXCEPTION = -41 ,
  NUODB_INVALID_TRANSACTION_ISOLATION = -42 ,
  NUODB_UNSUPPORTED_TRANSACTION_ISOLATION = -43 ,
  NUODB_INVALID_UTF8 = -44 ,
  NUODB_CONSTRAINT_ERROR = -45 ,
  NUODB_UPDATE_ERROR = -46 ,
  NUODB_I18N_ERROR = -47 ,
  NUODB_OPERATION_KILLED = -48 ,
  NUODB_INVALID_STATEMENT = -49 ,
  NUODB_IS_SHUTDOWN = -50 ,
  NUODB_IN_QUOTED_STRING = -51 ,
  NUODB_BATCH_UPDATE_ERROR = -52 ,
  NUODB_JAVA_ERROR = -53 ,
  NUODB_INVALID_FIELD = -54 ,
  NUODB_INVALID_INDEX_NULL = -55 ,
  NUODB_INVALID_OPERATION = -56 ,
  NUODB_INVALID_STATISTICS = -57 ,
  NUODB_INVALID_GENERATOR = -58 ,
  NUODB_OPERATION_TIMEOUT = -59 ,
  NUODB_NO_SUCH_INDEX = -60 ,
  NUODB_NO_SUCH_SEQUENCE = -61 ,
  NUODB_XAER_PROTO = -62 ,
  NUODB_UNKNOWN_ERROR = -63 ,
  NUODB_TRANSACTIONAL_LOCK_ERROR = -64 ,
  NUODB_TRANSACTION_UNKNOWN_STATE = -65 ,
  NUODB_INVALID_TIMEZONE_DISPLACEMENT_VALUE = -66 ,
  NUODB_INVALID_JSON_TEXT = -67 ,
  NUODB_SEQUENCE_GENERATE_LIMIT_EXCEEDED = -68 ,
  NUODB_NO_SQL_JSON_ITEM = -69 ,
  NUODB_FINAL_ENUM_MEMBER_IS_UNUSED = -70
}
 Enum defining status codes used by the C-Language API. More...
 

Functions

NUODB_CAPI void NUODB_CAPICALL NuoDB_Error_clearLastErrorInfo ()
 Clear the last known error.
 
NUODB_CAPI NuoDB_Error *NUODB_CAPICALL NuoDB_Error_getLastErrorInfo ()
 Obtain the last known error.
 
NUODB_CAPI void NUODB_CAPICALL NuoDB_Error_registerCallback (NuoDB_Status(*error_callback)(NuoDB_Error *error))
 Register an error callback function.
 
NUODB_CAPI void NUODB_CAPICALL NuoDB_Error_setSqlState (const char *sqlState)
 

Detailed Description

NuoDB Error information.

Enumeration Type Documentation

◆ NuoDB_Status_enum

Enum defining status codes used by the C-Language API.

Enumerator
NUODB_NO_DATA 

indicates when is is no more data

NUODB_SUCCESS 

success

NUODB_SYNTAX_ERROR 

SQL syntax error, Example: "wrong number of arguments for function".

NUODB_FEATURE_NOT_YET_IMPLEMENTED 

Feature is not yet implemented.

NUODB_BUG_CHECK 

An internal database error has occurred.

NUODB_COMPILE_ERROR 

An error has occurred during compilation of the SQL statement, Example: "inconsistent select list in union branches".

NUODB_RUNTIME_ERROR 

An error has occurred during execution of an SQL statement, Example: "ResultSet has been closed".

NUODB_OCS_ERROR 

Unused.

NUODB_NETWORK_ERROR 

A network communication has occurred, either with the Broker or TE, Example: "no nodes are available for database".

NUODB_CONVERSION_ERROR 

An conversion error has occurred during execution of an SQL statement, Example: "Numeric overflow converting...".

NUODB_TRUNCATION_ERROR 

A truncation error has occurred during execution of an SQL statement, Example: "Assignment of n bytes into type of maximum length m".

NUODB_CONNECTION_ERROR 

Error related to making an SQL connection or to an already existing SQL connection, Examples: "database already open", "bad statement handle".

NUODB_DDL_ERROR 

A runtime error has occurred during execution of an SQL DDL statement, Example: "table already defined".

NUODB_APPLICATION_ERROR 

An application specific error has occurred, Example: "Cannot execute PreparedStatement with SQL parameter".

NUODB_SECURITY_ERROR 

A database security error has occurred, such as bad credentials, Examples: "no username specified", "not a known user", "requested access to foo is denied", "Unsupported cipher requested".

NUODB_DATABASE_CORRUPTION 

Unused.

NUODB_VERSION_ERROR 

Unused.

NUODB_LICENSE_ERROR 

Unused.

NUODB_INTERNAL_ERROR 

An internal error has occurred.

This should never happen. Examples: "function hasn't been compiled", "Unexpected NULL lower bound node"

NUODB_DEBUG_ERROR 

Unused.

NUODB_LOST_BLOB 

Unused.

NUODB_INCONSISTENT_BLOB 

Unused.

NUODB_DELETED_BLOB 

Unused.

NUODB_LOG_ERROR 

Unused.

NUODB_DATABASE_DAMAGED 

Unused.

NUODB_UPDATE_CONFLICT 

Server error has occurred, Example: "pending update rejected, transaction nnn".

NUODB_NO_SUCH_TABLE 

An invalid table reference has occurred, Examples: "Table has been dropped", "Can't find table".

NUODB_INDEX_OVERFLOW 

Unused.

NUODB_UNIQUE_DUPLICATE 

Server error regarding duplicate values in a unique index".

NUODB_UNCOMMITTED_UPDATES 

Unused.

NUODB_DEADLOCK 

Server deadlock error.

NUODB_OUT_OF_MEMORY_ERROR 

Unused.

NUODB_OUT_OF_RECORD_MEMORY_ERROR 

Unused.

NUODB_LOCK_TIMEOUT 

Statement timed out.

NUODB_PLATFORM_ERROR 

Generic server error.

NUODB_NO_SCHEMA 

An error occurred because no schema specified where schema is required.

NUODB_CONFIGURATION_ERROR 

Server configuration error, Example: "Could not find a valid archive at the given location".

NUODB_READ_ONLY_ERROR 

An error occurred where an attempt was made to write to a read only connection.

NUODB_NO_GENERATED_KEYS 

Unused.

NUODB_THROWN_EXCEPTION 

This is used by the SQL THROW control statement.

NUODB_INVALID_TRANSACTION_ISOLATION 

Unused.

NUODB_UNSUPPORTED_TRANSACTION_ISOLATION 

An error occurred where the transaction level specified for connection is unsupported.

NUODB_INVALID_UTF8 

An error occurred where a string that is expected to be UTF-8 is not.

NUODB_CONSTRAINT_ERROR 

A SQL constraint violation has occurred.

NUODB_UPDATE_ERROR 

An attempt was made to update a database object that cannot be updated, Example: "Table returned by a stored procedure cannot be manipulated".

NUODB_I18N_ERROR 

An error having to do with Internationalization has occurred, Example: "Error getting default converter".

NUODB_OPERATION_KILLED 

A SQL operation was killed, perhaps by the KILL STATEMENT command.

NUODB_INVALID_STATEMENT 

An invalid reference to a SQL statement occurred, Example: "On connection n, Unable to kill statement m.

No such statement id"

NUODB_IS_SHUTDOWN 

An error occurred because the database is shutting down.

NUODB_IN_QUOTED_STRING 

An internal error generated by parser when the statement string ends within a quoted string = used by nuosql,.

NUODB_BATCH_UPDATE_ERROR 

Catchall for Batch update exceptions.

NUODB_JAVA_ERROR 

An error has occurred, related to Java stored procedures.

NUODB_INVALID_FIELD 

A server error setting a value to an invalid field.

NUODB_INVALID_INDEX_NULL 

An invalid null was inserted into index.

NUODB_INVALID_OPERATION 

A generic error related to an invalid operation, Examples: "Maximum number of open result sets exceeded", "Maximum number of open statements exceeded".

NUODB_INVALID_STATISTICS 

Index statistics for a specified query have become invalid.

NUODB_INVALID_GENERATOR 

Badly defined generator defined in older version of nuodb.

Need to ALTER TABLE to change the columns type to either INT, BIGINT, NUMERIC or STRING

NUODB_OPERATION_TIMEOUT 

Query timeout period expired before a statement object executed.

Examples: Timeout of n micro second(s) exceeded", "Timeout of n second(s) exceeded"

NUODB_NO_SUCH_INDEX 

An invalid index reference has occurred, Examples: "Index has been dropped", "Can't index table".

NUODB_NO_SUCH_SEQUENCE 

An invalid sequence reference has occurred, Examples: "Sequence has been dropped", "Sequence doesn't exist".

NUODB_XAER_PROTO 

An error with the XA protocol has occurred, Examples: "TransactionId already prepared".

NUODB_TRANSACTIONAL_LOCK_ERROR 

*< An unknown error code

NUODB_TRANSACTION_UNKNOWN_STATE 

*< An error occurred while acquiring a transactional lock

NUODB_INVALID_TIMEZONE_DISPLACEMENT_VALUE 

*< An error occurred before the transaction successfully committed (for example: TE shutdown was initiated)

NUODB_INVALID_JSON_TEXT 

*< The timezone is invalid

NUODB_SEQUENCE_GENERATE_LIMIT_EXCEEDED 

*< An invalid json document or document path

NUODB_NO_SQL_JSON_ITEM 

*< An error occurred during sequence value generation

NUODB_FINAL_ENUM_MEMBER_IS_UNUSED 

*< No JSON item exists at path

Function Documentation

◆ NuoDB_Error_clearLastErrorInfo()

NUODB_CAPI void NUODB_CAPICALL NuoDB_Error_clearLastErrorInfo ( )

Clear the last known error.

This function clears the last known NuoDB_Error for the caller's thread.

◆ NuoDB_Error_getLastErrorInfo()

NUODB_CAPI NuoDB_Error *NUODB_CAPICALL NuoDB_Error_getLastErrorInfo ( )

Obtain the last known error.

This function returns a pointer to the last known NuoDB_Error that occurred in the context of the caller's thread. The NuoDB_Error data structure can be used to obtain the last known error code, error text, stack trace, and SQL State.

◆ NuoDB_Error_registerCallback()

NUODB_CAPI void NUODB_CAPICALL NuoDB_Error_registerCallback ( NuoDB_Status(* error_callback )(NuoDB_Error *error))

Register an error callback function.

This function allows the client application to register a function that will be called in the event of a error. The registered function is specific to the caller's thread. When an error occurs, the C driver will call the error function on the caller's thread.