[sqlite] Auto Increment of Integer Primary Key

2007-08-13 Thread Sreedhar.a
Hi, I am working with sqlite 3.3.6 version. I have defined the macro SQLITE_OMIT_FLOATING_POINT. 1. this is my test program "create table Test(id integer primary key,player char);" "insert into Test(id,player) values(2,'surya');" "insert into Test(id,player)

Re: [sqlite] Auto Increment?

2006-01-31 Thread Carl Jacobs
> Quoting Dennis Cote ([EMAIL PROTECTED]): > > Doesn't this mean that SQLite only supports 2^63 rows with autoincrement? > > That means you can insert one row per millisecond for 29 million years. Well actually, not quite. The website states that the database size is limited to 2^41 bytes.

Re: [sqlite] Auto Increment?

2006-01-31 Thread Paul Tomblin
Quoting Dennis Cote ([EMAIL PROTECTED]): > Doesn't this mean that SQLite only supports 2^63 rows with autoincrement? That means you can insert one row per millisecond for 29 million years. -- Paul Tomblin <[EMAIL PROTECTED]> http://xcski.com/blogs/pt/ In any business, the customer is always

Re: [sqlite] Auto Increment?

2006-01-31 Thread Dennis Cote
[EMAIL PROTECTED] wrote: The rowid does *not* wrap if you specify AUTOINCREMENT. Once the maximum rowid is used, all subsequent insert attempts return SQLITE_FULL. The regression test suite contains a test for this. Different rules apply if you do not use AUTOINCREMENT. There is a #define

Re: [sqlite] Auto Increment?

2006-01-31 Thread drh
Dennis Cote <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > > > > >Hmmm... In the later versions of sqlite with 64-bit ROWID values, doesn't it > >treat them as unsigned? It sure seems that autoincremented rowid values > >should always be positive...??? > > > > > > > No, SQLite

Re: [sqlite] Auto Increment?

2006-01-31 Thread Dennis Cote
Jim C. Nasby wrote: On Tue, Jan 31, 2006 at 10:05:47AM -0700, Dennis Cote wrote: [EMAIL PROTECTED] wrote: CREATE TABLE x(i INTEGER PRIMARY KEY AUTOINCREMENT CHECK(i < (1<<32))); I suspect you'll see better performance if you hard-code the value instead of doing a bit-shift every time

Re: [sqlite] Auto Increment?

2006-01-31 Thread Jim C. Nasby
On Tue, Jan 31, 2006 at 10:05:47AM -0700, Dennis Cote wrote: > [EMAIL PROTECTED] wrote: > CREATE TABLE x(i INTEGER PRIMARY KEY AUTOINCREMENT CHECK(i < (1<<32))); I suspect you'll see better performance if you hard-code the value instead of doing a bit-shift every time you insert. -- Jim C.

Re: [sqlite] Auto Increment?

2006-01-31 Thread Derrell . Lipman
Dennis Cote <[EMAIL PROTECTED]> writes: > Derrell, > > If you are using SQLite 3.3.0 or newer then you can do the same thing in a > more direct manner using a CHECK constraint. > > CREATE TABLE x(i INTEGER PRIMARY KEY AUTOINCREMENT CHECK(i < (1<<32))); Hehe. I'm using 2.8.16 for most of my

Re: [sqlite] Auto Increment?

2006-01-31 Thread Dennis Cote
[EMAIL PROTECTED] wrote: chetana bhargav <[EMAIL PROTECTED]> writes: Auto increment seems to return a unsigned long long is there any way for it to make it as 32 bit, as I am depending on this feilds to generate unique id, and i have a constraint fot the id to be 32 bit only. You'll

Re: [sqlite] Auto Increment?

2006-01-31 Thread Derrell . Lipman
chetana bhargav <[EMAIL PROTECTED]> writes: > Auto increment seems to return a unsigned long long is there any way for it > to make it as 32 bit, as I am depending on this feilds to generate unique > id, and i have a constraint fot the id to be 32 bit only. You'll have to add enough rows to the

[sqlite] Auto Increment?

2006-01-31 Thread chetana bhargav
Auto increment seems to return a unsigned long long is there any way for it to make it as 32 bit, as I am depending on this feilds to generate unique id, and i have a constraint fot the id to be 32 bit only. __ Do You Yahoo!? Tired of spam?

Re: [sqlite] Auto Increment?

2006-01-30 Thread Gerry Snyder
Clint Bailey wrote: Can you set up a field to auto-increment, and if so how? Details are in the fourth paragraph of: http://sqlite.org/lang_createtable.html Summary: create table tbl(fieldname integer primary key autoincrement, ...) HTH, Gerry

Re: [sqlite] Auto Increment?

2006-01-30 Thread rbundy
| | cc: | | Subject: [sqlite] Auto Increment? | >--| Can

[sqlite] Auto Increment?

2006-01-30 Thread Clint Bailey
Can you set up a field to auto-increment, and if so how?

Re: [sqlite] AUTO INCREMENT

2003-10-19 Thread Greg Obleshchuk
Waterson To: [EMAIL PROTECTED] Sent: Monday, October 20, 2003 10:59 AM Subject: Re: [sqlite] AUTO INCREMENT This one time, at band camp, "Ian VanDerPoel" <[EMAIL PROTECTED]> wrote: > You can find the info you want in the sqlite_master > tab

Re: [sqlite] AUTO INCREMENT

2003-10-19 Thread Kevin Waterson
This one time, at band camp, "Ian VanDerPoel" <[EMAIL PROTECTED]> wrote: > You can find the info you want in the sqlite_master > table. There is some doco on it at the sqlite.org the website. I am not sure if the > info is held anywhere else but > select * from sqlite_master where name =

Re: [sqlite] AUTO INCREMENT

2003-10-19 Thread Kevin Waterson
This one time, at band camp, Kevin Waterson <[EMAIL PROTECTED]> wrote: > OK, that sounds fine, but is it possible to determine the type of field so my script > will be able to add the quotes if it is of type INTEGER? I guess what I really need is something like MySQL's mysql_field_type() Kind

[sqlite] AUTO INCREMENT

2003-10-19 Thread Kevin Waterson
I have a table that looks like this.. # #SQLite Admin Structure Dump for table quotes # create table quotes(id INTEGER PRIMARY KEY, author varchar(50), quote TEXT, category varchar(20)) I am trying to auto increment the id field with this query INSERT INTO quotes (id, author, quote, category)