Subject Re: [firebird-support] COALESCE
Author Arno Brinkman
Hi,

> > Does anybody know what's going on?
> > Of course, I would be glad about a small workaround ;-)
>
> Each column of result set must have determined its datatype,
> i.e. datatype can't change dynamically for each fetched row.


> Result type of COALESCE expression is determined by its first item,
> i.e. DATE. String 'not defined' can't be converted to DATE, of course.

It's not determined by first item.
-If all datatypes are the same then that datatype is used.
-If there is any char datatype mixed with any other datatype then output
will be varchar.
-If there is any varchar datatype output will always be varchar datatype.
- ....
Firebird behaves as much as possible according the SQL standard here. See
"9.3 Data types of results of aggregations"

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/

Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://80.126.130.81