Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5195

Osisoft translator - applying LIMIT on a UNION query causes syntax error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.12.11.6_4, 10.1
    • 8.12.11.6_4
    • JDBC Connector
    • None

      Query such as

      SELECT g_0.intkey FROM bqt1.smalla g_0 UNION SELECT g_1.intkey FROM bqt1.smallb g_1 LIMIT 100
      

      fails with

      [PIOLEDBENT] [SQL Parser] [Line 1:106] Syntax error at 'TOP'
      

      because it is translated as

      SELECT g_1.IntKey AS c_0 FROM dvqe..SmallA AS g_1 UNION SELECT g_0.IntKey AS c_0 FROM dvqe..SmallB AS g_0 TOP 100
      

      notice the TOP 100 at the end, instead of right after the SELECT.

            rhn-engineering-rareddy Ramesh Reddy
            asmigala@redhat.com Andrej Smigala
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: