Derby
  1. Derby
  2. DERBY-5499

Document the new JDBC limit/offset escape syntax

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.9.1.0
    • Fix Version/s: 10.9.1.0
    • Component/s: Documentation
    • Labels:
      None
    • Urgency:
      Normal

      Description

      The work on DERBY-5488 adds new JDBC escape syntax for the limit/offset clauses. These should be documented, probably in the Reference Guide as a subsection of JDBC escape syntax.

      1. DERBY-5499-2.zip
        4 kB
        Kim Haase
      2. DERBY-5499-2.diff
        4 kB
        Kim Haase
      3. DERBY-5499.zip
        5 kB
        Kim Haase
      4. DERBY-5499.stat
        0.1 kB
        Kim Haase
      5. DERBY-5499.diff
        4 kB
        Kim Haase

        Issue Links

          Activity

          Hide
          Kim Haase added a comment -

          I am reading the JDBC_4.1_Supplement.html, which says that the new LIMIT escape clause "can occur in the WHERE clause of a query ..." However, the only examples given don't contain a WHERE clause:

          SELECT * FROM t
          ORDER BY a

          { LIMIT 2 }

          SELECT * FROM t
          ORDER BY a

          { LIMIT 2 OFFSET 10}

          The examples of OFFSET/FETCH FIRST clauses don't occur in WHERE clauses either. What am I misunderstanding? Is there an implicit WHERE clause?

          Show
          Kim Haase added a comment - I am reading the JDBC_4.1_Supplement.html, which says that the new LIMIT escape clause "can occur in the WHERE clause of a query ..." However, the only examples given don't contain a WHERE clause: SELECT * FROM t ORDER BY a { LIMIT 2 } SELECT * FROM t ORDER BY a { LIMIT 2 OFFSET 10} The examples of OFFSET/FETCH FIRST clauses don't occur in WHERE clauses either. What am I misunderstanding? Is there an implicit WHERE clause?
          Hide
          Rick Hillegas added a comment -

          Hi Kim,

          Thanks for catching that blooper. The limit/offset escape clause can appear wherever the OFFSET and FETCH FIRST clauses can appear. You are right, those clauses do not appear in the WHERE clause. Instead, they appear after the WHERE clause and after the ORDER BY clause. Sorry for the confusion. Thanks.

          Show
          Rick Hillegas added a comment - Hi Kim, Thanks for catching that blooper. The limit/offset escape clause can appear wherever the OFFSET and FETCH FIRST clauses can appear. You are right, those clauses do not appear in the WHERE clause. Instead, they appear after the WHERE clause and after the ORDER BY clause. Sorry for the confusion. Thanks.
          Hide
          Kim Haase added a comment -

          Whew, thanks for the sanity check, Rick. Attaching DERBY-5499.diff, DERBY-5499.stat, and DERBY-5499.zip, with changes as follows:

          A src/ref/rrefjdbclimit.dita
          M src/ref/rrefjdbc1020262.dita
          M src/ref/refderby.ditamap

          Hope the terminology is not too far off. Thanks in advance for edits.

          Show
          Kim Haase added a comment - Whew, thanks for the sanity check, Rick. Attaching DERBY-5499 .diff, DERBY-5499 .stat, and DERBY-5499 .zip, with changes as follows: A src/ref/rrefjdbclimit.dita M src/ref/rrefjdbc1020262.dita M src/ref/refderby.ditamap Hope the terminology is not too far off. Thanks in advance for edits.
          Hide
          Rick Hillegas added a comment -

          Thanks for the patch, Kim. It looks good.

          I stumbled over one small issue in the first paragraph under "Syntax". That paragraph repeats some material about FETCH NEXT from the functional spec. That material only makes sense to me if it is preceded by the explanation which appears under "Equivalent to". I would either move the "Equivalent to" material higher up or I would reword this paragraph to something like this:

          "The rowCount is a non-negative integer that specifies the number of rows to return. If rowCount is 0, then all rows from startRow forward are returned."

          Thanks,
          -Rick

          Show
          Rick Hillegas added a comment - Thanks for the patch, Kim. It looks good. I stumbled over one small issue in the first paragraph under "Syntax". That paragraph repeats some material about FETCH NEXT from the functional spec. That material only makes sense to me if it is preceded by the explanation which appears under "Equivalent to". I would either move the "Equivalent to" material higher up or I would reword this paragraph to something like this: "The rowCount is a non-negative integer that specifies the number of rows to return. If rowCount is 0, then all rows from startRow forward are returned." Thanks, -Rick
          Hide
          Kim Haase added a comment -

          Thanks, Rick! I was wondering about that wording problem, too. Since the "Equivalent to" section makes this topic parallel with others, I adopted your suggested rewording. I'm attaching DERBY-5499-2.diff and DERBY-5499-2.zip, with that change.

          Thanks for reviewing this.

          Show
          Kim Haase added a comment - Thanks, Rick! I was wondering about that wording problem, too. Since the "Equivalent to" section makes this topic parallel with others, I adopted your suggested rewording. I'm attaching DERBY-5499 -2.diff and DERBY-5499 -2.zip, with that change. Thanks for reviewing this.
          Hide
          Rick Hillegas added a comment -

          Thanks, Kim. Looks great. +1

          Show
          Rick Hillegas added a comment - Thanks, Kim. Looks great. +1
          Hide
          Kim Haase added a comment -

          Thanks again, Rick!

          Committed patch DERBY-5499-2.diff to documentation trunk at revision 1307003.

          Show
          Kim Haase added a comment - Thanks again, Rick! Committed patch DERBY-5499 -2.diff to documentation trunk at revision 1307003.
          Hide
          Kim Haase added a comment -

          Changes have appeared in Latest Alpha Manuals.

          Show
          Kim Haase added a comment - Changes have appeared in Latest Alpha Manuals.
          Hide
          Kim Haase added a comment -

          Reopening to add fix version.

          Show
          Kim Haase added a comment - Reopening to add fix version.
          Hide
          Kim Haase added a comment -

          Fix version added.

          Show
          Kim Haase added a comment - Fix version added.

            People

            • Assignee:
              Kim Haase
              Reporter:
              Rick Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development