From: Adriano d. S. F. <adr...@uo...> - 2007-01-30 14:58:31
|
Ivan Prenosil wrote: >> SQL> select cast('5.6' as integer) from rdb$database; >> >> CAST >> ============ >> 5 >> > > This is direct conversion of string to integer. What the rules should be > is the question, but there are worse cases. In some countries it is common > to use comma as decimal separator, but if you use it by mistake, > you will not get error but this (also see handling of spaces) > > SELECT 5.6, > cast(5.6 as integer), > cast('5.6' as integer), > cast('5,6' as integer), > cast('5,6,7 8 9' as integer) > FROM RDB$DATABASE; > > CAST CAST CAST CAST > > ===================== =========== =========== =========== =========== > 5.6 6 5 56 56789 > Argh! Haven't looked at the code, but seems we direct use CRT functions. Adriano |