SQL Error Messages
SQL error messages are crucial for diagnosing issues in SQL queries and database operations. They provide information about what went wrong during query execution and allow users to troubleshoot and correct problems.
These error messages are often accompanied by error codes that give specific details about the type of error encountered.
SQL Error Messages
- SQL error messages are feedback provided by a database management system (DBMS) when an issue occurs during the execution of SQL queries or commands.
- These errors help developers understand what went wrong and why a query failed.
- SQL error messages typically include an error code, a short description, and sometimes a detailed explanation.
Error Codes 0 and 100
These error codes indicate standard outcomes for SQL operations. SQLCODE 0 denotes a successful execution, while SQLCODE 100 indicates that a query was executed without errors but did not return any rows.
Error Code | Description |
---|---|
0 | Successful execution of the SQL statement. No errors occurred. |
100 | No data found; used by some SQL databases to indicate that a query has returned no rows. |
Error Codes -1 to -99
This range of error codes includes various general SQL issues, such as syntax errors, data type mismatches and permission problems. Understanding these errors can help diagnose common SQL issues.
Error Code | Description |
---|---|
-1 | General SQL error; the specific issue is not defined. |
-2 | Invalid SQL statement or syntax error in the SQL query. |
-3 | Out of memory; the system could not allocate the required memory. |
-4 | Database connection error; unable to establish or maintain a connection. |
-5 | Data type mismatch; trying to insert or process incompatible data types. |
-6 | Numeric overflow; value exceeds the storage capacity. |
-7 | Permission denied; user lacks necessary privileges for the operation. |
-8 | Constraint violation; such as a unique constraint or foreign key constraint failure. |
-9 | Invalid operation; performing an operation that is not allowed. |
-10 | Deadlock; two or more transactions are waiting for each other to release locks. |
-11 | Timeout; the operation took longer than the permitted time limit. |
-12 | Data integrity issue; corruption or mismatch in data. |
-13 | Invalid index; referring to a non-existent or incorrect index. |
-14 | Unspecified SQL error; general error with no specific cause. |
-15 | Authentication error; issues with user credentials or login. |
-16 | Database not found; the specified database does not exist. |
-17 | Query execution error; issues encountered during SQL query execution. |
Error Codes -101 to -399
This range includes more specific SQL error messages related to feature support, query execution, and data integrity. They can provide insights into advanced SQL issues and database feature limitations.
Error Code | Description |
---|---|
-101 | Syntax error; the SQL statement contains incorrect syntax. |
-102 | Incorrect or missing keyword in the SQL statement. |
-103 | Unexpected token; encountered an unrecognized or invalid character. |
-104 | Column not found; attempting to access a non-existent column. |
-105 | Table not found; specified table does not exist. |
-106 | Function or stored procedure not found; non-existent function or procedure. |
-107 | Invalid operation on an open cursor; operation not permitted. |
-108 | Incorrect data length; data does not fit in the specified length. |
-109 | Invalid constraint definition; issues with constraints in the database schema. |
-110 | Unsupported SQL feature; the SQL feature is not available in the current environment. |
-111 | Invalid data conversion; error during type conversion operations. |
-112 | Incorrect use of a JOIN operation; issues with table joins. |
-113 | Missing or incorrect transaction handling; issues with commits or rollbacks. |
-114 | Invalid user-defined function or procedure; issues with user-defined objects. |
-115 | Referential integrity error; issues with foreign key relationships. |
-116 | Invalid use of GROUP BY or ORDER BY clauses; incorrect query grouping or ordering. |
-117 | Error in aggregate function; issues with aggregation operations. |
-118 | Lock contention; conflicts with other transactions locking resources. |
-119 | Invalid sequence or identity column operation; issues with sequence generation. |
-120 | Error during data insertion; issues encountered while inserting data. |
Error Codes -400 to -500
Error Code | Description |
---|---|
-400 | General SQL error; often due to syntax or database access issues. |
-401 | Invalid SQL statement; unsupported command or syntax error. |
-402 | Data type mismatch; incompatible data types used in operations. |
-403 | Numeric value out of range; overflow or underflow condition. |
-404 | Null value not allowed; attempting to insert a null where not permitted. |
-405 | Invalid SQL function call; issues with SQL functions. |
-406 | Arithmetic overflow; overflow during calculations. |
-407 | Mandatory field missing; null value where not allowed. |
-408 | Invalid string length; data exceeds defined length. |
-409 | Invalid use of parentheses; issues with SQL query structure. |
-410 | Invalid data conversion; error during data type conversions. |
-411 | Null value encountered; null where not permitted in operations. |
-412 | Invalid comparison; comparing incompatible data types. |
-413 | Divide by zero error; division operation with zero divisor. |
-414 | Invalid cursor operation; issues with cursor handling. |
-415 | Referential integrity violation; foreign key constraint failure. |
-416 | Unsupported SQL statement; SQL statement not supported in current environment. |
-417 | Deadlock detected; conflicting resource locks. |
-418 | Invalid table or column reference; missing or incorrect alias. |
-419 | Ambiguous column reference; unresolved column names. |
-420 | Syntax error in SQL; missing or incorrect elements in SQL query. |
-421 | Incorrect privilege; operation not permitted due to permissions. |
-422 | Constraint violation; unique or check constraint failure. |
-423 | Invalid data type conversion; issues with casting data types. |
-424 | Invalid transaction state; incorrect operation context. |
-425 | Invalid parameter count; incorrect number of parameters. |
-426 | Permission denied; operation not allowed due to lack of privileges. |
-427 | Memory allocation error; insufficient resources for query. |
-428 | Invalid join condition; issues with SQL join operations. |
-429 | Incorrect use of aggregates; improper aggregation in queries. |
-430 | Invalid identifier; unknown or invalid SQL identifier. |
-431 | Exceeded maximum length; string or identifier too long. |
-432 | Use of reserved word; invalid use of SQL keywords. |
-433 | Transaction rollback; failure or timeout in transaction. |
-434 | Cursor already closed; operation attempted on a closed cursor. |
-435 | Incorrect subquery use; issues with nested queries. |
-436 | Invalid subquery reference; incorrect context for subqueries. |
-437 | Data type conversion failed; incompatible types during conversion. |
-438 | Query execution timeout; long-running query exceeded time limit. |
-439 | Invalid trigger operation; recursive or incorrect trigger use. |
-440 | User-defined function not found; function or procedure missing. |
-441 | Incorrect arguments; wrong number of arguments for function. |
-442 | Invalid foreign key relationship; issues with foreign keys. |
-443 | Incorrect aggregate use; invalid use of aggregation functions. |
-444 | Invalid SQL join; issues with join conditions. |
-445 | Illegal view or table modification; modification not permitted. |
-446 | Integrity constraint violation; issues with data constraints. |
-447 | Invalid index; issues with database indexing. |
-448 | SQL parsing error; issues with SQL query structure. |
-449 | Memory overflow; excessive query size or result set. |
-450 | Division by zero; mathematical operation with zero divisor. |
-451 | Invalid nested query use; issues with nested or correlated queries. |
-452 | Result set cursor state error; issues with cursor result set. |
-453 | Transaction failure; lock conflict or concurrency issue. |
-454 | Invalid SQL operation; disallowed operation in current state. |
-455 | Integrity constraint violation; unique or primary key issues. |
-456 | Invalid column reference; missing or incorrect column in SQL. |
-457 | Invalid aggregation; issues with SQL grouping or aggregation. |
-458 | Incorrect DISTINCT use; invalid use in multi-table queries. |
-459 | Deadlock detected; conflicting transaction locks. |
-460 | User-defined function issues; problems with function use. |
-461 | Ambiguous column reference; unresolved column names in query. |
-462 | Data type mismatch; incompatible types during operations. |
-463 | Reserved keyword use; invalid SQL keyword usage. |
-464 | Cursor already open; attempted to open an already open cursor. |
-465 | Foreign key constraint violation; broken foreign key references. |
-466 | Query timeout; long-running query exceeded time limit. |
-467 | Syntax error; incorrect query structure or syntax issue. |
-468 | Invalid SQL feature; unsupported feature in the database. |
-469 | Memory allocation issue; failure to allocate memory for query. |
-470 | Invalid view or table operation; issues with views or tables. |
-471 | SQL statement execution error; general execution issue. |
-472 | Data integrity issue; problems with data consistency. |
-473 | Invalid index usage; issues with database indexing. |
-474 | Invalid column definition; incorrect column specification. |
-475 | Incorrect query results; issues with query execution. |
-476 | Invalid use of aggregate functions; improper aggregation. |
-477 | Syntax error in query; issues with SQL query formatting. |
-478 | Invalid subquery; issues with subquery usage. |
-479 | Referential integrity violation; foreign key issues. |
-480 | Invalid column name; non-existent or incorrect column name. |
WinSock Error Codes -10050 to -11002
Error Code | Description |
---|---|
-10050 | Network is down; unable to reach the specified network. |
-10051 | Network unreachable; the network cannot be reached. |
-10052 | Connection aborted; the connection was terminated. |
-10053 | Software caused connection abort; connection was aborted by the software. |
-10054 | Connection reset by peer; the connection was reset by the remote host. |
-10055 | No buffer space available; insufficient resources to complete the operation. |
-10056 | Socket is already connected; attempt to connect already connected socket. |
-10057 | Socket is not connected; operation attempted on a disconnected socket. |
-10058 | Cannot send after socket shutdown; send operation attempted after socket was shut down. |
-10059 | Too many references; cannot join or connect the specified socket. |
-10060 | Connection timed out; the attempt to connect timed out. |
-10061 | Connection refused; no connection could be made because the target machine actively refused it. |
-10062 | Too many levels of symbolic links; too many symbolic links encountered. |
-10063 | File name too long; the file name or path is too long. |
-10064 | Host is down; the remote host is down. |
-10065 | No route to host; no route to the specified host. |
-10066 | Directory not empty; the directory is not empty. |
-10067 | Too many files open; the system has too many open files. |
-10068 | Operation canceled; operation was canceled. |
-10069 | Invalid argument; invalid argument passed to a function. |
-10070 | Operation not supported; the operation is not supported. |
-10071 | Address family not supported; the address family is not supported. |
-10072 | Protocol not supported; the protocol is not supported. |
-10073 | Protocol type not supported; the protocol type is not supported. |
-10074 | Operation not supported; the operation is not supported. |
-10075 | Protocol error; protocol error occurred. |
-10076 | Operation not supported; the requested operation is not supported. |
-10077 | Address family not supported; address family is not supported. |
-10078 | Protocol family not supported; protocol family is not supported. |
-10079 | Socket operation on non-socket; attempted to perform an operation on a non-socket. |
-10080 | Message size too long; the message is too long. |
-10081 | Network reset; network connection was reset. |
-10082 | Socket is already connected; the socket is already connected. |
-10083 | No buffer space available; no buffer space available to complete the operation. |
-10084 | Connection aborted; the connection was aborted. |
-10085 | Connection reset; the connection was reset. |
-10086 | Connection refused; no connection could be made. |
-10087 | No such host; the host does not exist. |
-10088 | Address already in use; the address is already in use. |
-10089 | No such process; no such process exists. |
-10090 | Cannot assign requested address; the address cannot be assigned. |
-10091 | Network unreachable; network cannot be reached. |
-10092 | Network down; the network is down. |
-10093 | Operation timed out; the operation timed out. |
-10094 | Network unreachable; the network is unreachable. |
-10095 | Network reset; the network connection was reset. |
-10096 | Protocol not available; the protocol is not available. |
-10097 | No buffer space available; not enough buffer space available. |
-10098 | Network unreachable; cannot reach the network. |
-10099 | Network reset; network connection was reset. |
-100100 | Connection refused; connection was refused by the peer. |
-100101 | Connection aborted; the connection was aborted. |
-100102 | Connection reset by peer; the connection was reset by the peer. |
-100103 | Connection timed out; the connection attempt timed out. |
-100104 | Connection refused; the connection was refused. |
-100105 | No buffer space available; insufficient buffer space available. |
-100106 | Address family not supported; the address family is not supported. |
-100107 | Protocol family not supported; the protocol family is not supported. |
-100108 | Protocol not supported; the protocol is not supported. |
-100109 | Network unreachable; the network cannot be reached. |
-100110 | No route to host; no route to the specified host. |
-100111 | Host is down; the remote host is down. |
-100112 | Network reset; network connection was reset. |
-100113 | Network unreachable; the network is unreachable. |
-100114 | No buffer space available; insufficient buffer space available. |
-100115 | Network down; the network is down. |
-100116 | Network unreachable; the network cannot be reached. |
-100117 | Address already in use; the address is already in use. |
-100118 | Connection refused; the connection was refused. |
-100119 | Address family not supported; the address family is not supported. |
-100120 | Protocol not supported; the protocol is not supported. |
-100121 | No buffer space available; no buffer space available. |
-100122 | Network down; network is down. |
-100123 | Network reset; network connection was reset. |
-100124 | Address family not supported; the address family is not supported. |
-100125 | Protocol family not supported; the protocol family is not supported. |
-100126 | Address already in use; address is already in use. |
-100127 | Connection refused; connection was refused by the peer. |
-100128 | Connection reset by peer; connection was reset by the peer. |
-100129 | No buffer space available; insufficient buffer space available. |
-100130 | Network unreachable; network cannot be reached. |
-100131 | Network down; the network is down. |
-100132 | Protocol family not supported; the protocol family is not supported. |
-100133 | Address already in use; address is already in use. |
-100134 | Connection refused; connection was refused. |
-100135 | Network reset; network connection was reset. |
-100136 | Network unreachable; the network is unreachable. |
-100137 | Address family not supported; the address family is not supported. |
-100138 | Protocol not supported; the protocol is not supported. |
-100139 | Connection aborted; connection was aborted. |
-100140 | Connection reset by peer; the connection was reset by the peer. |
-100141 | Network down; the network is down. |
-100142 | Network unreachable; network cannot be reached. |
-100143 | Address already in use; the address is already in use. |
-100144 | Connection refused; the connection was refused. |
-100145 | Network reset; network connection was reset. |
-100146 | No buffer space available; no buffer space available. |
-100147 | Address family not supported; the address family is not supported. |
-100148 | Protocol family not supported; the protocol family is not supported. |
-100149 | Protocol not supported; the protocol is not supported. |
-100150 | Network down; the network is down. |
-100151 | Network unreachable; network cannot be reached. |
Conclusion
SQL and network error codes are crucial for diagnosing and resolving issues in database systems and network communications. By understanding these codes, you can effectively troubleshoot problems and maintain the health of your systems.