Unable to Insert New Record

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Unable to Insert New Record

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The data record DOES have a null value, in column number 7.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
tsn
Participant
Posts: 51
Joined: Wed Jan 10, 2007 1:32 am

Post 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.
with regards,
tsn
Post Reply