Maximum Size of an integer

Post Reply
mpressnall
Posts: 16
Joined: Thu Apr 29, 2004 7:02 pm

Maximum Size of an integer

Post 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
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Maximum Size of an integer

Post 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.
Post Reply