Subject | Re: [firebird-support] Using unions |
---|---|
Author | Thomas Miller |
Post date | 2004-02-04T14:14:32Z |
FB is a little "dumb" when it comes to reconciling data types in a UNION.
It has already been suggested to make it smarter in this area.
Use a Cast
CAST('' AS VARCHAR(30)) as condition
Obviously, cast it to match the datatype of the condition field in the
database.
rajsubramani wrote:
Thomas Miller
Delphi Client/Server Certified Developer
BSS Accounting & Distribution Software
BSS Enterprise Accounting FrameWork
http://www.bss-software.com
http://sourceforge.net/projects/dbexpressplus
It has already been suggested to make it smarter in this area.
Use a Cast
CAST('' AS VARCHAR(30)) as condition
Obviously, cast it to match the datatype of the condition field in the
database.
rajsubramani wrote:
>I'm using firebird 1.0.--
>
>When I try to do
>
>select book_id, price, '' as condition from Book
>UNION
>select bk.book_id, price, condition from Stock sk, Book bk where
>bk.book_id = sk.book_id
>
>I keep getting
>
>SQL error code = -104
>Invalid command
>Data type unknown
>
>
>This works with many other databases that I have tried.
>
>Does UNION not work with Firebird.
>
>Thanks for the help.
>
>Cheers
>-raj
>
>
>
>
>Yahoo! Groups Links
>
>To visit your group on the web, go to:
> http://groups.yahoo.com/group/firebird-support/
>
>To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
>Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>
>
>
>
>
Thomas Miller
Delphi Client/Server Certified Developer
BSS Accounting & Distribution Software
BSS Enterprise Accounting FrameWork
http://www.bss-software.com
http://sourceforge.net/projects/dbexpressplus