Interview Questions   Tutorials   Discussions   Programs   

DB2 - Can a primary key have null values? If we try to insert a null value in a primary key column, will it work or give an error code?




461
views
asked mar September 10, 2014 01:18 PM  

Can a primary key have null values? If we try to insert a null value in a primary key column, will it work or give an error code?


           

1 Answers



 
answered By Mswami   0  

A primary key column cannot contain NULL values. Primary keys must contain unique values.

SQL CODE: -407 AN UPDATE, INSERT, OR SET VALUE IS NULL, BUT THE OBJECT COLUMN column-name CANNOT CONTAIN NULL VALUES.

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