[ 
https://issues.apache.org/jira/browse/DERBY-1576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13985417#comment-13985417
 ] 

Knut Anders Hatlen commented on DERBY-1576:
-------------------------------------------

I don't think there's any technical reason why this hasn't been done, just that 
no one has felt strongly enough about it to actually do the work yet. You may 
be right that simple case can be implemented mostly in the parser. The simple 
case syntax in the SQL standard is somewhat more involved than what's the issue 
description, though, and allows expressions such as:

{noformat}
  CASE 'test'
     WHEN IS NULL THEN 0
     WHEN BETWEEN('abc', 'def'), LIKE 'x%', 'zzz' THEN 1
     ELSE 2
{noformat}

> Extend the CASE expression syntax for "simple case"
> ---------------------------------------------------
>
>                 Key: DERBY-1576
>                 URL: https://issues.apache.org/jira/browse/DERBY-1576
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Christian d'Heureuse
>            Priority: Minor
>              Labels: derby_triage10_11
>
> 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



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to