【发布时间】:2016-09-02 16:19:00
【问题描述】:
informatica power center中的IIF和DECODE函数有什么区别。
【问题讨论】:
标签: informatica informatica-powercenter
informatica power center中的IIF和DECODE函数有什么区别。
【问题讨论】:
标签: informatica informatica-powercenter
Decode 可用于Select 语句,而IIF 不能用于Select 语句。
【讨论】:
据我所知,如果我找到第一个匹配项,Decode 将停止进一步查找,IIF 将完成搜索直到结束
你也可以在 select 子句中使用 Decode
【讨论】:
首先,DECODE 为您提供比嵌套 IIF 更简洁的代码。此外,在这些情况下效率更高。
【讨论】:
解码
查找列值并根据表达式生成结果
Syntax: DECODE (Column_name or ‘Value’, Search1, Result1, Search2, Result2, ….., Default)
Argument Mandatory/Optional Description
Column_name or Value Mandatory Value that is to be passed to the function
Search Mandatory Argument that is to be searched
Result Mandatory Result for the search value
Default Optional Default value in case of search does not
Example1: DECODE (ID, 1, ‘US
3, ‘Australia’, ‘None’)
Input Data: ID Value
1 US
2 UK
3 Australia
4
Africa
Output Data: ID Value
1 US
2 None
3 Australia
4 None
None
**
查找列值并根据表达式生成结果
【讨论】: