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
Reason code (SQLSTATE) | (3rd message token) | Description |
---|---|---|
01H01 | DATA TRUNCATED, 11111 |
|
01H02 | PARM n TRUNCATED |
|
01H03 | DATA TRUNCATED, pcsxx |
|
Reason code (SQLSTATE) | (3rd) message token | Description |
---|---|---|
38105 | INVALID SPECIFIC NAME VALUE |
|
38106 | UNKNOWN DB2SQL PARAMETERS | The external program encountered unrecognized parameters passed by DB2. Contact IBM service. |
38107 | TOO MANY PARAMETERS |
|
38108 | TOO FEW PARAMETERS |
|
38109 | MISSING FINAL CALL OPITON |
|
3810A | FINAL CALL INVALID |
|
3810B | FINAL CALL INVALID |
|
3810C | MISSING SCRATCHPAD OPTION |
|
3810D | MISSING DBINFO OPTION |
|
3810E | SCRATCHPAD TOO SMALL |
|
3810F | PARM nn TOO SMALL |
|
3810G | PARM n ERROR-"c",pos |
|
3810H | PTF sssssss NEEDED |
|
3810I | DSNWLI ERROR xxxxxxxx |
|
3810J | VALUE TOO LONG, c,pos |
|
3810K | CALL ERROR, nnnnnnnn |
|
3810L | DATA ERROR, nnnnnnnn |
|
3810M | DATA LOSS PARM n,ppp |
|