5 Replies Latest reply: Jan 2, 2017 1:42 AM by Lakshmikandh Karthikeyan RSS

    sql

    Fabio Mazzarelli

      Hi Community,

      only a question

      If I create a sql script and I run it on Windows platform (sql management studio) implementation goes smoothly.

      I copy/paste the script to the editor qlik, I run but the execution is not successful.

      Question:

      Is there a difference in the writing of commands between Windows and sql sql  "" qlik ?

       

      Example:

      I need to creat a view

      sql

      with

      viag ( a, b, c, d, e, f)

      as (

           select a, b, c, d, e, f

                  from as400.library."xxxxxxx"

                  where

                  (a <> b or c <> d or e <> f)

      union all

           select a, b, c, d, e, f

            from as400.library."xxxxxxx"

      )    

        • Re: sql
          Andrey Khoronenko

          Expression SQL SELECT by programm Qlik  is interpreted by the ODBC or OLE DB driver, so depending on the capabilities of ODBC or OLE DB driver may arise from deviation in common SQL syntax.

          • Re: sql
            S Satti

            Hi Fabio,

             

            Before writing a script You should take a connection with Database.

             

            and one more thing  some functions Syntax Is Different In Qlikview.

             

            Try to use concatenate  key word in between two query.

             

            Regards

            Sathish

            • Re: sql
              Fabio Mazzarelli

              Hi,

              odbc connection is ready.

              I'm using it normally but if I try to add a view, it doesn't work

              • Re: sql
                Massimo Grossi

                I think you miss the select statement at the end

                This is an example I tried on a sql server db from Qlikview script and it works

                 

                SQL

                with cte (id_data, dat_data)

                as

                (

                SELECT id_data, dat_data FROM "sisim_stat".."d003_date"

                union all

                SELECT id_data, dat_data FROM "sisim_stat".."d003_date"

                )

                select * from cte;

                  • Re: sql
                    Lakshmikandh Karthikeyan

                    directly try this

                     

                    SQL select a, b, c, d, e, f

                                from as400.library."xxxxxxx"

                                where

                                (a <> b or c <> d or e <> f)

                    union all

                         select a, b, c, d, e, f

                          from as400.library."xxxxxxx"