3 Replies Latest reply: Apr 17, 2015 12:05 PM by Massimo Grossi RSS

    using where exists() on sql load

    Finn De Wit

      Hi,

      i have a small problem with "where exists" and a sql load and did not find existing solutions while searching the community. Where existst works fine with qvd containers or resident loads, but seems not to work with external sql sources.

       

      my goal is to limit a load from a qvd container and then limit the load form a sql database by a field from the previous qvd load.

       

      customers:

      LOAD

      CU_ID,

      firstname,

      lastname,

      company,

      areacode,

      createdate

      FROM

      $(vQVDstore)customers.qvd

      (qvd)

      where createdate>=20100101

      ;

       

      ORDERS:

      SQL SELECT * FROM DB."customer_orders"

      where exists (CU_ID)

      ;

       

      All i gt is an error. where exist works with other loads and SQL supports where exists like in this example:

       

      SELECT *

      FROM suppliers

      WHERE EXISTS (SELECT *

                    FROM orders

                    WHERE suppliers.supplier_id = orders.supplier_id);

       

      I will appreciate any help or suggestions, thank you

        • Re: using where exists() on sql load
          Massimo Grossi

          where exists (select * from ......) is a valid sql syntax (subquery)

           

          where exists (CU_ID) isn't a valid sql syntax

          you are making a mix between sql syntax and qlikview syntax trying to ask to the database server to check  for a valid CU_ID (field of a QlikView in memory db)

           

          I think it could be

          ORDERS:

          load * where where exists (CU_ID);

          SQL SELECT * FROM DB."customer_orders";

           

          the SQL ....... read all the table from the dbms

          the load filter CU_ID in QlikView