Page 1 of 1

Maximum Size of an integer

Posted: Wed Jun 01, 2005 4:58 pm
by mpressnall
What data type can I use to store a number larger than 5 billion?

I issue this (against an integer column)
update company_profiles set year_end_shares = '10862000000' where stock_symbol = 'MSFT';
and get back
-2022901888

Is there no native datatype to store anything larger than 5 billion? Sorting a varchar with numbers in them is a bad way to go, I think.

Thanks,
Matt Pressnall
The Seattle Times

Maximum Size of an integer

Posted: Wed Jun 01, 2005 5:55 pm
by mark
On the alpha running unix which is native 64 bit you can use type "long" for 64 bits. Otherwise you'll need to use double or varchar. If varchar you'd have to zero pad numbers to some fixed length for sorting to work.