top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What the decode function do in the update flag port in informatica?

+2 votes
551 views

I'm new to Informatica and like to ask a question regarding infa ports. I found an example which show how to create an update flag in expression transform for updating data. The code in v_UPDATE_FLAG port looks like this:

IIF(NOT ISNULL(PREV_ITEM_KEY)
AND
(
DECODE(BONUS_FLAG,PREV_BONUS_FLAG,1,0) = 0 
OR
DECODE(DISCOUNT,PREV_DISCOUNT,1,0) = 0 
OR
DECODE(PRICE,PREV_PRICE,1,0) = 0 
),'TRUE','FALSE'

)

Can anyone explain what this does? What the DECODE does here??

DECODE(BONUS_FLAG,PREV_BONUS_FLAG,1,0) = 0 
posted Mar 24, 2014 by Madhavi Kumari

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

DECODE syntax:

DECODE (
  value
, first_search  , first_result 
, second_search , second_result
, ...           , ...
                , default
)

The value parameter is compared with the search parameters and, when the first match is found, a respective result parameter is returned. If there is no match, the default parameter is returned.

DECODE(BONUS_FLAG,PREV_BONUS_FLAG,1,0) = 0 means that the BONUS_FLAG and PREV_BONUS_FLAG are not equal.

The entire expression flags a row for UPDATE when PREV_ITEM_KEY is not NULL and any of the attributes BONUS_FLAG, DISCOUNT or PRICE has changed (previous value versus current value).

answer Mar 24, 2014 by Shweta Singh
Similar Questions
0 votes

I'm new to Informatica and like to ask a question regarding infa ports. I found an example which show how to create an update flag in expression transform for updating data. The code in v_UPDATE_FLAG port looks like this:

IIF(NOT ISNULL(PREV_ITEM_KEY)
AND
(
DECODE(BONUS_FLAG,PREV_BONUS_FLAG,1,0) = 0 
OR
DECODE(DISCOUNT,PREV_DISCOUNT,1,0) = 0 
OR
DECODE(PRICE,PREV_PRICE,1,0) = 0 
),'TRUE','FALSE')

Can you explain what this does? What the DECODE does here??

DECODE(BONUS_FLAG,PREV_BONUS_FLAG,1,0) = 0 
0 votes

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.

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

Thanks much for your help

+1 vote

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.

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

Thanks much for your help!

+1 vote

Could anyone help me with writing case statements in Informatica PowerCenter Designer? What I feel is that 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.

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

...