[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) values(9223372036854775807,'sree');

[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-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 table

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
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 (132))); Hehe. I'm using 2.8.16 for most of my work, so I

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 (132))); 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. Nasby, Sr.

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 (132))); 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 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 treats them as 64 bit

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 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 right,

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.

[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?

2006-01-30 Thread rbundy
: | | Subject: [sqlite] Auto Increment? | --| Can you set up a field

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

[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)

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

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 = quotes;

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 table. There is some doco on it at the sqlite.org