tbCLI Error Messages

This chapter describes errors that might occur while the tbCLI program is executed.

Return Codes

All tbCLI functions return a return code after execution. The return code is SQLRETURN type and an already defined value.

A tbCLI program state can be checked according to the return code returned by a tbCLI function as follows:

Return code
Description

SQL_SUCCESS

Function finished successfully.

SQL_SUCCESS_WITH_INFO

Function finished successfully, but there is a warning message.

SQL_NO_DATA

Function finished successfully, but related data cannot be found. (Ex: No row is updated by the given SQL statement)

SQL_INVALID_HANDLE

The handle given to an input parameter is invalid.

SQL_NEED_DATA

More data is required to execute the SQL statement. (Ex: Parameter)

SQL_STILL_EXECUTING

Previously executed SQL statement has not finished.

SQL_ERROR

Critical error has occurred.

These return codes can have additional SQLSTATE information.

Refer to “SQLSTATE” for more information on SQLSTATE or related APIs.


SQLSTATE

This section enumerates SQLSTATE information in the code order, and describes it. In addition, this section also describes the functions that can return the SQLSTATE code.

00000

00000

Description

Occurs when the function is successfully completed.

Function

All functions

01000 ~ 01007

01000

Description

General warning.

Function

All functions except for SQLError, SQLGetDiagField, and SQLGetDiagRec

01001

Description

Occurs when there is a cursor operation conflict.

Function

SQLExecDirec, SQLExecute, SQLParamDat, SQLSetPos

01002

Description

Occurs while disconnecting a database connection.

Function

SQLError, SQLGetDiagField, SQLGetDiagRec

01003

Description

Occurs when NULL value is deleted from the specified function.

Function

SQLExecDirect, SQLExecute, SQLParamData

01004

Description

Occurs when string data is truncated from the right.

Function

SQLBrowseConnect, SQLBulkOperations, SQLColAttribute, SQLDataSources, SQLDescribeCol, SQLDriverConnect, SQLDrivers, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch, SQLFetchScroll, SQLGetConnectAttr, SQLGetCursorName, SQLGetData, SQLGetDescField, SQLGetDescRec, SQLGetEnvAttr, SQLGetInfo,

SQLGetStmtAttr, SQLNativeSql, SQLParamData, SQLPutData, SQLSetCursorName

01006

Description

Occurs when the privilege is not canceled.

Function

SQLExecDirec, SQLExecute, SQLParamData

01007

Description

Occurs when the privilege is not granted.

Function

SQLExecDirect, SQLExecute, SQLParamData

01S00 ~ 01S09

01S00

Description

Occurs when the character string property is not valid.

Function

SQLBrowseConnect, SQLDriverConnect

01S01

Description

Error in a row.

Function

SQLBulkOperations, SQLExtendedFetch, SQLSetPos

01S02

Description

Occurs when an option value is changed.

Function

All functions excluding the following functions.

SQLBrowseConnect, SQLConnect, SQLDriverConnect, SQLExecDirect, SQLExecute, SQLParamData, SQLPrepare, SQLSetConnectAttr, SQLSetDescField, SQLSetEnvAttr, SQLSetStmtAttr

01S06

Description

Occurs when a fetch is attempted before the first row of the result set is returned.

Function

SQLExtendedFetch, SQLFetchScroll

01S07

Description

Occurs when part of a numeric type or DATETIME type is truncated.

Function

SQLBulkOperations, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch,

SQLFetchScroll, SQLGetData, SQLParamData, SQLSetPos

01S08

Description

Occurs when DSN file (.dsn) cannot be saved.

Function

SQLDriverConnect.

01S09

Description

Occurs when the reserved word is invalid.

Function

SQLDriverConnect

02000

02000

Description

Occurs when the function is successfully completed, but the relevant data is not found.

Function

All functions

07001 ~ 07009

07001

Description

Occurs when a parameter number is invalid.

Function

SQLExecDirect, SQLExecute

07002

Description

Error on COUNT field.

Function

SQLExecDirect, SQLExecute, SQLParamData

