Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SPL Statements > IF >

Conditions in an IF Statement

Just as in the WHILE statement, if any expression in the condition evaluates to NULL, then the condition cannot be true, unless you are explicitly testing for NULL using the IS NULL operator. The following rules summarize NULL values in conditions:

  1. If the expression x evaluates to NULL, then x is not true by definition. Furthermore, NOT (x) is also not true .
  2. IS NULL is the only operator that can return true for x. That is, x IS NULL is true, and x IS NOT NULL is not true.

If an expression in the condition has an UNKNOWN value from an uninitialized SPL variable, the statement terminates and raises an exception.

IF Statement List

Read syntax diagramSkip visual syntax diagramIF Statement List:
 
                                (1)
|--+-BEGIN--| Statement Block |-------END-+---------------------|
   |                              (2)     |
   +-| Subset of SPL Statements |---------+
   |                              (3)     |
   '-| Subset of SQL Statements |-------;-'
 
Notes:
  1. See Statement Block
  2. See Subset of SPL Statements Allowed in the IF Statement List
  3. See SQL Statements Not Valid in an IF Statement

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]