1 Reply Latest reply: Dec 4, 2013 8:43 AM by Friedrich Hofmann RSS

    "Piggyback LOAD" - troublesome in combination with a JOIN?

    Friedrich Hofmann

      Hi,

       

      I have just learnt about this kind of LOAD - well, I had read about it before, but I only really understood it now.

      What I mean is things like this:

       

      LOAD

               A & '|' & B as C;

      LOAD

      A,

      D,

      E as B;

      SQL SELECT

      ...

      ...

      ;

       

      This "piggyback LOAD" just replaces a field in the table that is loaded in the main LOAD statement here so you can already access the fields only  calculated in that LOAD without repeating any complicated formulas, thereby eliminating the corresp. potential for errors.

       

      <=> It seems (we just tried this out in a scenario) that this can prove troublesome when combined with a JOIN.

      => Is that so? Can someone please shed some light on this?

       

      In that scenario, there was sth. like this:

       

      [Mapping table 1]:

      MAPPING LOAD

      ...

      ...

      ;

      [Mapping table 2]:

      MAPPING LOAD

      ...

      ...

      ;

      [Main_table_1]:

      LOAD

               C,

               D,

              E

      ;

      LEFT JOIN

       

      LOAD

           A,

           B

      Applymap('[Mapping table 1]', Applymap('[Mapping table 2]'

      ...

      ;

       

      Since this did not seem to work for some mysterious reason (it had worked just like this yesterday), we tried to split that formula into two separate Applymap_commands by using suc a "piggyback load" - in the table_to_be_joined. That did not seem to work.

       

      Thanks a lot!

      Best regards,

       

      DataNibbler

       

      P.S.: Well, it seems I haven't understood it well - currently, in two instances, this replaces the entire table I have just loaded with a table that has just one field...