Interview Questions   Tutorials   Discussions   Programs   

DB2 - How to resolve -407 sql code in DB2?




364
views
asked mar August 3, 2014 05:05 AM  

How to resolve -407 sql code in DB2?


           

1 Answers



 
answered By Mswami   0  
SQl Code: -407
AN UPDATE, INSERT, OR SET VALUE IS NULL, BUT THE OBJECT COLUMN column-name CANNOT CONTAIN NULL VALUES.

Explanation:
One of the following conditions occurred:
  1. A null insert or update value was specified for a column defined as NOT NULL.
  2. A SET transition variable statement specified a NULL value for column defined as NOT NULL without the WITH DEFAULT clause in the table definition.
  3. The update or insert value was DEFAULT, but the object column was declared as NOT NULL without WITH DEFAULT in the table definition. Consequently:
    • A default value of NULL cannot be inserted into that column.
    • An update cannot set default values of NULL in that column.
    • A SET transition variable statement in a trigger cannot set default values of NULL in that column.
  4. The column name list for the INSERT statement omits a column declared NOT NULL and without WITH DEFAULT in the table definition.
  5. The view for the INSERT statement omits a column declared NOT NULL and without WITH DEFAULT in the base table definition.
  6. A null insert value was specified for a ROWID column.
System action:
The statement cannot be processed. The 'column-name' might be returned in the SQLCA, depending on the syntax of the SQL statement in which the error was detected.

Programmer response:
Examine the definition of the object table to determine which columns of the table have the NOT NULL attribute or have a type of ROWID, and correct the SQL statement accordingly.
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert