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 "Paul Jenkins (JIRA)" <de...@db.apache.org> on 2005/08/06 00:45:35 UTC

[jira] Created: (DERBY-495) COALESCE

COALESCE
--------

         Key: DERBY-495
         URL: http://issues.apache.org/jira/browse/DERBY-495
     Project: Derby
        Type: Bug
  Components: Documentation  
    Versions: 10.0.2.0    
 Environment: n/a
    Reporter: Paul Jenkins
    Priority: Minor


The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (DERBY-495) COALESCE

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

Kim Haase reassigned DERBY-495:
-------------------------------

    Assignee: Kim Haase

> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: https://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Assignee: Kim Haase
>            Priority: Minor
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-495) COALESCE

Posted by "Mamta A. Satoor (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-495?page=comments#action_12370490 ] 

Mamta A. Satoor commented on DERBY-495:
---------------------------------------

Jeff, here are couple examples
create table temp(smallintcol smallint, bigintcol bigint,intcol integer)
insert into temp values (1,null,null)
insert into temp values (null,2,null)
insert into temp values (null,null,3)

-- the return datatype of coalesce would be bigint
select coalesce (smallintcol, bigintcol) from temp;
1
--------------------
1
2
NULL

3 rows selected
-- the return datatype of coalesce would be integer
ij> ij> select coalesce (smallintcol, intcol) from temp;
1
-----------
1
NULL
3

As for compatible datatypes and the datatype of resultant of the coalesce function, please check the comments at the top of org.apache.derby.impl.sql.compile.CoalesceFunctionNode.java, IMHO, we should include this somewhere in our doc so the users knwo what to expect out of various datatype combination in a coalesce function.

> COALESCE
> --------
>
>          Key: DERBY-495
>          URL: http://issues.apache.org/jira/browse/DERBY-495
>      Project: Derby
>         Type: Bug
>   Components: Documentation
>     Versions: 10.0.2.0
>  Environment: n/a
>     Reporter: Paul Jenkins
>     Priority: Minor

>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-495) COALESCE

Posted by "Matt Frantz (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-495?page=comments#action_12428210 ] 
            
Matt Frantz commented on DERBY-495:
-----------------------------------

The proposed documentation does not allow for the possibility of invoking COALESCE with a single argument.  Should it read as follows?

COALESCE (expression[,expression]...)

If the single-argument case is not supported, then maybe it should be.  (This case is nice for SQL-generator applications.)


> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: http://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Priority: Minor
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-495) COALESCE

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

Kim Haase updated DERBY-495:
----------------------------

    Attachment: rreffunccoalesce.html
                DERBY-495-3.diff

Final patch for commit.

> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: https://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Assignee: Kim Haase
>            Priority: Minor
>         Attachments: DERBY-495-2.diff, DERBY-495-3.diff, DERBY-495.diff, rreffunccoalesce.html, rreffunccoalesce.html, rreffunccoalesce.html
>
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-495) COALESCE

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

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

Thanks for the patch, Kim! Some small comments:

> COALESCE ( expression, expression[, expression]... )
                                                        ^ add a space before left bracket for legibility 

Prefer * repetition operator in the grammar production. The manual is
schizophrenic on whether to use * or ..., though. But * dominates, I
counted 25 occurences vs. 2-3.

    COALESCE ( expression, expression [, expression]* )


Maybe it would be nice to have the second example take three args? E.g.

ij> select coalesce (smallintcol, bigintcol, intcol) from temp;
1                   
--------------------
1                   
2                   
3 


> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: https://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Assignee: Kim Haase
>            Priority: Minor
>         Attachments: DERBY-495.diff, rreffunccoalesce.html
>
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-495) COALESCE

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-495?page=comments#action_12445420 ] 
            
Daniel John Debrunner commented on DERBY-495:
---------------------------------------------

If VALUE is a synonym for the COALESCE function then it should be documented, as Derby's documentation should represent its full set of features.

> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: http://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Priority: Minor
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-495) COALESCE

Posted by "Paul Jenkins (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-495?page=comments#action_12318120 ] 

Paul Jenkins commented on DERBY-495:
------------------------------------

The Built-in Functions section of the Reference Guide would be fine.

Would it be possible to check if there are other undocumented functions ?  I've been looking for a function to help me to determine the number of days between two dates.  In other systems there are functions like DAYS() and DATEDIFF().

Paul.