07005

Description

Occurs when a prepared statement's cursor is out of range.

Function

SQLColAttribute, SQLDescribeCol

07006

Description

Violation of a limited data type property.

Function

SQLBindCol, SQLBindParameter, SQLBulkOperations, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch, SQLFetchScroll, SQLGetData, SQLParamData,

SQLPutData, SQLSetPos

07009

Description

Invalid descriptor index.

Function

SQLBindCol, SQLBindParameter, SQLBulkOperations, SQLColAttribute, SQLDescribeCol, SQLDescribeParam, SQLFetch, SQLFetchScroll, SQLGetData, SQLGetDescField,

SQLGetDescRec, SQLParamData, SQLSetDescField, SQLSetDescRec, SQLSetPos

07S01

07S01

Description

Occurs when a default parameter is incorrectly used.

Function

SQLExecDirect, SQLExecute, SQLParamData, SQLPutData

08001 ~ 08007

08001

Description

Occurs when a client cannot connect to a datasource.

Function

SQLBrowseConnect, SQLConnect, SQLDriverConnect

08002

Description

Occurs when a database connection name is already in use.

Function

SQLBrowseConnect, SQLConnect, SQLDriverConnect, SQLSetConnectAttr

08003

Description

Occurs when a connection does not exist.

Function

SQLAllocHandle, SQLDisconnect, SQLEndTran, SQLGetConnectAttr, SQLGetInfo, SQLNativeSql, SQLSetConnectAttr

08004

Description

Occurs when the server denies a connection.

Function

SQLBrowseConnect, SQLConnect, SQLDriverConnect

08007

Description

Occurs when a connection fails, while executing a transaction.

Function

SQLEndTran

08S01

08S01

Description

Occurs when a communication connection fails.

Function

SQLBrowseConnect, SQLColumnPrivileges, SQLColumns, SQLConnect, SQLCopyDesc, SQLDescribeCol, SQLDescribeParam, SQLDriverConnect, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch, SQLFetchScroll, SQLForeignKeys, SQLGetConnectAttr,

SQLGetData, SQLGetDescField, SQLGetDescRec, SQLGetFunctions, SQLGetInfo, SQLGetTypeInfo, SQLMoreResults, SQLNativeSql, SQLNumParams, SQLNumResultCols, SQLParamData, SQLPrepare, SQLPrimaryKeys, SQLProcedureColumns, SQLProcedures, SQLPutData, SQLSetConnectAttr, SQLSetDescField, SQLSetDescRec, SQLSetEnvAttr,

SQLSetStmtAttr, SQLSpecialColumns, SQLStatistics, SQLTablePrivileges, SQLTables

21S01 ~ 21S02

21S01

Description

Occurs when the list of values to be inserted does not match the columns.

Function

SQLExecDirect, SQLPrepare

21S02

Description

Occurs when a derived tables degree and columns do not match.

Function

SQLBulkOperations, SQLExecDirect, SQLExecute, SQLParamData, SQLPrepare,

SQLSetPos

22001 ~ 22026

22001

Description

Occurs when string data is truncated from the right.

Function

SQLBulkOperations, SQLExecDirect, SQLExecute, SQLFetch, SQLFetchScroll,

SQLParamData, SQLPutData, SQLSetDescField, SQLSetPos

22002

Description

Occurs when an indicator variable is requested but not provided.

Function

SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch, SQLFetchScroll,

SQLGetData, SQLParamData

22003

Description

Occurs when the numeric value exceeds the limited range.

Function

SQLBulkOperations, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch,

SQLFetchScroll, SQLGetData, SQLGetInfo, SQLParamData, SQLPutData, SQLSetPos

22007

Description

Invalid DATETIME format.

Function

SQLBulkOperations, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch,

SQLFetchScroll, SQLGetData, SQLParamData, SQLPutData, SQLSetPos

22008

Description

Occurs when an overflow occurs in the DATETIME field.

Function

SQLBulkOperations, SQLExecDirect, SQLExecute, SQLParamData, SQLPutData

22012

Description

