auto_increment and clustering sequence

2002-06-21 Thread Bill Ferrett
this happens when the auto_increment column is not the first column - so a multi-column index of name,id seems to be out. Can I do this and if so how? Many thanks -- Bill Ferrett Accroserve Systems Ltd. Office: 01702 342148 Mobile: 07855 868565

Re: auto_increment and clustering sequence

2002-06-21 Thread Dan Nelson
want the auto-increment id to be duplicated - I believe this happens when the auto_increment column is not the first column - so a multi-column index of name,id seems to be out. Your choice of primary key has no bearing at all on where mysql decides to store a row in MyISAM tables. It has

mysql auto_increment question

2002-06-11 Thread Taylor Lewick
Hi all. I have searched the documentation, and i found some info, but I wanted to ask the lsit a little more about auto_increment. First, if I use auto_increment, and then delete a field, I assume mysql leaves the remaining fields with the original numbers... i.e. if I haverows 1 through 10

Re: mysql auto_increment question

2002-06-11 Thread Gerald Clark
Taylor Lewick wrote: Hi all. I have searched the documentation, and i found some info, but I wanted to ask the lsit a little more about auto_increment. First, if I use auto_increment, and then delete a field, I assume mysql leaves the remaining fields with the original numbers... i.e. if I

Problem when inserting a record - auto_increment field gets max integer value instead of next id

2002-06-05 Thread Bobby Oswald
Hi, I have a database with the following table and data: When I add a new record the auto_increment number becomes '2147483647' not sure why? Checked the SHOW TABLE STATUS too and this shows that the next auto_increment number will be '2147483647' anyone know why? Running MySQL 3.23.41

Re: Problem when inserting a record - auto_increment field gets max integer value instead of next id

2002-06-05 Thread Fred van Engen
Bobby, On Wed, Jun 05, 2002 at 12:30:17PM +0200, Bobby Oswald wrote: I have a database with the following table and data: When I add a new record the auto_increment number becomes '2147483647' not sure why? Checked the SHOW TABLE STATUS too and this shows that the next auto_increment

RE: Problem when inserting a record - auto_increment field gets max integer value instead of next id

2002-06-05 Thread Bobby Oswald
Removed all the negative values and the same problem still occurs -Original Message- From: Fred van Engen [mailto:[EMAIL PROTECTED]] Sent: 05 June 2002 12:50 To: [EMAIL PROTECTED] Subject: Re: Problem when inserting a record - auto_increment field gets max integer value instead

Re: Problem when inserting a record - auto_increment field gets max integer value instead of next id

2002-06-05 Thread Fred van Engen
auto_increment ID. I believe there is also a command you can use to reset the auto_increment ID, but you would still need to take care to not insert negative values. Regards, Fred. -Original Message- From: Fred van Engen [mailto:[EMAIL PROTECTED]] Sent: 05 June 2002 12:50

RE: Problem when inserting a record - auto_increment field gets max integer value instead of next id

2002-06-05 Thread Bobby Oswald
Cool, no negatives reset the key and it works, thanks, -Original Message- From: Bobby Oswald Sent: 05 June 2002 13:50 To: Fred van Engen; [EMAIL PROTECTED] Subject: RE: Problem when inserting a record - auto_increment field gets max integer value instead of next id Removed

Re: Problem when inserting a record - auto_increment field gets max integer value instead of next id

2002-06-05 Thread Egor Egorov
Bobby, Wednesday, June 05, 2002, 1:30:17 PM, you wrote: BO I have a database with the following table and data: BO When I add a new record the auto_increment number becomes '2147483647' BO not sure why? Checked the SHOW TABLE STATUS too and this shows that the BO next auto_increment number

DELETE syntax and auto_increment 'reset'

2002-05-22 Thread Jule
Hey guys, when i delete a row using the query DELETE FROM $table WHERE id = 3 LIMIT 1; how can i make it that the id column (auto_increment) starts over from 1 and build up to however many rows there are without counting 1 2 4 5 6 etc.? any ideas? Jule

Re: DELETE syntax and auto_increment 'reset'

2002-05-22 Thread Paul DuBois
At 18:29 -0400 5/22/02, Jule wrote: Hey guys, when i delete a row using the query DELETE FROM $table WHERE id = 3 LIMIT 1; how can i make it that the id column (auto_increment) starts over from 1 and build up to however many rows there are without counting 1 2 4 5 6 etc.? If you're asking how

Re: AUTO_INCREMENT= ?

