SSIS NULL Conditional Separator

I need to determine if one of the two values ​​is null, and if not, are they different.

The condition that I have in my partition is

(ISNULL(ModuleLevelId) && !ISNULL(LEV_CODE)) || (!ISNULL(ModuleLevelId) && ISNULL(LEV_CODE)) || (ISNULL(LEV_CODE) ? 0 - ModuleLevelId : (DT_I4)LEV_CODE) != ModuleLevelId 

but they tell me that my expression leads to zero, that is, to a non-Boolean condition.

Can someone help me write a condition that will work?

Thank you very much

Patrick

+4
source share
1 answer
 (ISNULL(ModuleLevelId) && !ISNULL(LEV_CODE)) || (!ISNULL(ModuleLevelId) && ISNULL(LEV_CODE)) || ((ISNULL(LEV_CODE) ? 0 - ModuleLevelId :(DT_I4)LEV_CODE) != ModuleLevelId) 

I think you need to surround your third term:

  (ISNULL(LEV_CODE) ? 0 - ModuleLevelId :(DT_I4)LEV_CODE) != ModuleLevelId 

with(). I think the expression engine does not properly handle it as

 ((ISNULL(ModuleLevelId) && !ISNULL(LEV_CODE)) || (!ISNULL(ModuleLevelId) && ISNULL(LEV_CODE)) || (ISNULL(LEV_CODE) ? 0 - ModuleLevelId :(DT_I4)LEV_CODE)) != ModuleLevelId 

or (Boolean || Boolean || INT)! = INT

when you want (Boolean || Boolean || Boolean)

Try the topmost code in this answer.

+4
source

Source: https://habr.com/ru/post/1435097/


All Articles