You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (Created) (JIRA)" <ji...@apache.org> on 2011/12/24 22:10:30 UTC

[jira] [Created] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

NULLIF topic in reference manual should explain NULLIF
------------------------------------------------------

                 Key: DERBY-5557
                 URL: https://issues.apache.org/jira/browse/DERBY-5557
             Project: Derby
          Issue Type: Improvement
          Components: Documentation
    Affects Versions: 10.8.2.2
            Reporter: Knut Anders Hatlen


The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html

It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

Posted by "Kim Haase (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kim Haase reassigned DERBY-5557:
--------------------------------

    Assignee: Kim Haase
    
> NULLIF topic in reference manual should explain NULLIF
> ------------------------------------------------------
>
>                 Key: DERBY-5557
>                 URL: https://issues.apache.org/jira/browse/DERBY-5557
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Kim Haase
>
> The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html
> It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

Posted by "Knut Anders Hatlen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13251555#comment-13251555 ] 

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

Sounds like a good plan. I think it's fine to mention all three in the table under conditional expression.
                
> NULLIF topic in reference manual should explain NULLIF
> ------------------------------------------------------
>
>                 Key: DERBY-5557
>                 URL: https://issues.apache.org/jira/browse/DERBY-5557
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Kim Haase
>         Attachments: DERBY-5557.diff, rrefcasenullif.html
>
>
> The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html
> It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

Posted by "Kim Haase (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kim Haase resolved DERBY-5557.
------------------------------

          Resolution: Fixed
       Fix Version/s: 10.9.0.0
    Issue & fix info:   (was: Patch Available)

Thanks, Knut! Haven't seen a commit email after several hours, but maybe it's just me.

Committed patch DERBY-5557-2.diff to documentation trunk at revision 1325247. 

                
> NULLIF topic in reference manual should explain NULLIF
> ------------------------------------------------------
>
>                 Key: DERBY-5557
>                 URL: https://issues.apache.org/jira/browse/DERBY-5557
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Kim Haase
>             Fix For: 10.9.0.0
>
>         Attachments: DERBY-5557-2.diff, DERBY-5557-2.stat, DERBY-5557-2.zip, DERBY-5557.diff, rrefcasenullif.html
>
>
> The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html
> It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

Posted by "Kim Haase (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kim Haase updated DERBY-5557:
-----------------------------

    Issue & fix info: Patch Available
    
> NULLIF topic in reference manual should explain NULLIF
> ------------------------------------------------------
>
>                 Key: DERBY-5557
>                 URL: https://issues.apache.org/jira/browse/DERBY-5557
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Kim Haase
>         Attachments: DERBY-5557.diff, rrefcasenullif.html
>
>
> The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html
> It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

Posted by "Kim Haase (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kim Haase updated DERBY-5557:
-----------------------------

    Attachment: DERBY-5557.diff
                rrefcasenullif.html

Thanks for noticing this problem, Knut. I'm attaching DERBY-5557.diff and rrefcasenullif.html, with your suggested modification to the NULLIF topic.

Not to open a can of worms here, but I think that in SQL, NULLIF really is a function rather than an expression. Should I retitle it?

CASE is an expression, though.

Neither CASE nor NULLIF is listed in either the "Standard built-in functions" or the "SQL expressions" topic. Is this correct?


                
> NULLIF topic in reference manual should explain NULLIF
> ------------------------------------------------------
>
>                 Key: DERBY-5557
>                 URL: https://issues.apache.org/jira/browse/DERBY-5557
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Kim Haase
>         Attachments: DERBY-5557.diff, rrefcasenullif.html
>
>
> The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html
> It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

Posted by "Kim Haase (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kim Haase closed DERBY-5557.
----------------------------


Changes have appeared in Latest Alpha Manuals.
                
> NULLIF topic in reference manual should explain NULLIF
> ------------------------------------------------------
>
>                 Key: DERBY-5557
>                 URL: https://issues.apache.org/jira/browse/DERBY-5557
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Kim Haase
>             Fix For: 10.9.0.0
>
>         Attachments: DERBY-5557-2.diff, DERBY-5557-2.stat, DERBY-5557-2.zip, DERBY-5557.diff, rrefcasenullif.html
>
>
> The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html
> It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

Posted by "Knut Anders Hatlen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13251387#comment-13251387 ] 

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

The patch looks good to me. +1 to commit.
                
> NULLIF topic in reference manual should explain NULLIF
> ------------------------------------------------------
>
>                 Key: DERBY-5557
>                 URL: https://issues.apache.org/jira/browse/DERBY-5557
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Kim Haase
>         Attachments: DERBY-5557.diff, rrefcasenullif.html
>
>
> The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html
> It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13251142#comment-13251142 ] 

Dag H. Wanvik commented on DERBY-5557:
--------------------------------------

