File: README.nullif

package info (click to toggle)
firebird2 1.5.3.4870-12
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 44,464 kB
  • ctags: 43,495
  • sloc: ansic: 380,082; cpp: 259,864; sh: 63,659; fortran: 6,818; yacc: 3,956; sql: 3,209; pascal: 733; makefile: 708; sed: 115; csh: 15
file content (23 lines) | stat: -rw-r--r-- 514 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Function:
    Return a NULL value for a sub-expression if it has a specific value 
    otherwise return the value of the sub-expression

Author:
    Arno Brinkman <firebird@abvisie.nl>

Format:

  <case abbreviation> ::=
      NULLIF <left paren> <value expression> <comma> <value expression> <right paren>


Syntax Rules:
    1) NULLIF (V1, V2) is equivalent to the following <case specification>:
         CASE WHEN V1 = V2 THEN NULL ELSE V1 END


Examples:
A)
  UPDATE PRODUCTS
    SET STOCK = NULLIF(STOCK,0)