2 Replies Latest reply: Nov 9, 2012 9:34 AM by Jonathan Dienst RSS

    Loading a selection from a database based upon whats already loaded.

      Hello I have a database I wish to use to create some data associations which are only held within the DB. I am having problems using the 'where exists Clause'  as it tells me that the tables dont exist after the database loads. Here is the code I am using as an example.


      Also please see attached.




      Customer_Table :


      OLEDB CONNECT32 TO [Provider=Microsoft.Jet.OLEDB.4.0; etc etc


      LOAD *,
      LEFT([Client Reference],10) AS BP;
      SQL SELECT `Client Reference`,
      FROM `Water_Append_Output`
      where exists(BP,LEFT([Client Reference],10))

      LOAD BP,
          min(pc_mosaic_public_sector_type) as Type
      Resident Mosiac_raw
      Group By BP;

      inner Join(Mosaic)

      LOAD BP,
      pc_mosaic_public_sector_type as Type,
          pc_mosaic_public_sector_group_alpha & num(pc_mosaic_public_sector_type,'00') as Code
      Resident Mosiac_raw;

      drop Table Mosiac_raw;