I have the following decode statement in an expression transformation in informatica:

(DECODE
(TRUE
, OPERATION1='I' and NOT ISNULL(a_new),'YES'
, OPERATION1='D'and NOT ISNULL(a_old),'YES'
, OPERATION1='U'and ( (
     (a<>b) 
  or (ISNULL(a_new) and NOT ISNULL(a_old)) 
  or (NOT ISNULL(a_new) and ISNULL(a_old))
      ) 
),'YES','NO CHANGE')
)

Where a_new and a_old are both integers (when they appear at all).

Here's the weird part:

This decode statement, when run, constantly returns a value of 0 (zero). I can't for the life of me figure out why. When I run this in the debugger and evaluate the decode (right click on the expression, click on 'evaluate expression', paste the decode in) it evaluates to either YES or NO CHANGE correctly. But when it actually runs, both in the debugger and in production, it still evaluates to zero. Does anybody know why?

有帮助吗?

解决方案

The expression looks fine to me. You should check the definition of the field that uses it. Either it is declared as integer (or some other numeric data type) or it has a default value assigned.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top