Occurs when divided by 0.

Function

SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch, SQLFetchScroll,

SQLGetData, SQLParamData, SQLPutData

22015

Description

Occurs when an overflow occurs in the INTERVAL field.

Function

SQLBulkOperations, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch,

SQLFetchScroll, SQLGetData, SQLParamData, SQLPutData, SQLSetPos

22018

Description

Occurs when a character value for cast configuration is invalid.

Function

SQLBulkOperations, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch,

SQLFetchScroll, SQLGetData, SQLParamData, SQLPutData, SQLSetPos

22019

Description

Invalid escape character.

Function

SQLExecDirect, SQLExecute, SQLPrepare

22025

Description

Invalid escape sequence.

Function

SQLExecDirect, SQLExecute, SQLPrepare

22026

Description

Occurs when string data has an invalid length.

Function

SQLParamData

23000, 24000, 25000

23000

Description

Integrity constraint violation

Function

SQLBulkOperations, SQLExecDirect, SQLExecute, SQLParamData, SQLSetPos

24000

Description

Invalid cursor state.

Function

SQLBulkOperations, SQLCloseCursor, SQLColumnPrivileges, SQLColumns, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch, SQLFetchScroll, SQLForeignKeys, SQLGetData, SQLGetStmtAttr, SQLGetTypeInfo, SQLNativeSql, SQLPrepare, SQLPrimaryKeys, SQLProcedureColumns, SQLProcedures, SQLSetConnectAttr, SQLSetCursorName, SQLSetPos, SQLSetStmtAttr,

SQLSpecialColumns, SQLStatistics, SQLTablePrivileges, SQLTables

25000

Description

Invalid transaction state.

Function

SQLDisconnect

25S01 ~ 25S03

25S01

Description

Transaction state unknown.

Function

SQLEndTran

25S02

Description

Occurs when a transaction is still active.

Function

SQLEndTran

25S03

Description

Occurs when a transaction is rolled back.

Function

SQLEndTran

28000, 34000

28000

Description

Occurs when an invalid authority is configured.

Function

SQLBrowseConnect, SQLConnect, SQLDriverConnect

34000

Description

Invalid cursor name.

Function

SQLExecDirect, SQLPrepare, SQLSetCursorName

3C000 ~ 3F000

3C000

Description

Duplicated cursor name.

Function

SQLSetCursorName

3D000

Description

Invalid catalog name.

Function

SQLExecDirect, SQLPrepare, SQLSetConnectAttr

3F000

Description

Invalid schema name.

Function

SQLExecDirect, SQLPrepare

40001 ~ 40003, 42000

40001

Description

Occurs when serialization fails.

Function

SQLBulkOperations, SQLColumnPrivileges, SQLColumns, SQLEndTran, SQLExecDirect, SQLExecute, SQLFetch, SQLFetchScroll, SQLForeignKeys, SQLGetTypeInfo, SQLMoreResults, SQLParamData, SQLPrimaryKeys, SQLProcedureColumns, SQLProcedures, SQLSetPos, SQLSpecialColumns, SQLStatistics, SQLTablePrivileges,

SQLTables

40002

Description

Integrity constraint violation.

Function

SQLEndTran

40003

Description

Occurs when execution has not finished and the transaction state is unknown.

Function

SQLBulkOperations, SQLColumnPrivileges, SQLColumns, SQLExecDirect, SQLExecute, SQLFetch, SQLFetchScroll, SQLForeignKeys, SQLGetTypeInfo, SQLMoreResults, SQLPrimaryKeys, SQLProcedureColumns, SQLProcedures, SQLParamData, SQLSetPos,

SQLSpecialColumns, SQLStatistics, SQLTablePrivileges, SQLTables

42000

Description

Syntax error or an error that occurs from access violation.

Function

SQLBulkOperations, SQLExecDirect, SQLExecute, SQLParamData, SQLPrepare, SQLSetPos

42S01 ~ 42S22, 44000

42S01

Description

Occurs when a base table or view already exists.

Function

SQLExecDirect, SQLPrepare

