Pages

Tuesday, March 19, 2013

Difference between Decode and IIF in Informatica?

DECODE
IIF
Decode can be used in Select statement
IIF cannot be used in a Select statement.
EXAMPLE:
DECODE(deptname,”SALES”,1,0)
—-If deptname is SALES then return 1 else return zero
EXAMPLE:IIF( GRADE > 1, IIF( GRADE < 2, SAL1, IIF( GRADE < 3, SAL2, IIF( GRADE < 4, SAL3, BONUS))), 0 )
—-If the GRADE less than ONE then return zero else return SAL1 OR SAL2 OR SAL3 OR BONUS
Decode gives better readablity to users
IIF dosenot give good readablity

No comments:

Post a Comment