In the standard, both COALESCE and NULLIF are called "case abbreviations". Neither "function" nor "expression" is used for these two builtins.
Syntactically, they are siblings, cf. this quote from SQL 2003:

<case abbreviation> ::=
NULLIF <left paren> <value expression> <comma> <value expression> <right paren>
| COALESCE <left paren> <value expression>
{ <comma> <value expression> }... <right paren>

Both have parentheses around their arguments, so it is natural to think of them as "functions", I guess. If we choose to call COALESCE a function, we should use that term for NULLIF, too.

                
> NULLIF topic in reference manual should explain NULLIF
> ------------------------------------------------------
>
>                 Key: DERBY-5557
>                 URL: https://issues.apache.org/jira/browse/DERBY-5557
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Kim Haase
>         Attachments: DERBY-5557.diff, rrefcasenullif.html
>
>
> The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html
> It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

Posted by "Knut Anders Hatlen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13252286#comment-13252286 ] 

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

Thanks, Kim. The changes look good to me. +1
                
> NULLIF topic in reference manual should explain NULLIF
> ------------------------------------------------------
>
>                 Key: DERBY-5557
>                 URL: https://issues.apache.org/jira/browse/DERBY-5557
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Kim Haase
>         Attachments: DERBY-5557-2.diff, DERBY-5557-2.stat, DERBY-5557-2.zip, DERBY-5557.diff, rrefcasenullif.html
>
>
> The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html
> It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

Posted by "Kim Haase (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13251531#comment-13251531 ] 

Kim Haase commented on DERBY-5557:
----------------------------------

Thanks for the advice, Dag and Knut!

I think it would be a good idea to provide a second patch instead of committing this one. The additional changes would do the following:

1) call NULLIF a function rather than an expression
2) move the CASE expression topic under "SQL expressions" (not sure where; possibly after "Boolean expressions"?)
3) modify the "SQL expressions" topic (http://db.apache.org/derby/docs/dev/ref/rrefsqlj19433.html) to add a mention of CASE expressions to the "Conditional expression" row of the first table. As far as I can tell, conditional expressions include only the CASE expression and the NULLIF and COALESCE functions, so perhaps all three should be mentioned?

I'll work on this -- if you have more suggestions, or answers to my questions, please go ahead!
                
> NULLIF topic in reference manual should explain NULLIF
> ------------------------------------------------------
>
>                 Key: DERBY-5557
>                 URL: https://issues.apache.org/jira/browse/DERBY-5557
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Kim Haase
>         Attachments: DERBY-5557.diff, rrefcasenullif.html
>
>
> The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html
> It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

Posted by "Knut Anders Hatlen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13251381#comment-13251381 ] 

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

I agree with Dag that it's probably OK to call COALESCE and NULLIF functions. CASE, on the other hand, isn't a function, so it might make sense to move "CASE expression" to the "SQL expressions" topic.
                
> NULLIF topic in reference manual should explain NULLIF
> ------------------------------------------------------
>
>                 Key: DERBY-5557
>                 URL: https://issues.apache.org/jira/browse/DERBY-5557
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Kim Haase
>         Attachments: DERBY-5557.diff, rrefcasenullif.html
>
>
> The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html
> It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5557) NULLIF topic in reference manual should explain NULLIF

Posted by "Kim Haase (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kim Haase updated DERBY-5557:
-----------------------------

    Attachment: DERBY-5557-2.zip
                DERBY-5557-2.stat
                DERBY-5557-2.diff

Attaching DERBY-5557-2.diff, DERBY-5557-2.stat, and DERBY-5557-2.zip, with the following changed files:

M       src/ref/rrefcase.dita
M       src/ref/rrefcasenullif.dita
M       src/ref/rrefsqlj19433.dita
M       src/ref/refderby.ditamap

I created reltable entries in the map file for the three conditional expression topics so that they cross-reference each other, and included the COALESCE topic output in the zip so you can see that it too contains the reference.

Thanks in advance!
                
> NULLIF topic in reference manual should explain NULLIF
> ------------------------------------------------------
>
>                 Key: DERBY-5557
>                 URL: https://issues.apache.org/jira/browse/DERBY-5557
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Kim Haase
>         Attachments: DERBY-5557-2.diff, DERBY-5557-2.stat, DERBY-5557-2.zip, DERBY-5557.diff, rrefcasenullif.html
>
>
> The section describing NULLIF in the reference manual is a bit cryptic. http://db.apache.org/derby/docs/10.8/ref/rrefcasenullif.html
> It says that NULLIF is used for conditional expressions, and that it is similar to CASE, but it doesn't say in plain words how it works. It would be good if it could mention that NULLIF returns NULL if the two arguments are equal, and that it returns the first argument if they are not equal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira