Page 1 of 1

Unable to Insert New Record

Posted: Thu May 08, 2008 4:14 am
by cosec
Hello,

I am trying to insert 1 record to an empty table....

and when I run the job I get the following error:

DBMS.CODE=-407, SQLSTATE=23502, [IBM][CLI Driver][DB2/AIX64] SQL0407N Assignment of a NULL value to a NOT NULL column "TBSPACEID=7, TABLEID=275, COLNO=7" is not allowed. SQLSTATE=23502


But for example if the record is already in the database and i run the job with the option 'update or insert new records' the job runs successfully...

Any idea why I am not able to insert the record when the table is empty....The data does not have any null values.

Would appreciate any advice

Thanks

Posted: Thu May 08, 2008 5:46 am
by ray.wurlod
The data record DOES have a null value, in column number 7.

Posted: Fri May 09, 2008 3:57 am
by tsn
when you are performing update or insert it may be success due to there is no change in the col7. when you are trying to insert record for the first time, that too your record is having NULL value, but in the table it is mentioned as non-nullable column, so how come a NULL value will be instered into a NON-NULLABLE Column. so ensure that it is not NULL or change constraint of the col in such a way to allow NULL.