db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamta A. Satoor (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-495) COALESCE
Date Wed, 15 Mar 2006 09:51:57 GMT
    [ 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


Mime
View raw message