SQLSTATE Codes

There are two classes of SQLSTATE (reason codes)- WARNING and ERROR. Each is accompanied by three message tokens, two of which DB2 provides, and the third, which is provided by QMF. The first token is the routine or function name (for example, APPL_AUTHNAMES). The second token is the specific name (for example, DSQABA1E_F1C). The third token is provided by QMF.

Here is an example of an error from the user defined function table using DB2's SPUFI query interface:

----------------------------------------------------------------------
SELECT * FROM TABLE( Q.APPL_AUTHNAMES('A A1 1B C') ) AS U;    00010004

---------------------------------------------------------------------- AUTHNAME NAMEKIND ---------------------------------------------------------------------- DSNE610I NUMBER OF ROWS DISPLAYED IS 0 DSNT408I SQLCODE = -443, ERROR: EXTERNAL FUNCTION APPL_AUTHNAMES (SPECIFIC NAME DSQABA1E_F1C) HAS RETURNED AN ERROR SQLSTATE WITH DIAGNOSTIC TEXT DSQABA1E-PARM 1 ERROR-"1", 6 DSNT418I SQLSTATE = 3810G SQLSTATE RETURN CODE DSNT415I SQLERRP = DSNXRRTN SQL PROCEDURE DETECTING ERROR DSNT416I SQLERRD = -891 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION DSNT416I SQLERRD = X'FFFFFC85' X'00000000' X'00000000' X'FFFFFFFF' X'00000000' X'00000000' SQL DIAGNOSTIC INFORMATION

Table 1. Warning SQLSTATE associated with SQLCODE +462
Reason code (SQLSTATE) (3rd message token) Description
01H01 DATA TRUNCATED, 11111
  • The length of an authorization name obtained from DB2 was longer than expected.
  • The data value returned by a FETCH was truncated.
  • The original length is specified by 11111.
01H02 PARM n TRUNCATED
  • The length of a data value is longer than the result parameter provided for the function registered with DB2.
  • It is likely that a function registration intended for an earlier DB2 version is still active. It should be discarded and reinstalled.
  • The parameter number with the truncated data is provided by n.
01H03 DATA TRUNCATED, pcsxx
  • One or more authorization names obtained from DB2 were truncated in the OUTPUT parameters of the stored procedure call.
  • The reason code (pcsxx) indicates which parameter(s) were affected:
    • 1- - - - : Primary ID
    • - 1 - - -: Current SQLID
    • - - 1xx: Secondary ID where xx is the hex number index of the first secondary ID that was truncated.
Table 2. Error SQLSTATE, associated with SQLCODE -463
Reason code (SQLSTATE) (3rd) message token Description
38105 INVALID SPECIFIC NAME VALUE
  • The external program encountered an invalid (non-supported) specific name parameter value.
  • Ensure that the DB2 registration is not in error.
  • Check the specific name and external name options.
38106 UNKNOWN DB2SQL PARAMETERS The external program encountered unrecognized parameters passed by DB2. Contact IBM service.
38107 TOO MANY PARAMETERS
  • The external program encountered more data parameters than expected.
  • Ensure that the DB2 registration is not in error.
  • Check the parameter-declaration and the RETURNS specification.
38108 TOO FEW PARAMETERS
  • The external program encountered fewer data parameters than expected.
  • Ensure that the DB2 registration is not in error.
  • Check the parameter-declaration and the RETURNS specification.
38109 MISSING FINAL CALL OPITON
  • The external program did not find a CALL type parameter as expected.
  • Ensure that the DB2 registration is not in error.
  • Verify the FINAL CALL option is specified correctly.
3810A FINAL CALL INVALID
  • The external program found a CALL type parameter when none was expected.
  • Ensure that the DB2 registration is not in error.
  • Verify the FINAL CALL option is specified correctly.
3810B FINAL CALL INVALID
  • The external program found a CALL type parameter with an unexpected value.
  • Ensure that the DB2 registration is not in error.
  • Verify the FINAL CALL option is specified correctly.
3810C MISSING SCRATCHPAD OPTION
  • The external program did not find a scratchpad parameter as expected.
  • Ensure that the DB2 registration is not in error.
  • Verify the FINAL CALL option is specified correctly.
3810D MISSING DBINFO OPTION
  • The external program did not find a DBINFO parameter as expected.
  • Ensure that the DB2 registration is not in error.
  • Verify the FINAL CALL option is specified correctly.
3810E SCRATCHPAD TOO SMALL
  • The external program detected a scratchpad area whose length is less than expected.
  • Ensure that the DB2 registration is not in error.
  • Verify the FINAL CALL option is specified correctly.
3810F PARM nn TOO SMALL
  • The external program detected a data parameter with a size or length less than expected.
  • Ensure that the DB2 registration is not in error. The parameter number is provided by nn.
  • Check the parameter-declaration and the RETURNS specification.
3810G PARM n ERROR-"c",pos
  • An input parameter has invalid content. This usually occurs when an invalid DB2 identifier is specified in the input.
  • The parameter number is provided by n. The first invalid character encountered is identified by c and occurs in the input at the position indicated by pos.
  • Correct the input error and retry. Be sure to specify valid SQL identifiers separated by blanks. The identifier might need to be specified as a delimited identifier.
3810H PTF sssssss NEEDED
  • The external program did not encounter a prerequisite DB2 level of service.
  • The required DB2 PTF number is indicated by sssssss.
  • Obtain and apply the prerequisite service before retrying.
3810I DSNWLI ERROR xxxxxxxx
  • The external program received an unexpected response from DSNWLI.
  • The DSNWLI reason code is provided by xxxxxxxx.
  • Refer to DB2 Messages and Codes for an explanation and suggested action.
3810J VALUE TOO LONG, c,pos
  • An input parameter has specified a DB2 identifier that is too long for the current DB2 context.
  • The parameter number is provided by n. The first character that exceeds the maximum length permitted is c, the position indicated by pos.
  • Correct the input error and retry. Be sure to specify valid SQL identifiers separated by blanks.
3810K CALL ERROR, nnnnnnnn
  • The external program encountered an unsupported CALL type request from DB2.
  • The CALL type value is indicated by nnnnnnnn.
  • Contact IBM service.
3810L DATA ERROR, nnnnnnnn
  • The external program detected an unexpected situation with DB2 authorization name data.
  • The CALL type value is indicated by nnnnnnnn.
  • Contact IBM service.
3810M DATA LOSS PARM n,ppp
  • DB2 authorization name data exceeds the capacity of the external program. Data was lost.
  • The affected output parameter is indicated by n.
  • Contact IBM service.
[ Previous Page | Next Page | Contents ]