RPG (IBM i / AS/400) · DB2 SQLCODE
What does SQLCODE -407 - Not Null Constraint Violation mean in RPG (IBM i / AS/400)?
An INSERT or UPDATE tried to store a NULL value into a column defined NOT NULL, usually because a host variable's null indicator was left at -1 or a required field was never populated before the statement ran.
An INSERT or UPDATE tried to store a NULL value into a column defined NOT NULL, usually because a host variable's null indicator was left at -1 or a required field was never populated before the statement ran.
Make sure every NOT NULL column gets a real value from the program, and check for stray null indicators being set to -1 on host variables that should never be null.