- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the purpose of “NOT NULL WITH DEFAULT” clause used in DB2 table column?
When we define the DB2 table, we can declare any column as “NOT NULL” which means that in any case this column cannot store NULL value.
Now if we try to store a NULL value in this column in our COBOL-DB2 program using -1 value in the NULL indicator then our query will fail. In this case the SQLCODE field of SQLCA will give the error code as -407. As per the IBM documentation -407 error code states that−
“AN UPDATE, INSERT, OR SET VALUE IS NULL, BUT THE OBJECT COLUMN CANNOT CONTAIN NULL VALUES”.
- Related Articles
- Insert default into not null column if value is null in MySQL?
- What is the purpose and usage of “WHERE CURRENT OF” clause in a COBOL-DB2 program?
- What is the purpose and usage of “FOR UPDATE OF” clause in a COBOL-DB2 program
- Create a column on my table that allows null but is set by default to empty (not null)?
- Adding a column whose value is not null by default in MySQL?
- What is the result of count function in the NULL value present in DB2 table?
- What is NULL check and insertion rule in a DB2 table?
- How to store a NULL value in a particular column of a DB2 table using COBOL-DB2 program?
- What is the usage and purpose of DCLGEN and host variables used in COBOL-DB2 program
- What will happen if a NULL value is detected for a SQL statement in COBOL-DB2 program and the NULL indicator is not used?
- What happens when we apply NOT NULL constraint, with ALTER TABLE statement, to a column contains NULL values?
- What is the purpose of a default constructor in Java?
- What is the purpose of the "FOR UPDATE OF" clause in a cursor? What will happen if we fire an UPDATE statement without using this clause in a COBOL-DB2 program?
- Adding a new NOT NULL column to an existing table with records
- What is the significance of ACCESSTYPE and INDEXONLY column of a PLAN table in DB2?

Advertisements