Subject Re: [firebird-support] Null to Zero conversion
Author Martijn Tonies
Hi,

> Thanks for your precious help.
> Martijn, I solved the problem using COALESCE.

That's good to hear. This is exactly why Arno added COALESCE :-)


>About the union thing, I have tried it before posting my question but I got
the following error >message:
> Invalid token.
> Dynamic SQL Error.
> SQL error code = -104.
> Invalid command.
> Data type unknown.
> Nikolay the query is the same as you suggested. i.e:"select col1, col2, 0
where col3 is NULL from table unioun
> select col1, col2, col3 where col3 is NOT NULL from table"

I still believe it should work if you do:

SELECT Col1, Col2, CAST(0 as <datatype of col3>)
...



With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com