Subject Re: [firebird-support] Backporting query to Firebird 1.5
Author Helen Borrie
At 15:27 3/10/2008, you wrote:
>Hi,
>
>> SELECT * FROM TABLE WHERE TIMESTAMPFIELD > (CURRENT_TIMESTAMP - CAST(?
>> as DECIMAL(18,9))
>
>I've tested against FB 1.5.4 and it works fine
>
>
>> However, if I try to execute this in older system with Firebird 1.5,
>> I get "Unknown data type" error.
>
>I can't reproduce the error against fb 1.5.4, ex:
>
> select current_timestamp-cast(10.321 as numeric(18,9)) from rdb$database;
>
>runs just fine!

Sure, it works fine with constants. But in v.1.5.x it doesn't work if there's a parameter among the arithmetic operators.

For Firebird 2 a lot was done to make the parser more intelligent about resolving ambiguous type conversions like this one. It could be worth a whirl upgrading to 1.5.5 and seeing whether this improvement was amongst the many that were backported at that point...

./heLen