Examining functions that execute conditional retrieval

Within Oracle, we have another set of functions at our disposal that doesn't easily fit into the categories that we've seen thus far. These functions all address, to some degree, the need for if...then logic within SQL. The first two of these functions provide special ways in dealing with NULL values.

NVL()

The NULL value is an essential part of SQL. Without it, we would have no way to express the lack of a value within a row. Still, NULL values can present problems, particularly when attempting to use them with arithmetic expressions. For instance, recall an example from Chapter 2, SQL SELECT Statments, where we introduced the topic of nulls. In it, we attempted to divide the number 100 by ...

Get OCA Oracle Database 11g: SQL Fundamentals I: A Real-World Certification Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.