42S02

Description

Occurs when a base table or view cannot be found.

Function

SQLExecDirect, SQLPrepare

42S11

Description

Occurs when an index already exists.

Function

SQLExecDirect, SQLPrepare

42S12

Description

Occurs when an index cannot be found.

Function

SQLExecDirect, SQLPrepare

42S21

Description

Occurs when a column already exists.

Function

SQLExecDirect, SQLPrepare

42S22

Description

Occurs when a column cannot be found.

Function

SQLExecDirect, SQLPrepare

44000

Description

Occurs from violation of WITH CHECK OPTION.

Function

SQLBulkOperations, SQLExecDirect, SQLExecute, SQLParamData, SQLSetPos

HY000 ~ HY024

HY000

Description

General error.

Function

All ODBC functions except for SQLError, SQLGetDiagField, SQLGetDiagRec

HY001

Description

Occurs when memory allocation fails.

Function

All ODBC functions except for SQLError, SQLGetDiagField, SQLGetDiagRec

HY003

Description

Occurs when an application's buffer type is invalid.

Function

SQLBindCol, SQLBindParameter, SQLGetData

HY004

Description

Occurs when an SQL data type is invalid.

Function

SQLBindParameter, SQLGetTypeInfo

HY007

Description

Occurs when the statement is not prepared.

Function

SQLCopyDesc, SQLGetDescField, SQLGetDescRec

HY008

Description

Occurs when an operation is canceled.

Function

SQLBulkOperations, SQLColAttribute, SQLColumnPrivileges, SQLColumns, SQLDescribeCol, SQLDescribeParam, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch, SQLFetchScroll, SQLForeignKeys, SQLGetData, SQLGetTypeInfo, SQLMoreResults, SQLNumParams, SQLNumResultCols, SQLParamData, SQLPrepare, SQLPrimaryKeys, SQLProcedureColumns, SQLProcedures, SQLPutData, SQLSetPos,

SQLSpecialColumns, SQLStatistics, SQLTablePrivileges, SQLTables

HY009

Description

Occurs when NULL pointer is incorrectly used.

Function

SQLAllocHandle, SQLBindParameter, SQLBulkOperations, SQLColumnPrivileges, SQLColumns, SQLExecDirect, SQLForeignKeys, SQLGetCursorName, SQLGetData, SQLGetFunctions, SQLNativeSql, SQLPrepare, SQLPrimaryKeys, SQLProcedureColumns, SQLProcedures, SQLPutData, SQLSetConnectAttr, SQLSetCursorName, SQLSetEnvAttr,

SQLSetStmtAttr, SQLSpecialColumns, SQLStatistics, SQLTablePrivileges, SQLTables

HY010

Description

Occurs when there is a problem in a function sequence.

Function

SQLAllocHandle, SQLBindCol, SQLBindParameter, SQLBulkOperations, SQLCloseCursor, SQLColAttribute, SQLColumnPrivileges, SQLColumns, SQLCopyDesc, SQLDescribeCol, SQLDescribeParam, SQLDisconnect, SQLEndTran, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch, SQLFetchScroll, SQLForeignKeys, SQLFreeHandle, SQLFreeStmt, SQLGetConnectAttr, SQLGetCursorName, SQLGetData, SQLGetDescField, SQLGetDescRec, SQLGetFunctions, SQLGetStmtAttr, SQLGetTypeInfo, SQLMoreResults, SQLNumParams, SQLNumResultCols, SQLParamData, SQLPrepare, SQLPrimaryKeys, SQLProcedureColumns, SQLProcedures, SQLPutData, SQLRowCount, SQLSetConnectAttr, SQLSetCursorName, SQLSetDescField, SQLSetEnvAttr, SQLSetDescRec, SQLSetPos, SQLSetStmtAttr, SQLSpecialColumns, SQLStatistics,

SQLTablePrivileges, SQLTables

HY011

Description

Occurs when the property cannot currently be configured.

Function

SQLBulkOperations, SQLParamData, SQLSetConnectAttr, SQLSetPos, SQLSetStmtAttr

