DB2 SQL0407N : Assignment of a NULL value to a NOT NULL column “TBSPACEID=2, TABLEID=26, COLNO=0” is not allowed.

SQL0407N Assignment of a NULL value to a NOT NULL column name is not allowed.

If you encounter this error and If the value for name is of the form “TBSPACEID=n1, TABLEID=n2, COLNO=n3”, 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 = 2 AND  T.TABLEID = 26 AND  C.COLNO = 0 AND
C.TABSCHEMA = T.TABSCHEMA AND  C.TABNAME = T.TABNAME