Informatica中的案例陈述/解码功能 [英] Case Statements/Decode Function in Informatica

查看:116
本文介绍了Informatica中的案例陈述/解码功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我在Informatica PowerCenter Designer中编写案例陈述吗?我是Informatica的新手,根据我的有限经验,我认为不支持案例陈述。有一个具有类似功能的解码功能,但是我找不到关于语法的任何好的示例。

Could anyone help me with writing case statements in Informatica PowerCenter Designer? I am fairly new to Informatica, and based on my limited experience I feel case statements aren't supported. There is a decode function with similar functionality, but I am unable to find any good examples on the syntax.

如果有人能给我一些有关如何在Informatica中使用案例语句/解码功能的具体示例,我将不胜感激。

I would really appreciate if anyone could give me some specific examples on how to use case statements/decode function in Informatica.

非常感谢您的帮助!

推荐答案

您是对的-没有 CASE 语句,但是您可以使用 DECODE 进行模拟:

You're right - there is no CASE statement, but you can use DECODE to simulate it:

DECODE( TRUE
      , DECIMAL_PORT > 0, 'positive value'
      , DECIMAL_PORT < 0, 'negative value'
                        , 'zero' )

它等效于以下Transact-SQL CASE 语句:

It is an equivalent of the following Transact-SQL CASE statement:

CASE
  WHEN DECIMAL_PORT > 0 THEN 'positive value'
  WHEN DECIMAL_PORT < 0 THEN 'negative value'
  ELSE 'zero'
END

它可以正常工作:


  • 第一个参数是硬编码的 TRUE 值,

  • 偶数参数(第二,第四等)是条件

  • 奇数个参数(第三,第五等) on)是返回值

  • 最后一个参数是默认返回值

  • 求第一个参数值的第一个条件(即第一个条件为true)确定要返回的值,

  • 如果最后一个条件都不满足参数返回。

  • the 1st parameter is a hard-coded TRUE value,
  • even parameters (2nd, 4th and so on) are the conditions,
  • odd parameters (3rd, 5th and so on) are the return values,
  • the last parameter is the default return value,
  • the first condition that evaluates to the value of the 1st parameter (i.e. the first condition that is true) determines the value that is returned,
  • if none of the conditions is met the last parameter is returned.

这篇关于Informatica中的案例陈述/解码功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