Can a unique index have more than one null value? If not,
what error code is given if an attempt is made to insert
more than one null value?

Answers were Sorted based on User's Feedback



Can a unique index have more than one null value? If not, what error code is given if an attempt i..

Answer / mani

Unique index can have null values and no null value is equal
to another null value.

i don't know if it raises an error or not when you insert a
null value.
Null value acceptance in the column is again based on the
definition given for the column whether it can accept null
values or not.

Is This Answer Correct ?    5 Yes 2 No

Can a unique index have more than one null value? If not, what error code is given if an attempt i..

Answer / sri

Null value will allow only one null (That is maximum) as
per DB2 stds. If we try to insert more we get error -305.

Is This Answer Correct ?    2 Yes 5 No

Can a unique index have more than one null value? If not, what error code is given if an attempt i..

Answer / ratheesh

No. A SQLCODE of -803 (duplicate insert) will be returned.

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More DB2 Interview 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.

0 Answers  


What is query for your birthday date should be in hours,minute and seconds format?

1 Answers   Fidelity,


What keyword does an SQL SELECT statement use for a string search?

2 Answers  


What is the cobol picture clause of the db2 data types date, time, timestamp?

0 Answers  


I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?

3 Answers  


What is data manager?

0 Answers  


What is the difference between drop table and delete table?

0 Answers  


What is sqlca?

0 Answers  


What is a Resource Control Table(RCT)? Describe its characteristics.

3 Answers  


How to get Top 10 Salaries from a Table

11 Answers   Accenture, HTC,


Return code 100 means?

6 Answers   Cap Gemini,


What is the difference between dbm cfg and db cfg file in db2 ?

0 Answers   MCN Solutions,


Categories