> COALESCE
> --------
>
>          Key: DERBY-495
>          URL: http://issues.apache.org/jira/browse/DERBY-495
>      Project: Derby
>         Type: Bug
>   Components: Documentation
>     Versions: 10.0.2.0
>  Environment: n/a
>     Reporter: Paul Jenkins
>     Priority: Minor

>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-495) COALESCE

Posted by "Jeff Levitt (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-495?page=comments#action_12370420 ] 

Jeff Levitt commented on DERBY-495:
-----------------------------------

Hi Mamta,

Can you provide an example and a description of the example that I can use in a patch for this issue?  I know you mentioned examples in coalesceTests.java, but I was wondering if you could choose a good one and describe it and place it here in a comment.  Thanks, Jeff

> COALESCE
> --------
>
>          Key: DERBY-495
>          URL: http://issues.apache.org/jira/browse/DERBY-495
>      Project: Derby
>         Type: Bug
>   Components: Documentation
>     Versions: 10.0.2.0
>  Environment: n/a
>     Reporter: Paul Jenkins
>     Priority: Minor

>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-495) COALESCE

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

Kim Haase updated DERBY-495:
----------------------------

    Attachment: rreffunccoalesce.html
                DERBY-495.diff

Attaching DERBY-495.diff and rreffunccoalesce.html, adding a topic documenting the COALESCE function. Please let me know if any changes are needed.

A      src/ref/rreffunccoalesce.dita
M      src/ref/refderby.ditamap


> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: https://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Assignee: Kim Haase
>            Priority: Minor
>         Attachments: DERBY-495.diff, rreffunccoalesce.html
>
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-495) COALESCE

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

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

Thanks, Kim!   +1

Minor nit: Example header might be nice, but maybe we don't usually use a header for examples? Could we omit the "rows inserted", "rows selected" info to make the important lines stand out better? I don't think the manual usually shows real "ij" sessions in the examples, but I think that's fine, however it gets a bit
"crowded" in the examples. A blank line between the examples might also help legibility a bit. Your call.


> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: https://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Assignee: Kim Haase
>            Priority: Minor
>         Attachments: DERBY-495-2.diff, DERBY-495.diff, rreffunccoalesce.html, rreffunccoalesce.html
>
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-495) COALESCE

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

Kim Haase updated DERBY-495:
----------------------------

    Attachment: rreffunccoalesce.html
                DERBY-495-2.diff

Thanks, Dag, for checking so carefully for consistency with other syntax formats. I've followed your suggestions, I hope. I'm attaching DERBY-495-2.diff and a new version of the HTML file.

I wasn't sure exactly which example output you wanted replaced, so I just added the new one. The more examples the better?

> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: https://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Assignee: Kim Haase
>            Priority: Minor
>         Attachments: DERBY-495-2.diff, DERBY-495.diff, rreffunccoalesce.html, rreffunccoalesce.html
>
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DERBY-495) COALESCE

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

Kim Haase closed DERBY-495.
---------------------------


New topic has appeared in Latest Alpha Manuals, so closing.

> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: https://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Assignee: Kim Haase
>            Priority: Minor
>             Fix For: 10.6.0.0
>
>         Attachments: DERBY-495-2.diff, DERBY-495-3.diff, DERBY-495.diff, rreffunccoalesce.html, rreffunccoalesce.html, rreffunccoalesce.html
>
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-495) COALESCE

Posted by "Christian d'Heureuse (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-495?page=comments#action_12445443 ] 
            
Christian d'Heureuse commented on DERBY-495:
--------------------------------------------

> If VALUE is a synonym for the COALESCE function then it should be documented,

But VALUE is such a general keyword and may be needed for other purposes in the future. It would be a pity to waste this keyword as an alias for COALESCE.

> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: http://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Priority: Minor
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (DERBY-495) COALESCE

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

Kim Haase resolved DERBY-495.
-----------------------------

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

Committed patch DERBY-495-3.diff to documentation trunk at revision 811109. 

> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: https://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Assignee: Kim Haase
>            Priority: Minor
>             Fix For: 10.6.0.0
>
>         Attachments: DERBY-495-2.diff, DERBY-495-3.diff, DERBY-495.diff, rreffunccoalesce.html, rreffunccoalesce.html, rreffunccoalesce.html
>
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-495) COALESCE

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

Kim Haase commented on DERBY-495:
---------------------------------

Thanks, Dag!

Most of the function topics don't use a title for examples, but it's a good idea, so I've added one. To keep the ij output more or less realistic, I kept the "rows inserted" etc. output in, but I did put spaces between parts of the example for legibility.

I'll commit the fix with these changes.

> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: https://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Assignee: Kim Haase
>            Priority: Minor
>         Attachments: DERBY-495-2.diff, DERBY-495.diff, rreffunccoalesce.html, rreffunccoalesce.html
>
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-495) COALESCE

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

Kim Haase updated DERBY-495:
----------------------------

    Issue & fix info: [Patch Available]

> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: https://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Assignee: Kim Haase
>            Priority: Minor
>         Attachments: DERBY-495.diff, rreffunccoalesce.html
>
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-495) COALESCE

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

Kim Haase commented on DERBY-495:
---------------------------------

Dag Wanvik has answered the questions that seemed to be holding up the resolution of this issue.

> > Neither COALESCE nor VALUE is documented currently (except for a
> > mention in an error message).
> >
> > Looking at DERBY-495, it appears that the doc effort stalled for lack
> > of answers to a couple questions --
> >
> > I gather VALUE as a synonym of COALESCE is not in the SQL standard,
> > but COALESCE itself is? Should we mention VALUE, then?

Yes, since it is implemented we should document it as a synonym, but
probably recommend the standard form COALESCE.

> >
> > What does the SQL standard say about the one-argument form? Is it
> > permitted?

The standard does not allow the one-argument form:

SQL 2003, vol 2 section 6.1 <case expression>:
:
<case abbreviation> ::=
  NULLIF <left paren> <value expression> <comma> <value expression> <right paren>
| COALESCE <left paren> <value expression> { <comma> <value expression> }... <right paren>

This means that 2 or more args are allowed.
Derby does not permit one argument; it throws 42605.  Also, not all arguments
can be dynamic (?), if so Derby throws 42610.


> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: https://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Assignee: Kim Haase
>            Priority: Minor
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-495) COALESCE

Posted by "Christian d'Heureuse (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-495?page=comments#action_12445317 ] 
            
Christian d'Heureuse commented on DERBY-495:
--------------------------------------------

COALESCE is an important function and should be documented.

In ISO/IEC 9075, the syntax for COALESCE is
  COALESCE ( expression [,expression].... )
but Derby currently does not allow COALESCE with a single argument.
As long as this is not fixed, the syntax documentation should be
  COALESCE ( expression, expression [,expression].... )

In ISO 9075-2, COALESCE is defined as:
  COALESCE (V1, V2) is equivalent to the following <case specification>:
    CASE WHEN V1 IS NOT NULL THEN V1 ELSE V2 END
  COALESCE (V1, V2, ..., Vn), for n ≥ 3, is equivalent to the following <case specification>:
    CASE WHEN V1 IS NOT NULL THEN V1 ELSE COALESCE (V2, ..., Vn) END
This could be used for the documentation.

I wouldn't document that "VALUE is another name for the COALESCE function" in Derby, because thats an "inheritance" from DB2 and not part of the SQL standard.

> COALESCE
> --------
>
>                 Key: DERBY-495
>                 URL: http://issues.apache.org/jira/browse/DERBY-495
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>         Environment: n/a
>            Reporter: Paul Jenkins
>            Priority: Minor
>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (DERBY-495) COALESCE

Posted by "Mamta A. Satoor (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-495?page=comments#action_12318116 ] 

Mamta A. Satoor commented on DERBY-495:
---------------------------------------

I have some suggestion on what information can be included in the documentation for COALESCE/VALUE. 

First of all, the function can be added to the existing list of Built-in functions in Reference Guide. Functions like IDENTITY_VAL_LOCAL, LOCATE are explained in that section. Definition of COALESCE "This scalar function takes two or more compatible arguments and returns the first argument that is not null. The result will be null only if all the arguments are null. VALUE is another name for COALESCE function and can be used interchangeably."  The compatible datatypes and the datatype of resultant is listed in a table in the comments section of "org.apache.derby.impl.sql.compile.CoalesceFunctionNode.java" Feel free to rephrase/reword the informatio I have suggested. 
Syntax
COALESCE (expression, expression[,expression]...)

Several examples of this function can be found in org.apache.derbyTesting.tests.lang.coalesceTests.java


> COALESCE
> --------
>
>          Key: DERBY-495
>          URL: http://issues.apache.org/jira/browse/DERBY-495
>      Project: Derby
>         Type: Bug
>   Components: Documentation
>     Versions: 10.0.2.0
>  Environment: n/a
>     Reporter: Paul Jenkins
>     Priority: Minor

>
> The COALESCE function has been implemeted since 10.0.2.0 (at least) but isn't documented.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira