Customer Portal

N00b Question on ExtHashJoin

Comments 3

  • Avatar
    martin
    0
    Comment actions Permalink
    Hello Patrick,

    in order to see all records passed through the output based on either master or slave, in transformation you should use nvl(arg1,value) function which returns value if arg1 is NULL otherwise return arg1. Please look at example:

    function integer transform() {
    $0.key_1 = nvl($0.key_1,$1.key_1);

    return ALL;
    }

    Best regards Martin.
  • Avatar
    pwmcmaho
    0
    Comment actions Permalink
    Martin - excellent - thanks!

    How can you do that with more than one, for example, if I have three fields I am potentially merging:

    $0.fielda = $0.fielda + $1.fielda + $2.fielda

    How do I ensure that all null values are removed when concatenating?

    Thanks!!!!
  • Avatar
    avackova
    0
    Comment actions Permalink
    Hello Patrick,
    do it in the same way as in Martin's answer:
    $0.fielda = nvl($0.fielda,"") + nvl($1.fielda,"") + nvl($2.fielda,"");
    for concatenating or:

    $0.fielda = nvl($0.fielda,nvl($1.fielda,$2.fielda));
    for selecting only one (not-null) key.

Please sign in to leave a comment.