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

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

  1. Hi this Code works fine Thanx..I have ssh connection to a srever which has Sybase in it.I tried connecting to the database using isql in the same srever and it works.I tried connecting to the database after forwarding the port to my local machine it states login failed need suggestion on this to move forward.. -Connected to SSH srever[xxx.xxx.xxx.xxx]localhost:5655 -> xxxx.xxx.xxx.xxx:5025Port ForwardedEstablishing connection to java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s).Closing SSH Connection –

Leave a Reply

Your email address will not be published. Required fields are marked *