INTEGER data type

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

INTEGER data type

ajay-7
Hello All,

What is the maximum number that can be stored using INTEGER data type? My
table uses INTEGER to store primary key, I store lot of records in table. I
suspect that primary key will run out of limit. How can I use long instead
of INTEGER?

 

 

Regards,

Ajay Sonawane

Reply | Threaded
Open this post in threaded view
|

Re: INTEGER data type

Kiel Wadner
On 7/4/05, Ajay <[hidden email]> wrote:
>
> Hello All,
>
> What is the maximum number that can be stored using INTEGER data type? My
> table uses INTEGER to store primary key, I store lot of records in table.
> I
> suspect that primary key will run out of limit. How can I use long instead
> of INTEGER?

   As found at: http://www.sqlite.org/datatypes.html

"INTEGER PRIMARY KEY columns must contain a 32-bit signed integer."
 and from: http://www.piclist.com/techref/microchip/math/32bmath-ph.htm

"signed 32-bit numbers have a range of -2147483648 to +2147483647

-- kiel
Reply | Threaded
Open this post in threaded view
|

Re: INTEGER data type

D. Richard Hipp
On Wed, 2005-07-06 at 17:49 -0400, Kiel W. wrote:

> On 7/4/05, Ajay <[hidden email]> wrote:
> >
> > Hello All,
> >
> > What is the maximum number that can be stored using INTEGER data type? My
> > table uses INTEGER to store primary key, I store lot of records in table.
> > I
> > suspect that primary key will run out of limit. How can I use long instead
> > of INTEGER?
>
>    As found at: http://www.sqlite.org/datatypes.html
>
> "INTEGER PRIMARY KEY columns must contain a 32-bit signed integer."
>  and from: http://www.piclist.com/techref/microchip/math/32bmath-ph.htm
>
> "signed 32-bit numbers have a range of -2147483648 to +2147483647
>

That's correct for version 2.8.  Version 3.0 expands the INTEGER PRIMARY
KEY out to 64 bits so you have a range of -18446744073709551616 to
+18446744073709551615.  Seems unlikely to overflow...
--
D. Richard Hipp <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: INTEGER data type

Kiel Wadner
> That's correct for version 2.8.  Version 3.0 expands the INTEGER PRIMARY
> KEY out to 64 bits so you have a range of -18446744073709551616 to
> +18446744073709551615.  Seems unlikely to overflow...
> --
> D. Richard Hipp <[hidden email]>

Thanks for the correction.  Definately plenty of space now.

--
Kiel W.
[hidden email]
----------------------------------
>> time is swift <<