Search code examples
informaticainformatica-powercenter

Informatica- What is the result if the IIF condition is null?


If my Informatica code looks like this:

IIF(foo,1,0)

and foo = NULL, what would the output be?

Sorry if the answer to this is to obvious or is in a reference somewhere, but I couldn't find anything useful through googling or searching SO.


Solution

  • foo is a expression that should evaluate to either TRUE or FALSE, so here's how Integration Service interprets different integer values when they constitute the entire condition:

    IIF(  -7, 1, 0)  ->  1
    IIF(   0, 1, 0)  ->  0
    IIF(NULL, 1, 0)  ->  0
    IIF(   7, 1, 0)  ->  1
    

    All negative or positive integers yield TRUE.
    The values 0 or NULL give FALSE.