Subject Re: Data type unknown....
Author sllimr7139
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> Bear in mind that the structure of the entire query is determined
> by the structure of the first SELECT. Two things to watch here:
>
> 1) Don't use alias names in any of the selects except the first
> one. In this example, you don't need alias names at all because the
> set is being defined (in the first SELECT) by genuine columns, not
> expressions
>
> 2) Double check that the castings you are using are compatible with
> the column definitions of the first SELECT. If you are confused as
> to what is or isn't compatible, then cast the expression fields in
> the subsequent selects to the exact data types of the corresponding
> columns in the first SELECT.
>
> ./heLen


Hi Helen,

Ok, I've figured out what was wrong, but can you answer something for
me? If in the first select one of my columns types is defined as
smallint and I cast the same column of the second select as an integer
why does the engine give me grief over that?

Especially since -1 is -1 in both sets?

I know that a smallint is 16bit where as integer is 32 bit but why is
the engine so picky about that? Does the engine compare the sizeof
the datatypes being used as well as the values of the datatypes?

Ryan.