Subject | Re: [firebird-support] The predicate where table1.timestamp1 > coalesce(table2.timestamp1, table2.timestamp2, '1.1.2006') does not work since Firebird 2.1 |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2009-01-24T20:54:10Z |
> where h.log_tsc > coalesce(z.upd_tsc, z.create_tsc, '1.1.2006')I would guess that Firebird is trying to cast all arguments of
>
> It causes the error: "GDS Exception. 335544321. arithmetic exception,
> numeric overflow, or string truncation"
>
> Please clarify the situation.
coalesce function to CHAR(8), which is type of '1.1.2008'. And because
fields are timestamps, they don't fit 8 chars.
SY, SD.
PS: You can use specification "_timestamp" instead of CAST. I.e.
coalesce(z.upd_tsc, z.create_tsc, _timestamp '1.1.2006')