db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukas Eder (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (DERBY-1576) Extend the CASE expression syntax for "simple case"
Date Wed, 30 Apr 2014 09:49:16 GMT

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

Lukas Eder edited comment on DERBY-1576 at 4/30/14 9:48 AM:
------------------------------------------------------------

Hmm, apart from MS Access (which doesn't have a CASE expression at all), Derby is the only
database among the 16 databases supported by http://www.jooq.org, which doesn't support this
syntax.

Is there any particular reason why this was omitted so far? I suspect that a canonical implementation
would be merely syntactic sugar, implemented in the parser...


was (Author: lukas.eder):
Hmm, apart from MS Access (which doesn't have a CASE expression at all), Derby is the only
database among the 16 databases supported by <a href="http://www.jooq.org">jOOQ</a>,
which doesn't support this syntax.

Is there any particular reason why this was omitted so far? I suspect that a canonical implementation
would be merely syntactic sugar, implemented in the parser...

> 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)

Mime
View raw message