Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-1576

Extend the CASE expression syntax for "simple case"

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 10.11.1.1
    • SQL
    • 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

      Attachments

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

        Issue Links

          Activity

            People

              knutanders Knut Anders Hatlen
              chdh@inventec.ch Christian d'Heureuse
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: