Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1786

Implement Oracle <12g support of limit/offset query syntax

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.11.0
    • None
    • jdbc-adapter
    • None

    Description

      Currently Calcite supports only two kinds of limit/offset SQL query syntax:

      If in DB dialect supportsOffsetFetch == false, syntax is

      LIMIT 20 OFFSET 10

      If supportsOffsetFetch == true, syntax is

      OFFSET 10 ROWS FETCH NEXT 20 ROWS ONLY

      Oracle dialect uses the later syntax and it works perfectly fine for Oracle 12g
      But Oracle before 12g version does not support this syntax, as well as LIMIT/OFFSET syntax.

      Oracle query for older Oracle version should look like:

      SELECT * FROM (original query)
      WHERE ROWNUM > 10 AND ROWNUM <= 20
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ssimonov Sergiy Simonov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: