[firebird-support] Cast as Numeric without parenthesis

2015-03-26 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Hi,   i know this kind of cast SELECT CAST('1.23' AS NUMERIC(10, 2)) FROM RDB$DATABASE   but what are the rules for this (numeric without parenthesis) [1] SELECT CAST('1.23' AS NUMERIC) FROM RDB$DATABASE result is 1   [2] SELECT CAST('12345678.23' as numeric) FROM RDB$DATABASE result is 12345678  

RE: [firebird-support] Cast as Numeric without parenthesis

2015-03-26 Thread Rand Random rand.ran...@outlook.com [firebird-support]
: firebird-support@yahoogroups.com Date: Thu, 26 Mar 2015 10:05:17 +0100 Subject: RE: [firebird-support] Cast as Numeric without parenthesis I would expect numbers in the range -2147483648 to +2147483647 to be accepted (the size of an integer

RE: [firebird-support] Cast as Numeric without parenthesis

2015-03-26 Thread Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
I would expect numbers in the range -2147483648 to +2147483647 to be accepted (the size of an integer), and then there’s a separate field for storing whether things are shifted to the left or right. I’ve no experience or theoretical knowledge confirming this, but your examples would fit such a

Re: RE: [firebird-support] Cast as Numeric without parenthesis

2015-03-26 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
-support] Cast as Numeric without parenthesis   I would expect numbers in the range -2147483648 to +2147483647 to be accepted (the size of an integer), and then there’s a separate field for storing whether things are shifted to the left or right. I’ve no experience or theoretical knowledge

Re: [firebird-support] Cast as Numeric without parenthesis

2015-03-26 Thread Tim Ward t...@telensa.com [firebird-support]
On 26/03/2015 12:35, Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support] wrote: Here, I find that SELECT CAST(123456789.12345678 as decimal) FROM RDB$DATABASE succeeds, whereas SELECT CAST(123456789.123456789 as decimal) FROM RDB$DATABASE fails. I don't know why.

RE: [firebird-support] Cast as Numeric without parenthesis

2015-03-26 Thread Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
then why here is an error?   SELECT CAST('123456789.23' as numeric) FROM RDB$DATABASE Logically speaking I don't understand why SELECT CAST('123456789.23' as numeric(9,0)) FROM RDB$DATABASE is failing when SELECT CAST('1.23' as numeric(1,0)) FROM RDB$DATABASE succeeds. Practically, I guess

Re: [firebird-support] Cast as Numeric without parenthesis

2015-03-26 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 26-3-2015 09:26, liviuslivius liviusliv...@poczta.onet.pl [firebird-support] wrote: Hi, i know this kind of cast SELECT CAST('1.23' AS NUMERIC(10, 2)) FROM RDB$DATABASE but what are the rules for this (numeric without parenthesis) [1] SELECT CAST('1.23' AS NUMERIC) FROM RDB$DATABASE