Derby
  1. Derby
  2. DERBY-1576

Extend the CASE expression syntax for "simple case"

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.11.1.1
    • Component/s: SQL
    • Urgency:
      Low

      Description

      The ISO/IEC 9075-2:1999 SQL standard describes two kinds of CASE expressions: "simple case" and "searched case".
      The current Derby version supports "searched case" but not "simple case".

      The syntax for "simple case" is:

      CASE Expression
      WHEN Expression THEN Expression
      [ WHEN Expression THEN Expression ]
      ...
      ELSE ElseExpression
      END

      Example:

      VALUES
      CASE 4
      WHEN 1 THEN 'one'
      WHEN 2 THEN 'two'
      WHEN 3 THEN 'three'
      ELSE 'many'
      END

      1. simple-simple.diff
        3 kB
        Knut Anders Hatlen
      2. d1576-1a.diff
        22 kB
        Knut Anders Hatlen
      3. d1576-2a.diff
        7 kB
        Knut Anders Hatlen
      4. d1576-3a.diff
        17 kB
        Knut Anders Hatlen
      5. d1576-4a.diff
        22 kB
        Knut Anders Hatlen

        Issue Links

          Activity

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Christian d'Heureuse
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development