Subject Re: [ib-support] SQL Problem
Author Helen Borrie
At 03:35 PM 02-08-01 +0200, you wrote:
>Hello all :-)
>
>I try to do this simple Sql statement:
>
>SELECT DESCR,NULL FROM TAB1
>UNION ALL
>SELECT DESCR,IDX FROM TAB2
>
>with Access, DB2 and other this works fine, with IB it doesn't.
>I have tried with NULL,0,'',"" and other but nothing.
>
>Any suggestions?

The two sets that form the UNION have to match structurally. I think will just a NULL floating in the ether, the engine won't know whether the type matches or not. Let's assume IDX is a varchar, then this UNION might work:

>SELECT DESCR,'' as IDX FROM TAB1
>UNION ALL
>SELECT DESCR,IDX FROM TAB2


regards
Helen


All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________