Problem solve Get help with specific problems with your technologies, process and projects.

Querying to get NULLs

How do I get NULL as a result of query from DB2 table, something like we have in the function isnull(fileld_name,NULL) in SQL Server?

Well, there are several functions that might be useful to you in DB2.

The IFNULL function will return the first argument that is not null.

The NULLIF function returns null if two arguments are equal; otherwise, it returns the value of the first argument.

The COALESCE function returns the first argument that is not null. VALUE can be used as a synonym for COALESCE.

For More Information

This was last published in December 2002

Dig Deeper on IBM DB2 management

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.