Error Codes

❗️

This is a legacy Apache Ignite documentation

The new documentation is hosted here: https://ignite.apache.org/docs/latest/

To get an error code, use the SQLGetDiagRec() function that returns a string holding the ANSI SQL error code defined. For example:

SQLHENV env;
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);

SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION, reinterpret_cast<void*>(SQL_OV_ODBC3), 0);

SQLHDBC dbc;
SQLAllocHandle(SQL_HANDLE_DBC, env, &dbc);

SQLCHAR connectStr[] = "DRIVER={Apache Ignite};SERVER=localhost;PORT=10800;SCHEMA=Person;";
SQLDriverConnect(dbc, NULL, connectStr, SQL_NTS, 0, 0, 0, SQL_DRIVER_COMPLETE);

SQLAllocHandle(SQL_HANDLE_STMT, dbc, &stmt);

SQLCHAR query[] = "SELECT firstName, lastName, resume, salary FROM Person";
SQLRETURN ret = SQLExecDirect(stmt, query, SQL_NTS);

if (ret != SQL_SUCCESS)
{
	SQLCHAR sqlstate[7] = "";
	SQLINTEGER nativeCode;

	SQLCHAR message[1024];
	SQLSMALLINT reallen = 0;

	int i = 1;
	ret = SQLGetDiagRec(SQL_HANDLE_STMT, stmt, i, sqlstate,
                      &nativeCode, message, sizeof(message), &reallen);
	
	while (ret != SQL_NO_DATA)
	{
		std::cout << sqlstate << ": " << message;
	
		++i;
		ret = SQLGetDiagRec(SQL_HANDLE_STMT, stmt, i, sqlstate, 
                        &nativeCode, message, sizeof(message), &reallen);
	}
}

The table below lists all the error codes supported by Ignite presently. This list may be extended in the future.

CodeDescription
01S00Invalid connection string attribute.
01S02The driver did not support the specified value and substituted a similar value.
08001The driver failed to open a connection to the cluster.
08002The connection is already established.
08003The connection is in the closed state. Happened unexpectedly.
08004The connection is rejected by the cluster.
08S01Connection failure.
22026String length mismatch in data-at-execution dialog.
23000Integrity constraint violation (e.g. duplicate key, null key and so on).
24000Invalid cursor state.
42000Syntax error in request.
42S01Table already exists.
42S02Table not found.
42S11Index already exists.
42S12Index not found.
42S21Column already exists.
42S22Column not found.
HY000General error. See error message for details.
HY001Memory allocation error.
HY003Invalid application buffer type.
HY004Invalid SQL data type.
HY009Invalid use of null-pointer.
HY010Function call sequence error.
HY090Invalid string or buffer length (e.g. negative or zero length).
HY092Option type out of range.
HY097Column type out of range.
HY105Invalid parameter type.
HY106Fetch type out of range.
HYC00Feature is not implemented.
IM001Function is not supported.