Monday, March 19, 2012

SQL0407N : Assignment of a NULL value to a NOT NULL column “TBSPACEID=4, TABLEID=15, COLNO=1″ is not allowed

If this error is encountered, you can determine the table name and column name using the following query:

SELECT
C.TABSCHEMA, C.TABNAME, C.COLNAME
FROM SYSCAT.TABLES AS T, SYSCAT.COLUMNS AS C
WHERE T.TBSPACEID = 4
AND T.TABLEID = 15
AND C.COLNO = 1
AND C.TABSCHEMA = T.TABSCHEMA
AND C.TABNAME = T.TABNAME;