2002-05-13 Thread Victoria Reznichenko
Amer, Monday, May 13, 2002, 2:03:28 AM, you wrote: AN Win/98 AN MySQL 3.23.46 AN I'm trying to use AUTO_INCREMENT=1000 to specify my staring value in an AN ID column in batch mode, but it doesn't want to work. I can get it to AN work in interactive mode though. AN In a file (create_tables.sql

Re: AUTO_INCREMENT= ?

2002-05-13 Thread Amer Neely
Amer, Monday, May 13, 2002, 2:03:28 AM, you wrote: AN Win/98 AN MySQL 3.23.46 AN I'm trying to use AUTO_INCREMENT=1000 to specify my staring value in an AN ID column in batch mode, but it doesn't want to work. I can get it to AN work in interactive mode though. AN In a file

Re: AUTO_INCREMENT= ?

2002-05-13 Thread Luciano Barcaro
, this works in interactive mode, but NOT in batch mode. Can you or someone explain how this can be done in batch mode? What you can do is the following: After the Create table command, add : Alter table Respondents auto_increment=1000; AN The values I'm inserting for AN UserID are all 'null

Re: AUTO_INCREMENT= ?

2002-05-13 Thread Paul DuBois
At 15:23 -0400 5/13/02, Amer Neely wrote: Amer, Monday, May 13, 2002, 2:03:28 AM, you wrote: AN Win/98 AN MySQL 3.23.46 AN I'm trying to use AUTO_INCREMENT=1000 to specify my staring value in an AN ID column in batch mode, but it doesn't want to work. I can get it to AN work

Re: AUTO_INCREMENT= ?

2002-05-13 Thread Curtis Maurand
How about: UserID SMALLINT UNSIGNED AUTO_INCREMENT NULL PRIMARY KEY DEFAULT 1000 Curtis Amer Neely said: Amer, Monday, May 13, 2002, 2:03:28 AM, you wrote: AN Win/98 AN MySQL 3.23.46 AN I'm trying to use AUTO_INCREMENT=1000 to specify my staring value in an AN ID column in batch

Re: AUTO_INCREMENT= ?

2002-05-13 Thread Amer Neely
Paul DuBois wrote: At 15:23 -0400 5/13/02, Amer Neely wrote: Amer, Monday, May 13, 2002, 2:03:28 AM, you wrote: AN Win/98 AN MySQL 3.23.46 AN I'm trying to use AUTO_INCREMENT=1000 to specify my staring value in an AN ID column in batch mode, but it doesn't want to work

Re: AUTO_INCREMENT= ?

2002-05-13 Thread Amer Neely
Paul DuBois wrote: At 17:41 -0400 5/13/02, Amer Neely wrote: Paul DuBois wrote: At 15:23 -0400 5/13/02, Amer Neely wrote: Amer, Monday, May 13, 2002, 2:03:28 AM, you wrote: AN Win/98 AN MySQL 3.23.46 AN I'm trying to use AUTO_INCREMENT=1000 to specify my

Re: AUTO_INCREMENT= ?

2002-05-13 Thread Paul DuBois
, not as the word NULL. I'm not sure that that will make a difference, though. MySQL will see NULL, perform a string-to-number conversion and end up with a value of zero. And inserting 0 into an AUTO_INCREMENT column should be the same as inserting NULL. Still, it'd be worth a try to convert

Re: AUTO_INCREMENT= ?

2002-05-13 Thread Amer Neely
values should be specified as \N, not as the word NULL. I'm not sure that that will make a difference, though. MySQL will see NULL, perform a string-to-number conversion and end up with a value of zero. And inserting 0 into an AUTO_INCREMENT column should be the same as inserting NULL

Re: AUTO_INCREMENT= ?

2002-05-13 Thread Paul DuBois
into an AUTO_INCREMENT column should be the same as inserting NULL. Still, it'd be worth a try to convert NULL to \N and see what happens. This might be interacting with another problem, which is that if your data file likes are CRLF terminated, *you need to say so*. The default

Re: AUTO_INCREMENT= ? - solved

2002-05-13 Thread Amer Neely
Thanks to Paul Dubois, I've figured out the problem of setting AUTO_INCREMENT to a default value in batch mode (from within a .sql file). I was executing a 'DELETE FROM' statement immediately before my 'LOAD DATA ' statement, which knocks the default value down to 0, regardless that I had set

AUTO_INCREMENT= ?

2002-05-12 Thread Amer Neely
Win/98 MySQL 3.23.46 I'm trying to use AUTO_INCREMENT=1000 to specify my staring value in an ID column in batch mode, but it doesn't want to work. I can get it to work in interactive mode though. In a file (create_tables.sql) I have: CREATE TABLE Respondents (UserID SMALLINT UNSIGNED

auto_increment fields get mangled in some cases when doing an alter table

2002-04-15 Thread Tani Hosokawa
If you have a table with an auto_increment column and one of the rows has the value set to 0, doing an ALTER TABLE will change that value to either 2147483647 or the next auto_increment value. mysql create table blah (id int not null primary key auto_increment,stuff char(128)); Query OK, 0 rows

Re: auto_increment fields get mangled in some cases when doing analter table

2002-04-15 Thread Paul DuBois
At 14:17 -0700 4/15/02, Tani Hosokawa wrote: If you have a table with an auto_increment column and one of the rows has the value set to 0, doing an ALTER TABLE will change that value to either 2147483647 or the next auto_increment value. Storing anything other than positive integers

Re: auto_increment setting the start number

2002-04-14 Thread Kevin Smith
mysql... see below, got caught be the filter of this list... - Original Message - From: [EMAIL PROTECTED] To: Kevin Smith [EMAIL PROTECTED] Sent: Sunday, April 14, 2002 3:13 PM Subject: Re: auto_increment setting the start number Your message cannot be posted because it appears

RE: Can AUTO_INCREMENT return from INSERT function into a table ?

2002-04-08 Thread Noel Clarkson
| Null | Key | Default | Extra | +-+--+--+-+-++ | thread_ID | int(11) | | PRI | NULL| auto_increment | | subject | varchar(255) | YES | | NULL| | | author | varchar(30) | YES | | NULL

Re: Can AUTO_INCREMENT return from INSERT function into a table ?

2002-04-08 Thread Erlend Stromsvik
Check out this: http://www.mysql.com/doc/L/O/LOCK_TABLES.html User 1 must do a 'write lock' on the table, before calling the insert statement. Then User 2's qery will have to wait till User 1 calls Unlock. USER 1 === WRITE LOCK USER 1 === INSERT STOP == due to process

Re: Can AUTO_INCREMENT return from INSERT function into a table ?

2002-04-08 Thread Paul DuBois
| +-+--+--+-+-++ | thread_ID | int(11) | | PRI | NULL| auto_increment | | subject | varchar(255) | YES | | NULL| | | author | varchar(30) | YES | | NULL| | | last_by

Can AUTO_INCREMENT return from INSERT function into a table ?

2002-04-07 Thread Son Nguyen
| auto_increment | | subject | varchar(255) | YES | | NULL|| | author | varchar(30) | YES | | NULL|| | last_by | varchar(30) | YES | | NULL|| | views | int(11) | | | 0

Re: Can AUTO_INCREMENT return from INSERT function into a table ?

2002-04-07 Thread BD
) | | PRI | NULL| auto_increment | | subject | varchar(255) | YES | | NULL|| | author | varchar(30) | YES | | NULL|| | last_by | varchar(30) | YES | | NULL|| | views | int(11

Re: Can AUTO_INCREMENT return from INSERT function into a table ?

2002-04-07 Thread Son Nguyen
| +-+--+--+-+-++ | thread_ID | int(11) | | PRI | NULL| auto_increment | | subject | varchar(255) | YES | | NULL| | | author | varchar(30) | YES | | NULL| | | last_by | varchar(30) | YES | | NULL

RE: auto_increment question

2002-03-29 Thread Lopez David E-r9374c
: Thursday, March 28, 2002 4:45 PM To: [EMAIL PROTECTED] Subject: auto_increment question This is my first time posting to this list, so please forgive me if I am not doing this correctly. I will break this into post into two parts: what i want to know and why. Is there a way to get auto_increment

auto_increment question

2002-03-28 Thread Jeff Habermann
This is my first time posting to this list, so please forgive me if I am not doing this correctly. I will break this into post into two parts: what i want to know and why. Is there a way to get auto_increment fields to fill in gaps in the numbering sequence if some records have been deleted

Re: auto_increment question

2002-03-28 Thread Joel Rees
Jeff Habermann asked: well. Now, because of this deletion, there are sequence gaps in the "idx" field. We would like to be able to use those numbers again for incoming clients...Is this possible? It looks like you can, but IMHO, it would probably be more effective to add a DELETED flag to

auto_increment and range or highest value

2002-03-27 Thread Bernard Chambon
What's happens when the highest value is reached I have made a try with : create table Generator (Sequence smallint(7) zerofill unique primary key not null auto_increment ) type=innodb ; insert into Generator values(null); update Generator set Sequence

Auto_increment and TimeStamp Fields

2002-03-25 Thread Eric Baines
I have created a table with a Primary Key that is an auto_incrementing field. I was able to receive the auto_increment values by issuing a last_insert_id(). When I added a timestamp to this table, the last_insert_id() no longer returned any value except 0. Is there a MySQL rule that you can

Re: Auto_increment and TimeStamp Fields

2002-03-25 Thread Paul DuBois
At 14:54 -0500 3/25/02, Eric Baines wrote: I have created a table with a Primary Key that is an auto_incrementing field. I was able to receive the auto_increment values by issuing a last_insert_id(). When I added a timestamp to this table, the last_insert_id() no longer returned any value

Re: Auto_increment and TimeStamp Fields

2002-03-25 Thread Eric Baines
] To: Eric Baines [EMAIL PROTECTED], [EMAIL PROTECTED] cc: 03/25/02 03:02 PMSubject: Re: Auto_increment

**AUTO_INCREMENT Questions**

2002-02-18 Thread Kevin Gale
Hi. I'm converting a database from a filesharing based technology to mySQL. The database has its own column type called Sequence which is the same as using the AUTO_INCREMENT property. I'd like to use AUTO_INCREMENT if possible but I'm not really sure what I can do with it - can anybody help

Re: **AUTO_INCREMENT Questions**

2002-02-18 Thread DL Neil
Hi Kevin, I'm converting a database from a filesharing based technology to mySQL. The database has its own column type called Sequence which is the same as using the AUTO_INCREMENT property. I'd like to use AUTO_INCREMENT if possible but I'm not really sure what I can do with it - can

Re: auto_increment value recycled/reset in BDB table? [3.23.46]

2002-02-14 Thread Sinisa Milivojevic
Thank you, we shall investigate this problem. -- Regards, __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus ___/ www.mysql.com

Reset auto_increment

2002-02-13 Thread Wei Gao
Hi, As I am new to MySQL, perhaps this is a common question you have been asked. I have a field Id which using auto_increment. Now I want to reset the value of auto_increment, that is the Id starts form 1 and does not skip the number. I have spent a few hours to find a way, but all failed

RE: Reset auto_increment

2002-02-13 Thread Rick Emery
-it. -Original Message- From: Wei Gao [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 2:10 PM To: [EMAIL PROTECTED] Subject: Reset auto_increment Hi, As I am new to MySQL, perhaps this is a common question you have been asked. I have a field Id which using auto_increment. Now I

Re: auto_increment value recycled/reset in BDB table? [3.23.46]

2002-02-12 Thread Steven Haryanto
At 11/02/2002 05:21, Paul DuBois wrote: At 4:10 +0700 2/11/02, Steven Haryanto wrote: i believe since 3.23.39 it should not be? BDB and MyISAM tables have different properties with respect to AUTO_INCREMENT behavior. i see, so this is an undocumented feature (i haven't seen this in http

auto_increment value recycled/reset in BDB table? [3.23.46]

2002-02-12 Thread Steven Haryanto
i believe since 3.23.39 it should not be? mysql create table t1_b(i int unsigned primary key auto_increment, j int) type=bdb; mysql create table t1_m(i int unsigned primary key auto_increment, j int) type=myisam; mysql insert into t1_bdb(j)values(0); mysql insert into t1_bdb(j)values(0); mysql

auto_increment value recycled/reset in BDB table? [3.23.46]

2002-02-10 Thread Steven Haryanto
i believe since 3.23.39 it should not be? mysql create table t1_b(i int unsigned primary key auto_increment, j int) type=bdb; mysql create table t1_m(i int unsigned primary key auto_increment, j int) type=myisam; mysql insert into t1_bdb(j)values(0); mysql insert into t1_bdb(j)values(0); mysql

Re: auto_increment value recycled/reset in BDB table? [3.23.46]

2002-02-10 Thread Paul DuBois
At 4:10 +0700 2/11/02, Steven Haryanto wrote: i believe since 3.23.39 it should not be? BDB and MyISAM tables have different properties with respect to AUTO_INCREMENT behavior. mysql create table t1_b(i int unsigned primary key auto_increment, j int) type=bdb; mysql create table t1_m(i int

Re: auto_increment value recycled/reset in BDB table? [3.23.46]

2002-02-10 Thread Steven Haryanto
At 11/02/2002 05:21, Paul DuBois wrote: At 4:10 +0700 2/11/02, Steven Haryanto wrote: i believe since 3.23.39 it should not be? BDB and MyISAM tables have different properties with respect to AUTO_INCREMENT behavior. i see, so this is an undocumented feature (i haven't seen this in http

Reset auto_increment

2002-02-07 Thread Wei Gao
Hi, As I am new to MySQL, perhaps this is a common question you have been asked. I have a field Id which using auto_increment. Now I want to reset the value of auto_increment, that is the Id starts form 1 and does not skip the number. I have spent a few hours to find a way, but all failed

RE: Reset auto_increment

2002-02-07 Thread Rick Emery
-it. -Original Message- From: Wei Gao [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 2:10 PM To: [EMAIL PROTECTED] Subject: Reset auto_increment Hi, As I am new to MySQL, perhaps this is a common question you have been asked. I have a field Id which using auto_increment. Now I

RE: Reset auto_increment

2002-02-07 Thread Paul DuBois
while not deleting records, forget-about-it. ALTER TABLE tbl_name DROP id, ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, AUTO_INCREMENT = 1; But why do this? MySQL doesn't care if the sequence has holes in it or not. -Original Message- From: Wei Gao [mailto:[EMAIL PROTECTED]] Sent

RE: AUTO_INCREMENT columns randomly restart counting from 1

2002-02-04 Thread Andreas Schoelver
Hi Bruce 01.02.02 15:41:49, Bruce Stewart [EMAIL PROTECTED] wrote: Hi Andreas, I think AUTO_INCREMENT is on a per-connection basis. So if you're doing this across different database connections, it will reset to 0. [snip] do a 'select * from tablename where test=1' and you will see

RE: AUTO_INCREMENT columns randomly restart counting from 1

2002-02-01 Thread Andreas Schoelver
30.01.02 17:48:06, Richard Bolen [EMAIL PROTECTED] wrote: I think AUTO_INCREMENT is on a per-connection basis. So if you're doing this across different database connections, it will reset to 0. no, that's not the case. just try it. crate a table with column id as auto_increment int

Next auto_increment value?

2002-02-01 Thread Zak Grant
All, I'm a little (lot!) stuck on generating what seems to be quite a simple query... Example: I have a table with ID as auto_increment It contains values 1 to 10 I delete #7 How can I, using MySQL, say I have the number 6 - what's the next valid ID up/down from this? I'm looking for, quite

RE: Next auto_increment value?

2002-02-01 Thread Rick Emery
PROTECTED]] Sent: Friday, February 01, 2002 6:08 AM To: [EMAIL PROTECTED] Subject: Next auto_increment value? All, I'm a little (lot!) stuck on generating what seems to be quite a simple query... Example: I have a table with ID as auto_increment It contains values 1 to 10 I delete #7 How can I

RE: AUTO_INCREMENT columns randomly restart counting from 1

2002-02-01 Thread Bruce Stewart
Hi Andreas, I think AUTO_INCREMENT is on a per-connection basis. So if you're doing this across different database connections, it will reset to 0. [snip] do a 'select * from tablename where test=1' and you will see that the 2 new values will be visible to both of the clients. As I

RE: AUTO_INCREMENT columns randomly restart counting from 1

2002-02-01 Thread Fochtman, Michael
[mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 9:42 AM To: 'Andreas Schoelver'; [EMAIL PROTECTED] Subject: RE: AUTO_INCREMENT columns randomly restart counting from 1 Hi Andreas, I think AUTO_INCREMENT is on a per-connection basis. So if you're doing this across different

AUTO_INCREMENT columns randomly restart counting from 1

2002-01-30 Thread Andreas Schoelver
Hi there We have some table used as sequences. They only have 2 columns (ID, PID), with the AUTO_INCREMENT flag set for one of them (ID). By default the tables are empty! The increment process is done by inserting a new record with a random value for the non-auto_increment column. After

Re: AUTO_INCREMENT columns randomly restart counting from 1

2002-01-30 Thread Paul DuBois
At 17:15 +0100 1/30/02, Andreas Schoelver wrote: Hi there We have some table used as sequences. They only have 2 columns (ID, PID), with the AUTO_INCREMENT flag set for one of them (ID). Is the ID column one of the integer types? By default the tables are empty! The increment process is done

RE: AUTO_INCREMENT columns randomly restart counting from 1

2002-01-30 Thread Richard Bolen
I think AUTO_INCREMENT is on a per-connection basis. So if you're doing this across different database connections, it will reset to 0. Rich Hi there We have some table used as sequences. They only have 2 columns (ID, PID), with the AUTO_INCREMENT flag set for one of them (ID). By default

RE: Can Anyone explain / help with auto_increment fields.

2002-01-24 Thread Egor Egorov
free value. MD -Original Message- MD From: Christopher Thompson [mailto:[EMAIL PROTECTED]] MD Sent: 23 January 2002 22:29 MD To: [EMAIL PROTECTED]; [EMAIL PROTECTED] MD Subject: Re: Can Anyone explain / help with auto_increment fields. MD At 10:23 PM 1/23/2002 +, you wrote: Hi, I

Can Anyone explain / help with auto_increment fields.

2002-01-23 Thread Matthew Darcy
Hi, I have a blank table for some testing. 1 of the fields (the primary key) is an auto_increment and not null. how and what do I insert into this field to start off the recordsets. also once I have set the records going say to 1, what do I then insert if anything into this field for the next

Re: Can Anyone explain / help with auto_increment fields.

2002-01-23 Thread Christopher Thompson
At 10:23 PM 1/23/2002 +, you wrote: Hi, I have a blank table for some testing. 1 of the fields (the primary key) is an auto_increment and not null. how and what do I insert into this field to start off the recordsets. also once I have set the records going say to 1, what do I then insert

RE: Can Anyone explain / help with auto_increment fields.

2002-01-23 Thread Matthew Darcy
thanks a simple but effective explination. -Original Message- From: Christopher Thompson [mailto:[EMAIL PROTECTED]] Sent: 23 January 2002 22:29 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Can Anyone explain / help with auto_increment fields. At 10:23 PM 1/23/2002 +, you

RE: auto_increment

2002-01-16 Thread Rick Emery
PM To: [EMAIL PROTECTED] Subject: auto_increment Sorry if this is a newbie question, I've been through the manual, still can't figure it out. If one has created a table, with a key using auto_increment, how does one Insert data into it? If my table consists of (inID (primary key, auto

Re: auto_increment

2002-01-16 Thread Kyle Hayes
On Wednesday 16 January 2002 07:28, Hamlin Nicholas-qa568 wrote: Easier yet, when using DBI::mysql, is: my $IncrementedID = $dbh-{'mysql_insertid'}; When executed after the INSERT command. Does this now work with 64-bit auto-increment fields now in DBI? As of less than a year ago, DBI

auto_increment

2002-01-15 Thread Ben Curran
Sorry if this is a newbie question, I've been through the manual, still can't figure it out. If one has created a table, with a key using auto_increment, how does one Insert data into it? If my table consists of (inID (primary key, auto incremented), employeeID (foreign key) time, date). if I

Re: auto_increment

2002-01-15 Thread Rune Sandbakken
Ben Curran wrote: If one has created a table, with a key using auto_increment, how does one Insert data into it? Data is automatically inserted for you ;-) If my table consists of (inID (primary key, auto incremented), employeeID (foreign key) time, date). if I use $dbh-do(INSERT

auto_increment, creating table

2002-01-08 Thread Steve Bearss
what is wrong with this statement? mysql create table message (messageId AUTO_INCREMENT, timePosted VARCHAR(25), - userEmail VARCHAR(30), messagePosted MEDIUMBLOB); ERROR 1064: You have an error in your SQL syntax near 'AUTO_INCREMENT, timePoste d VARCHAR(25), userEmail VARCHAR(30

Re: auto_increment, creating table

2002-01-08 Thread Jeremy Zawodny
On Tue, Jan 08, 2002 at 04:56:52PM -0500, Steve Bearss wrote: what is wrong with this statement? mysql create table message (messageId AUTO_INCREMENT, timePosted VARCHAR(25), - userEmail VARCHAR(30), messagePosted MEDIUMBLOB); ERROR 1064: You have an error in your SQL syntax near

Re: auto_increment, creating table

2002-01-08 Thread DL Neil
Steve, what is wrong with this statement? mysql create table message (messageId AUTO_INCREMENT, timePosted VARCHAR(25), - userEmail VARCHAR(30), messagePosted MEDIUMBLOB); ERROR 1064: You have an error in your SQL syntax near 'AUTO_INCREMENT, timePoste d VARCHAR(25), userEmail

RE: auto_increment, creating table

2002-01-08 Thread Dan Jordan
to seeing your new book when it comes into print! Dan Jordan -Original Message- From: Jeremy Zawodny [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 08, 2002 3:02 PM To: Steve Bearss Cc: MySQL Info Subject: Re: auto_increment, creating table On Tue, Jan 08, 2002 at 04:56:52PM -0500, Steve

Re: auto_increment, creating table

2002-01-08 Thread Jeremy Zawodny
On Tue, Jan 08, 2002 at 04:16:49PM -0700, Dan Jordan wrote: Hi Jeremy, I just noticed your name today on the mysql mailing list and recognised your name. I'm a new user of MySQL and saw that you will soon have a new book out. Well yes, not the book that you think. :-) I'm working on a

auto_increment

2002-01-07 Thread Manish Mehta
Hi Is it possible auto_increment start 100 instead of 1 . for example create table a ( a int(10) primary key auto_increment 100); Manish Mehta E-mail: [EMAIL PROTECTED] - Before posting, please check: http

RE: auto_increment

2002-01-07 Thread John Lodge
Manish, If you manually insert a record with a value of 100 in the auto_increment field, then it will work from then on. If there is a way to create the table telling the value to start at 100, then I don't know what it is. Hope this is a help John Lodge -Original Message- From

RE: auto_increment

2002-01-07 Thread Daniel Backhausen
hi. yes it is possible. 1. Create an new column which has an auto_increment option 2. Insert the first dataset manually as followed: INSERT INTO test (auto, char) VALUES ('100', 'Hello World!') 3. From there on your auto column will count starting from 100, 101, 102, ... Greeting

Auto_Increment and the DELETE Statement

2002-01-07 Thread Rick Emery
I don't know if this is a bug or a feature. Just an observation concerning creating MYISAM tables with auto_increment. CREATE TABLE mytable (myval int auto_increment unique ) AUTO_INCREMENT=9000; INSERT INTO mytable VALUES(NULL); INSERT INTO mytable VALUES(NULL); these above INSERTS create

RE: auto_increment

2002-01-07 Thread Rick Emery
You can also set the auto_increment start value in the CREATE table: CREATE TABLE mytable ( myval int auto_increment) AUTO_INCREMENT=100; Note that the AUTO_INCREMENT=100 is set outside of the fields' definitions. However, when you delete all records with DELETE FROM mytable, the counter

Re: Auto_Increment and the DELETE Statement

2002-01-07 Thread Paul DuBois
At 16:52 -0600 1/7/02, Rick Emery wrote: I don't know if this is a bug or a feature. Just an observation concerning creating MYISAM tables with auto_increment. CREATE TABLE mytable (myval int auto_increment unique ) AUTO_INCREMENT=9000; INSERT INTO mytable VALUES(NULL); INSERT INTO mytable

incrementing a non auto_increment column on insert

2001-12-30 Thread Charley L. Tiggs
I have the ID column auto_incrementing and I don't want to change that. Newbie that I am, I tried to add auto_increment to another column and failed. Is there any way to have a field other than the ID field increment by a set value? create table test ( ID mediumint(9) NOT NULL

WISHLIST: auto_increment after delete

2001-12-03 Thread Christian Hammers
Hello MySQL developers please add a ALTER TABLE xyz eternal_auto_increment=1; that forces the auto_increment column to increment regardless of which table type I use and how I delete my columns. As long as there is a way to reset the column somehow (by setting it to -1 or so) I would

How Auto_INCREMENT works

2001-11-27 Thread Jurj Emil
Hi all, I have a question: I made a table with a field that is auto_increment. This field I made to be the primary key. In my opinion an auto_increment field should fill itself, without the intervention of the user. So if I have a table like: f1,f2 --field names, where f1 is auto_increment

How Auto_INCREMENT works

2001-11-27 Thread Giuseppe Maxia
Hi all, I have a question: I made a table with a field that is auto_increment. This field I made to be the primary key. In my opinion an auto_increment field should fill itself, without the intervention of the user. So if I have a table like: f1,f2 --field names, where f1

[BUG: mysqldump incorrectly generates INSERTs for AUTO_INCREMENT columns]

2001-11-23 Thread dima
Description: Say we have column named id int NOT NULL AUTO_INCREMENT Say we have record, where id=0 (why not?) Say we used mysqldump to backup our table. One day we tryied to restore our table, but we will never get record where id=0 back, becouse rule for AUTO_INCREMENT rows will apply. So

Re: Question on auto_increment

2001-11-23 Thread Carl Troein
??? You're both wrong. You should test it, and see for yourselves that unless you're using the old and obsolete ISAM table format, auto_increment values are NEVER reused. This, of course, is true if the auto_increment is on the first part of an index, and you don't delete all rows in the table

RE: Question on auto_increment

2001-11-23 Thread Alex Dowgailenko
If the colum is set to unique, it will fill in 2. If not, it'll automatically goto 4 (or vice versa if I'm mistaken). -Original Message- From: Jack [mailto:[EMAIL PROTECTED]] Sent: November 23, 2001 7:46 AM To: Mysql List Subject: Question on auto_increment I knew that if record

Question on auto_increment

2001-11-23 Thread Jack
I knew that if record at the Largest number of index being delete, the number will be reused, but i have a question: what happen if i delete the record which the index number is between the largest and the smallest, let say i have 3 records within my table, by some reason, i got to delete the

RE: dropping auto_increment PK/Index

2001-11-15 Thread Carsten H. Pedersen
Hi, Is it possible to drop an auto_increment column index or primary key to boost performance for bulk inserts? It seems mysql requires auto_increment columns to be a key at all times. Here is the error message: Incorrect table definition; There can only be one auto column and it must

AUTO_INCREMENT with TYPE = INNODB

2001-11-15 Thread Joe Ellis
FYI: im using mysql 3.23.44 auto_increment doesn't seem to work with InnoDB. i've tried to create a table with: create table some_table ( uid INT UNSIGNED AUTO_INCREMENT NOT NULL DEFAULT 1500, user VARCHAR(100) NOT NULL, PRIMARY KEY (uid), UNIQUE KEY (uid) ) TYPE=INNODB; i've

Re: AUTO_INCREMENT with TYPE = INNODB

2001-11-15 Thread Joe Ellis
thanks. i'll start it with the value i need. it increments after that ;) Heikki Tuuri wrote: Joe, sorry, I did not know AUTO_INCREMENT=... clause does not work with InnoDB. I will look if it is easy to fix. A workaround is that you insert the first row which the auto-inc column value

dropping auto_increment PK/Index

2001-11-14 Thread Wilfred Li, Ph.D.
Hi, Is it possible to drop an auto_increment column index or primary key to boost performance for bulk inserts? It seems mysql requires auto_increment columns to be a key at all times. Here is the error message: Incorrect table definition; There can only be one auto column and it must

Re: dropping auto_increment PK/Index

2001-11-14 Thread Jason Brooke
Maybe you could try insert delayed - Original Message - From: Wilfred Li, Ph.D. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 15, 2001 9:17 AM Subject: dropping auto_increment PK/Index Hi, Is it possible to drop an auto_increment column index or primary key

auto_increment counter changes even if query fails

2001-11-12 Thread Maciek Dobrzanski
Hi, Is this correct for MySQL to increment the auto_increment counter if the INSERT query fails? For example: mysql CREATE TABLE test ( i INT NOT NULL AUTO_INCREMENT, c CHAR(16) NOT NULL, PRIMARY KEY(i), UNIQUE(c)) type=InnoDB; Query OK, 0 rows affected (0.25 sec) mysql INSERT INTO test VALUES

Re: auto_increment counter changes even if query fails

2001-11-12 Thread Heikki Tuuri
Maciek, Hi, Is this correct for MySQL to increment the auto_increment counter if the INSERT query fails? For example: mysql CREATE TABLE test ( i INT NOT NULL AUTO_INCREMENT, c CHAR(16) NOT NULL, PRIMARY KEY(i), UNIQUE(c)) type=InnoDB; Query OK, 0 rows affected (0.25 sec) mysql INSERT

Re: auto_increment counter changes even if query fails

2001-11-12 Thread Heikki Tuuri
Maciek, Hi, Is this correct for MySQL to increment the auto_increment counter if the INSERT query fails? For example: mysql CREATE TABLE test ( i INT NOT NULL AUTO_INCREMENT, c CHAR(16) NOT NULL, PRIMARY KEY(i), UNIQUE(c)) type=InnoDB; Query OK, 0 rows affected (0.25 sec) mysql INSERT

Re: auto_increment counter changes even if query fails

2001-11-12 Thread Heikki Tuuri
Maciek, Hi, Is this correct for MySQL to increment the auto_increment counter if the INSERT query fails? For example: mysql CREATE TABLE test ( i INT NOT NULL AUTO_INCREMENT, c CHAR(16) NOT NULL, PRIMARY KEY(i), UNIQUE(c)) type=InnoDB; Query OK, 0 rows affected (0.25 sec) mysql INSERT

Re: auto_increment counter changes even if query fails

2001-11-12 Thread Heikki Tuuri
Maciek, Hi, Is this correct for MySQL to increment the auto_increment counter if the INSERT query fails? For example: mysql CREATE TABLE test ( i INT NOT NULL AUTO_INCREMENT, c CHAR(16) NOT NULL, PRIMARY KEY(i), UNIQUE(c)) type=InnoDB; Query OK, 0 rows affected (0.25 sec) mysql INSERT

Re: auto_increment counter changes even if query fails

2001-11-12 Thread Heikki Tuuri
Maciek, Hi, Is this correct for MySQL to increment the auto_increment counter if the INSERT query fails? For example: mysql CREATE TABLE test ( i INT NOT NULL AUTO_INCREMENT, c CHAR(16) NOT NULL, PRIMARY KEY(i), UNIQUE(c)) type=InnoDB; Query OK, 0 rows affected (0.25 sec) mysql INSERT

<    1   2   3   4   5   6   7   >