How to resolve -407 sql code in DB2?

Answer Posted / anandrao

This error occures when you are assigning NULL value to NOT
NULL column.
You can wrap the variable with coalesce/value and default
it but it is totally dependant on business logic.

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

SET is the ANSI standard for variable assignment, SELECT is not. SET can only assign one variable at a time, SELECT can make multiple assignments at once. If assigning from a query, SET can only assign a scalar value. If the query returns multiple values/rows then SET will raise an error. SELECT will assign one of the values to the variable and hide the fact that multiple values were returned (so you'd likely never know why something was going wrong elsewhere - have fun troubleshooting that one) When assigning from a query if there is no value returned then SET will assign NULL, where SELECT will not make the assignment at all (so the variable will not be changed from it's previous value) As far as speed differences - there are no direct differences between SET and SELECT. However SELECT's ability to make multiple assignments in one shot does give it a slight speed advantage over SET.

2429


What is the physical storage length of timestamp data type?

885


What is the maximum length of sqlca?

1174


Is db2 a mainframe?

808


What is image copy in db2?

780


What is the difference between "db2ilist" and "db2 get instance" commands in DB2 Database Server?

1021


What is the role of the data page in the db2 database?

802


What is a db2 schema?

1009


What kind of database is db2?

811


What's The Error Code For Unique Index Voilation?

923


What is meant by union and union all?

813


How can deadlocks be resolved?

757


What is the picture clause of null indicator variable?

918


What is dbrm? When it will be created?

803


What is the use of runstats in db2?

830