1. Derby
  2. DERBY-4513

Forbid NEXT VALUE FOR clause in certain contexts


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s:
    • Fix Version/s:
    • Component/s: SQL
    • Labels:


      This is part of the work needed to implement ANSI/ISO sequences. The functional spec attached to DERBY-712 lists various situations in which the NEXT VALUE FOR clause is illegal. These include:

      • CASE expression
      • WHERE clause
      • ORDER BY clause
      • AGGREGATE expression
      • WINDOW function
      • DISTINCT select list

      In addition, I propose that we make it illegal for a statement to have more than one NEXT VALUE FOR clause on the same sequence generator. This is a tighter restriction than the ANSI/ISO standard calls for. The standard requires that if two columns in a row are populated by NEXT VALUE FOR clauses on the same sequence, then the values should be the same. I don't feel confident that I could track down all of the cases which could give rise to this situation--so I propose to limit the number of NEXT VALUE FOR clauses on a given sequence generator to just 1.

        Issue Links


          Rick Hillegas created issue -
          Rick Hillegas made changes -
          Field Original Value New Value
          Link This issue is part of DERBY-712 [ DERBY-712 ]
          Rick Hillegas made changes -
          Assignee Rick Hillegas [ rhillegas ]
          Rick Hillegas made changes -
          Attachment derby-4513_01-aa-illegalContexts.diff [ 12435100 ]
          Rick Hillegas made changes -
          Issue & fix info [Patch Available]
          Rick Hillegas made changes -
          Attachment derby-4513_01-ab-illegalContexts.diff [ 12435447 ]
          Rick Hillegas made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Issue & fix info [Patch Available]
          Resolution Fixed [ 1 ]
          Rick Hillegas made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Rick Hillegas made changes -
          Link This issue relates to DERBY-4803 [ DERBY-4803 ]
          Kathey Marsden made changes -
          Fix Version/s [ 12313727 ]
          Gavin made changes -
          Workflow jira [ 12488035 ] Default workflow, editable Closed status [ 12800298 ]


            • Assignee:
              Rick Hillegas
              Rick Hillegas
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: