Learn it on Mainframe Path. Do it with Mainframe KIT.Learn on Mainframe Path ▸
Mainframe KIT ● Nothing leaves this tab

Db2 for z/OS SQLCODEs

Negative and positive SQLCODEs with causes and fixes. 39 codes, most common first.

Printable cheat sheet of these codes ▸

39 CODES

-805NEGATIVE SQLCODEPackage not found in planAn application used a package that Db2 could not find in the plan.-803NEGATIVE SQLCODEDuplicate values would violate a unique indexAn insert or update would create duplicate values in columns that a unique index, primary key, unique constraint or hash key requires to be unique.-551NEGATIVE SQLCODEAuthorization ID lacks the privilege for the operationThe authorization IDs or roles checked were not authorized to perform the named operation on the named object.-818NEGATIVE SQLCODELoad module and package timestamps differThe precompiler timestamp in the application load module does not match the bind timestamp stored from the DBRM, so the SQL statement cannot run.-532NEGATIVE SQLCODEDelete restricted by a referential constraintA DELETE failed because a dependent row exists in a relationship with a RESTRICT or NO ACTION delete rule, directly or through a cascade.-180NEGATIVE SQLCODEDatetime value is invalidThe length or string form of a DATE, TIME or TIMESTAMP value does not match any valid format.-302NEGATIVE SQLCODEInput variable or parameter invalid or too largeA host variable or parameter value is invalid or too large for the column or target value it is assigned to.-530NEGATIVE SQLCODEForeign key value invalidAn insert or update put a value in a foreign key that does not equal any parent key value in the parent table.-181NEGATIVE SQLCODEDatetime string not validThe string form of a datetime value is out of range or in the wrong format.-303NEGATIVE SQLCODEData types not compatible for assignmentA value could not be assigned to an output variable because the variable's data type is not compatible with the source value's type.-923NEGATIVE SQLCODEConnection not establishedThe connection to Db2 failed.+100POSITIVE SQLCODE (INFORMATIONAL)Row not found or end of dataNo row was found: an empty result, nothing matching an UPDATE or DELETE, or a FETCH past the last row.+304POSITIVE SQLCODE (WARNING)Value does not fit the host variableA FETCH or SELECT could not return a value because the host variable is too small.+802POSITIVE SQLCODE (WARNING)Arithmetic exception during an operationAn arithmetic operation or built-in function failed on one expression.+551POSITIVE SQLCODE (WARNING)Authorization missing for the object or operationAt bind time the authorization ID lacked a privilege, or the object was missing or read-only; the package is still created and the statement is bound at each run.-204NEGATIVE SQLCODEUndefined nameThe object named in the message is not defined in the Db2 subsystem.-407NEGATIVE SQLCODENull assigned to a NOT NULL columnA NULL was assigned to a NOT NULL column, or a NOT NULL column without a default was left out of the INSERT or view.-440NEGATIVE SQLCODENo routine found for the name and argumentsDb2 could not resolve a routine call, including its argument list, to an authorized routine definition.-504NEGATIVE SQLCODECursor name is not declaredA statement refers to a cursor that has not been declared or allocated, or that was deallocated or is out of scope.-905NEGATIVE SQLCODEResource limit exceededThe statement was stopped because a resource limit, such as ASUTIME CPU time, was exceeded.-922NEGATIVE SQLCODEAuthorization failureAuthorization failed while connecting to Db2; the error type and reason code say which check failed.-927NEGATIVE SQLCODELanguage interface called while not connected to Db2A Db2 program was run without the correct execution environment or without the right language interface module.-104NEGATIVE SQLCODEIllegal symbol in SQL statementDb2 hit a symbol it did not expect while reading the SQL statement.-901NEGATIVE SQLCODEUnsuccessful execution due to a system errorA system error stopped this one SQL statement from running.-206NEGATIVE SQLCODEName not valid in the context where it is usedA name is used where it is not valid, most often a column that is not in any table or view referenced by the statement.-305NEGATIVE SQLCODENull value fetched with no indicator variable (SQLSTATE 22002)A FETCH, SELECT INTO, VALUES INTO or SET assignment returned NULL for a host variable that has no indicator variable, so the statement fails.-311NEGATIVE SQLCODEHost variable length negative or too largeAn input host string variable had a length that was negative or above the allowed maximum, so the statement could not run.-122NEGATIVE SQLCODEColumn or expression in the select list is not validA select list mixes plain columns or expressions with grouping, but they are not all covered by GROUP BY, so Db2 rejects the statement.-503NEGATIVE SQLCODEColumn cannot be updated: not in the cursor's FOR UPDATE clauseA positioned UPDATE through a cursor named a column that the cursor's FOR UPDATE clause did not list, so no data was changed.-508NEGATIVE SQLCODECursor is not positioned on a row that can be updated or deletedUPDATE or DELETE WHERE CURRENT OF ran while the cursor was not on a row of the table, so nothing was changed.-788NEGATIVE SQLCODESame target row identified more than once in a MERGEIn a MERGE, one row of the target table matched several rows of the source, so it would be changed more than once and Db2 stops the statement.-811NEGATIVE SQLCODESQLSTATE 21000An embedded SELECT, a subselect in an UPDATE SET clause, or a basic-predicate subquery returned more than one row or value.-911NEGATIVE SQLCODESQLSTATE 40001The unit of work was rolled back after being the victim of a deadlock or a timeout.-913NEGATIVE SQLCODESQLSTATE 57033The statement failed because the application was the victim of a deadlock or experienced a timeout.-904NEGATIVE SQLCODESQLSTATE 57011The SQL statement failed because a resource it needs was unavailable; the reason code says which and why.-501NEGATIVE SQLCODESQLSTATE 24501A FETCH or CLOSE named a cursor that is not open.-433NEGATIVE SQLCODESQLSTATE 22001A value had to be cut short by a built-in cast or adjustment function, and truncation is not allowed where that value is used.-552NEGATIVE SQLCODESQLSTATE 42502An authorization ID attempted an operation it has not been granted the authority to perform.-30040NEGATIVE SQLCODESQLSTATE 57012A statement or command needed a non-RDB resource that was unavailable; later commands and statements are not affected.