Monday, 10 September 2012

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

Related Posts Plugin for WordPress, Blogger...

ShareThis