HY012

Description

Occurs when a transaction operation code is invalid.

Function

SQLEndTran

HY013

Description

Memory management error

Function

All ODBC functions except for SQLGetDiagField, SQLGetDiagRec

HY014

Description

Occurs when the number of handles exceeds the limit.

Function

SQLAllocHandle

HY015

Description

Occurs when there is no available cursor name.

Function

SQLGetCursorName

HY016

Description

Occurs when an implementation row description cannot be changed.

Function

SQLCopyDesc, SQLSetDescField, SQLSetDescRec

HY017

Description

Occurs when the automatically allocated description handle is incorrectly used.

Function

SQLFreeHandle, SQLSetStmtAttr

HY018

Description

Occurs when the server denies the cancel request.

Function

SQLCancel

HY019

Description

Occurs when non-character and non-binary data are sent by being divided into several

pieces.

Function

SQLPutData

HY020

Description

Occurs when attempting to concatenate a NULL value.

Function

SQLPutData

HY021

Description

Inconsistent descriptor information.

Function

SQLBindParameter, SQLCopyDesc, SQLGetDescField, SQLSetDescField, SQLSetDescRec

HY024

Description

Invalid property value.

Function

SQLSetConnectAttr, SQLSetEnvAttr, SQLSetStmtAttr

HY090 ~ HY111

HY090

Description

Invalid string or buffer length.

Function

SQLBindCol, SQLBindParameter, SQLBrowseConnect, SQLBulkOperations, SQLColAttribute, SQLColumnPrivileges, SQLColumns, SQLConnect, SQLDataSources, SQLDescribeCol, SQLDriverConnect, SQLDrivers, SQLExecDirect, SQLExecute, SQLFetch, SQLFetchScroll, SQLForeignKeys, SQLGetConnectAttr, SQLGetCursorName, SQLGetData, SQLGetDescField, SQLGetInfo, SQLGetStmtAttr, SQLNativeSql, SQLParamData, SQLPrepare, SQLPrimaryKeys, SQLProcedureColumns, SQLProcedures, SQLPutData, SQLSetConnectAttr, SQLSetCursorName, SQLSetDescField, SQLSetDescRec, SQLSetEnvAttr, SQLSetStmtAttr, SQLSetPos, SQLSpecialColumns,

SQLStatistics, SQLTablePrivileges, SQLTables

HY091

Description

Invalid descriptor's field identifier.

Function

SQLColAttribute, SQLGetDescField, SQLSetDescField

HY092

Description

Invalid property or option identifier.

Function

SQLAllocHandle, SQLBulkOperations, SQLCopyDesc, SQLDriverConnect, SQLEndTran, SQLFreeStmt, SQLGetConnectAttr, SQLGetEnvAttr, SQLGetStmtAttr, SQLParamData,

SQLSetConnectAttr, SQLSetDescField, SQLSetEnvAttr, SQLSetPos, SQLSetStmtAttr

HY095

Description

Occurs when the function type is out of range.

Function

SQLGetFunctions

HY096

Description

Invalid information type.

Function

SQLGetInfo

HY097

Description

Occurs when the column is out of range.

Function

SQLSpecialColumns

HY098

Description

Occurs when the scope type is out of range.

Function

SQLSpecialColumns

HY099

Description

Occurs when Nullable type is out of range.

Function

SQLSpecialColumns

HY100

Description

Occurs when a unique option type is out of range.

Function

SQLStatistics

HY101

Description

Occurs when a precision option type is out of range.

Function

SQLStatistics

HY103

Description

Invalid retrieval code.

Function

SQLDataSources, SQLDrivers

HY104

Description

Invalid precision or scale value.

Function

SQLBindParameter

HY105

Description

Invalid parameter type.

Function

SQLBindParameter, SQLExecDirect, SQLExecute, SQLParamData, SQLSetDescField

HY106

Description

Occurs when a patch type is out of range.

Function

SQLExtendedFetch, SQLFetchScroll

HY107

Description

Occurs when a row value is out of range.

Function

