What is a NULL value? What are the pros and cons of using
NULLS?

Answer Posted / s

NULL Value indicates the absence of a value. DB2 treats
NULL as an actual value and is not equal to blank, zero or
empty string.

The default value of a CHAR data type is blanks, VARCHAR is
empty string and INT,SMALLINT,FLOAT etc is 0.
NULL is not equal to any of the above.

NULLs does not satify any condition in the SQL except when
IS NULL predicate is used. Null can be used at times when
you cannot specify a value for a column, eg middle names,
not everyone has middle names.

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to rename a table in DB2 ?

637


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.

2151


What is db2 and what is the use of db2 optimizer?

651


Hi Everyone... Under the Logical files, when am working on multiple rec format logical file, I have joined two pf's using the multiple record format logical file concept, but when i run queried the LF only the first mentioned pf records are reflecting and I am not able to see any of the field records specified under the second pf. Kindly let me know whats the reason behind this. Below is the str of LF., R rec PFILE(LOGICAA) CUSTNO CUSTNAME BILL K CUSTNO R rec1 PFILE(LOGICAA1) CUSTNO ADD K CUSTNO .....

1897


My sql statement select avg(salary) from emp yields inaccurate results. Why?

639






What is dbrm? What it contains? When it will be created?

591


What is dbrm? When it will be created?

598


What does a deadlock mean in DB2?

651


What does db2 plan contain?

573


Give the name of some fields form sqlca.

611


What is the meaning concurrency in the db2 database?

632


What are types of indexes?

593


Are views updateable?

642


What is host variable in db2 cobol?

602


How do I add a column to a table in db2?

618