6 Replies Latest reply: Aug 14, 2009 11:18 PM by greenee RSS

    How to load related data from another source

      Hello all

      I would like to know how to load data from a second ODBC source where the first load has
      extracted the ID numbers of records that I want in the second load script.

      example
      TAB_1:


      LOAD
      "Field_1" AS ID,
      "Field_2" AS ID_REF,
      "Field_1"&"Field_2" as Unique_ID,
      "Field_3" as Task_Date
      ;

      SET NULLDISPLAY='#Null';
      SQL SELECT *
      FROM ODBC."TABLE_NAME_A"
      WHERE ("Field 3" >= '01-DEC-2008')
      ;


      Then subsequently on TAB_2 I want the script to load fields where Unique_ID is equal to
      the Unique_ID's loaded in the first part of the script because Field_3 doesn't exist in
      the 2nd ODBC source and I don't want to load everything in from that table.
      A bit like a join in Access where the record are equal.
      BTW, I want the nulls to be like that so I can find data inconsistencies.

      TAB_2:

      LOAD
      "Field_1" AS ID,
      "Field_2" AS ID_REF,
      "Field_1"&"Field_2" as Unique_ID,
      ;

      SET NULLDISPLAY='#Null';
      SQL SELECT *
      FROM ODBC."TABLE_NAME_B"
      WHERE (TAB_2 "Field_1"&"Field_2" = TAB_1 "Field_1"&"Field_2")
      ;


      Thank you for any guidance and code adjustments you can give.
      Many thanks
      Greenee