SQLExtendedFetch, SQLFetch, SQLFetchScroll, SQLSetPos

HY109

Description

Invalid cursor position.

Function

SQLExecDirect, SQLExecute, SQLGetData, SQLGetStmtAttr, SQLNativeSql,

SQLParamData, SQLSetPos

HY110

Description

Invalid driver completion.

Function

SQLDriverConnect

HY111

Description

Invalid bookmark value.

Function

SQLExtendedFetch, SQLFetchScroll

HYC00

HYC00

Description

Occurs when trying to use an unimplemented optional feature.

Function

SQLBindCol, SQLBindParameter, SQLBulkOperations, SQLColAttribute, SQLColumnPrivileges, SQLColumns, SQLDriverConnect, SQLEndTran, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch, SQLFetchScroll, SQLForeignKeys, SQLGetConnectAttr, SQLGetData, SQLGetEnvAttr, SQLGetInfo, SQLGetStmtAttr, SQLGetTypeInfo, SQLParamData, SQLPrepare, SQLPrimaryKeys, SQLProcedureColumns, SQLProcedures, SQLSetConnectAttr, SQLSetEnvAttr, SQLSetPos, SQLSetStmtAttr,

SQLSpecialColumns, SQLStatistics, SQLTablePrivileges, SQLTables

HYT00 ~ HYT01

HYT00

Description

Occurs when timeout is exceeded.

Function

SQLBrowseConnect, SQLBulkOperations, SQLColumnPrivileges, SQLColumns, SQLConnect, SQLDriverConnect, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLForeignKeys, SQLGetTypeInfo, SQLParamData, SQLPrepare, SQLPrimaryKeys, SQLProcedureColumns, SQLProcedures, SQLSetPos, SQLSpecialColumns,

SQLStatistics, SQLTablePrivileges, SQLTables

HYT01

Description

Occurs when database connection timeout is exceeded.

Function

All ODBC functions except for SQLDrivers, SQLDataSources,

SQLGetEnvAttr, SQLSetEnvAttr

IM001 ~ IM015

IM001

Description

Occurs when the driver does not provide the function.

Function

All ODBC functions except for SQLAllocHandle, SQLDataSources, SQLDrivers,

SQLFreeHandle, SQLGetFunctions

IM002

Description

Occurs when the datasource name cannot be found or default driver does not exist.

Function

SQLBrowseConnect, SQLConnect, SQLDriverConnect

IM003

Description

Occurs when the specified driver cannot be loaded.

Function

SQLBrowseConnect, SQLConnect, SQLDriverConnect

IM004

Description

Occurs when an environment handle allocation to the driver by using the SQLAllocHandle

function fails.

Function

SQLBrowseConnect, SQLConnect, SQLDriverConnect

IM005

Description

Occurs when a connection handle allocation to the driver when using the SQLAllocHandle

function fails.

Function

SQLBrowseConnect, SQLConnect, SQLDriverConnect

IM006

Description

Occurs when a database connection property configuration to the driver when using the

SQLSetConnectAttr function, fails.

Function

SQLBrowseConnect, SQLConnect, SQLDriverConnect

IM007

Description

Occurs when a datasource or driver is not specified.

Function

SQLDriverConnect

IM009

Description

Occurs when translation DDL cannot be loaded.

Function

SQLBrowseConnect, SQLConnect, SQLDriverConnect, SQLSetConnectAttr

IM010

Description

Occurs when a datasource name is longer than the value specified in the

SQL_MAX_DSN_LENGTH parameter.

Function

SQLBrowseConnect, SQLConnect, SQLDriverConnect

IM011

Description

Occurs when the driver name is too long.

Function

SQLBrowseConnect, SQLDriverConnect

IM012

Description

Occurs when syntax error occurs in driver reserved words.

Function

SQLBrowseConnect, SQLDriverConnect

IM013

Description

Occurs when the trace file has a problem.

Function

All ODBC functions

IM014

Description

Invalid file DSN name.

Function

SQLDriverConnect

IM015

Description

Damaged file datasource.

Function

SQLDriverConnect

Last updated