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

Reference manual says ELSE clause is required in CASE expressions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.10.2.0
    • 10.11.1.1
    • Documentation
    • None

    Description

      The reference manual topic on the CASE expression says the syntax is

      CASE 
        WHEN booleanExpression THEN thenExpression 
        [ WHEN booleanExpression THEN thenExpression ]*
        ELSE elseExpression 
      END
      

      The ELSE clause is optional and should be in square brackets, as seen by this example:

      ij> values case when (1<>1) then 'yes' end;
      1   
      ----
      NULL
      
      1 row selected
      

      This seems to comply with the SQL standard, as the syntax rules for <case expression> say that "[if] an <else clause> is not specified, then ELSE NULL is implicit."

      Attachments

        1. DERBY-6560.diff
          0.9 kB
          Camilla Haase
        2. rrefcase.html
          5 kB
          Camilla Haase

        Activity

          People

            chaase3 Camilla Haase
            knutanders Knut Anders Hatlen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: