Re: auto-increment more than one field

2013-05-14 Thread Jan Steinman
> From: rounak jain > > I have a table which needs two fields with auto-increment. I don't know if you have such control over your installation, but you might consider the work-alike MariaDB, which I believe supports auto-increment on multiple fields, as well as a slew of other features. (Virt

Re: auto-increment more than one field

2013-05-12 Thread Michael Dykman
refer to http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html On Sun, May 12, 2013 at 9:39 AM, rounak jain wrote: > I have a table which needs two fields with auto-increment. > I have the found the answer here: > > http://stackoverflow.com/questions/13642915/mysql-table-with-more-than-

Re: Auto-Increment Values in Mysql

2011-02-09 Thread Jan Steinman
> From: Adarsh Sharma > > I have an auto-increment column in Mysql database table. Let's say the column > has below values : I'll echo what others have said. Auto-increment is typically used to generate unique primary keys. If this column is your primary key, DO NOT change its value! PK = ide

Re: Auto-Increment Values in Mysql

2011-02-09 Thread Reindl Harald
You do not want this really from the point you understood what a primary key does in a database The PRIKEY is unqiue for a record and if the record does no longer exist his PRIKEY must never return Sample: * website * shop-products * you have prodid 500 costs 200$ * you delete the product * there

Re: Auto-Increment Values in Mysql

2011-02-09 Thread Mark Goodge
On 09/02/2011 11:41, Adarsh Sharma wrote: Dear all, I have an auto-increment column in Mysql database table. Let's say the column has below values : 1 2 3 4 5 6 7 8 9 10 Now if i deleted some rows where id= 3 ,5 and 8 The data look like as : 1 2 4 6 7 9 10 I want to have it id's as 1 2 3

Re: Auto Increment in InnoDB

2010-04-23 Thread Johan De Meersman
It might also be done by keeping a last-revision table. Then you'd only select 1 record from that, and up the number. On Thu, Apr 22, 2010 at 5:34 PM, Chris W <4rfv...@cox.net> wrote: > Johan De Meersman wrote: > >> On Thu, Apr 22, 2010 at 1:34 PM, Carsten Pedersen > >wrote: >> >> >> >>> Wouldn

Re: Auto Increment in InnoDB

2010-04-22 Thread Chris W
Johan De Meersman wrote: On Thu, Apr 22, 2010 at 1:34 PM, Carsten Pedersen wrote: Wouldn't that strategy cause problems if one or more rows have been deleted in the meantime? (i.e. sequence numbers 1-4 have been created, row 2 has been deleted - new sequence number would be 4). Yeps

Re: Auto Increment in InnoDB

2010-04-22 Thread mos
At 12:03 AM 4/22/2010, Aveek Misra wrote: I have a InnoDB table which contains columns named 'cluster' and 'file' ('cluster' + 'file' is a primary key). I want to add a new column that tracks the revision number of a file for a given cluster and a file. The situation is tailor made for a MyIsam

Re: Auto Increment in InnoDB

2010-04-22 Thread Johan De Meersman
On Thu, Apr 22, 2010 at 1:34 PM, Carsten Pedersen wrote: > Wouldn't that strategy cause problems if one or more rows have been > deleted in the meantime? (i.e. sequence numbers 1-4 have been created, row > 2 has been deleted - new sequence number would be 4). > Yeps. I'm none too sharp today, ap

Re: Auto Increment in InnoDB

2010-04-22 Thread Carsten Pedersen
On Thu, 22 Apr 2010 13:12:16 +0200, Johan De Meersman wrote: > Kudos for managing to drag up such an obscure piece of functionality :-) I > can see where it would be useful, though. > > As to your question, though: given that that page indicates that it will > reuse deleted sequence numbe

Re: Auto Increment in InnoDB

2010-04-22 Thread Johan De Meersman
The count happens after the where on an index - it should just count the appropriate index rows without looking at the values. Worth benchmarking on your dataset, though. On Thu, Apr 22, 2010 at 1:22 PM, Aveek Misra wrote: > How can count(*) in an InnoDB table be faster than MAX() considering t

Re: Auto Increment in InnoDB

2010-04-22 Thread Aveek Misra
How can count(*) in an InnoDB table be faster than MAX() considering that the former needs to do a table scan and the latter can use an index if correctly used? My code starts the sequence from 1. Thanks Aveek Johan De Meersman wrote: Kudos for managing to drag up such an obscure piece of func

Re: Auto Increment in InnoDB

2010-04-22 Thread Johan De Meersman
Kudos for managing to drag up such an obscure piece of functionality :-) I can see where it would be useful, though. As to your question, though: given that that page indicates that it will reuse deleted sequence numbers, I think your best bet would be select @id := count(*)+1 from table where clu

Re: Auto Increment in InnoDB

2010-04-22 Thread Aveek Misra
MyISAM has this really cool feature where you can specify autoincrement on a secondary column in a multiple column index. In such a case the generated value for the autoincrement column is calculated as MAX(autoincrement column) + 1 WHERE prefix='given-prefix'. For more refer to http://dev.mys

Re: Auto Increment in InnoDB

2010-04-22 Thread Johan De Meersman
On Thu, Apr 22, 2010 at 12:09 PM, Aveek Misra wrote: > I am not sure I understand. If I make the autoincrement column as part of > the primary key as (rev + cluster + file), how do I ensure that a reset of > the revision number is done as soon as (cluster + file) combination changes? > You want

Re: Auto Increment in InnoDB

2010-04-22 Thread Aveek Misra
I am not sure I understand. If I make the autoincrement column as part of the primary key as (rev + cluster + file), how do I ensure that a reset of the revision number is done as soon as (cluster + file) combination changes? It looks like I need to do the following to mimic the same behavior a

Re: Auto Increment in InnoDB

2010-04-22 Thread Johan De Meersman
You can't, iirc - if you add an autoincrement to InnoDB it MUST be the primary key. You *can*, however, add that, set it as PK and stick a unique index on (cluster, file) instead. Behaviour will be identical, but be aware that there will be some performance implications - you will now have to do a

Re: Auto Increment Problem

2009-12-05 Thread Victor Subervi
Oops. Never mind. V On Sat, Dec 5, 2009 at 1:19 PM, Victor Subervi wrote: > Hi; > > mysql> insert into categories (Category, Parent) values ('test', NULL); > ERROR 1062 (23000): Duplicate entry '0' for key 1 > mysql> describe categories; > +--+-+--+-+-+

Re: Auto increment?

2009-04-02 Thread Scott Haneda
I read your other replies about the timestamp not working. I still think adding the updated and created fields is a good idea in general, to any table. I have some questions about the below since the original suggestion would not work for you. On Apr 2, 2009, at 12:35 AM, Andreas Pardeike

Re: Auto increment?

2009-04-02 Thread Andreas Pardeike
Steve & Scott, Thanks for the suggestions. The problem with a timestamp is that it's not fine granular. The consumer application can record last_poll_time and if it is X then either of the following will not work: 1) select * from table where tstamp >= X -> this fails because it will receive r

Re: Auto increment?

2009-04-02 Thread Scott Haneda
On Apr 2, 2009, at 12:51 AM, Steve Edberg wrote: At 9:35 AM +0200 4/2/09, Andreas Pardeike wrote: Hi, I have a table 'test' +-+--+--+-+--- ++ | Field | Type | Null | Key | Default | Extra | +-+-

Re: Auto increment?

2009-04-02 Thread Steve Edberg
At 9:35 AM +0200 4/2/09, Andreas Pardeike wrote: Hi, I have a table 'test' +-+--+--+-+---++ | Field | Type | Null | Key | Default | Extra | +-+--+--+-+---+---

Re: auto increment format

2007-08-08 Thread Brent Baisley
If you are going to implement real security, it shouldn't matter if someone nows the "unique id" of a record. You should be checking if they have the right to see that record. But regardless, there is an easy way to set random ids as your "unique" identifier. Setup 2 fields, one being the r

Re: auto increment format

2007-08-07 Thread David T. Ashley
On 8/7/07, Boyd Hemphill <[EMAIL PROTECTED]> wrote: > > Suggestions to use a hash are a problem because once you have a few > million rows the likelihood of a collision is quite high if you cannot > afford an error stopping your application. This means that if you write a > trigger (the obvious wa

Re: Auto increment Primary Index fields in replicated db

2006-03-13 Thread Kishore Jalleda
Please refer to these two links, they would give you a clear explaination. there is also an example in the second link which you can easily test . http://dev.mysql.com/doc/refman/5.0/en/replication-auto-increment.html http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html ( scroll

Re: auto-increment by a specific number

2005-04-18 Thread gerald_clark
StinkyPup wrote: How do I auto-increment by a specific number. For example by 100: You dont. IDData 100 blah blah blah 200 blah blah foo ALTER TABLE PRODUCT AUTO_INCREMENT = 100 doesn't do what I want to do. TIA -- MySQL General Mailing List For list archives: http://lists.

Re: auto-increment stops at 127

2005-02-14 Thread Alec . Cawley
"mel list_php" <[EMAIL PROTECTED]> wrote on 14/02/2005 13:54:35: > additional test, > it is always bugging at the key 127... > I put a backup online, with until 106. > Added few test records, from key 127 it just doesn't want to increment the > auto-increment field anymore. > I'm completly lost

Re: auto-increment field stops working

2005-02-14 Thread Johan Höök
Hi, could you check to make absolutely sure that your taskId column isn't tinyint, which should explain it as it's max ( being signed ) is 127. /Johan mel list_php wrote: Hi list, I have a very strange (and worrying..!!!) problem with my tables. I'm running a 4.0.9 gamma (no choice for that) adn I

RE: auto-increment stops at 127

2005-02-14 Thread Mark Leith
Change the column from a TINYINT (which has a maximum value of 127), see here: http://dev.mysql.com/doc/mysql/en/numeric-types.html HTH Mark Mark Leith Cool-Tools UK Limited http://www.cool-tools.co.uk -Original Message- From: mel list_php [mailto:[EMAIL PROTECTED] Sent: 14 February

Re: auto-increment question

2005-01-24 Thread leegold
Oh, myqldump automatically records the current auto-increment when it dumps in the .sql file... That explains it... On Mon, 24 Jan 2005 17:10:11 -0500, "leegold" <[EMAIL PROTECTED]> said: > > On Mon, 24 Jan 2005 12:34:38 +0200, "Gleb Paharenko" > <[EMAIL PROTECTED]> said: > > Hello. > > > > Not

Re: auto-increment question

2005-01-24 Thread leegold
On Mon, 24 Jan 2005 12:34:38 +0200, "Gleb Paharenko" <[EMAIL PROTECTED]> said: > Hello. > > Not enough information to make a conclusion. Please, send us information > about MySQL and operating system versions. Output of "show create table" > statement on your tables. Could you make a reproducabl

Re: auto-increment question

2005-01-24 Thread Gleb Paharenko
Hello. Not enough information to make a conclusion. Please, send us information about MySQL and operating system versions. Output of "show create table" statement on your tables. Could you make a reproducable test case? "leegold" <[EMAIL PROTECTED]> wrote: > I have two different database

Re: auto-increment question

2005-01-23 Thread leegold
Now I'm confused the auto-increment number reverted back to one (1) after I truncated the tables in one of the DB's. I suppose as long as the number is unique within the objects I'm making selections, updates...ect in - who cares. On Sun, 23 Jan 2005 02:18:33 -0500, "leegold" <[EMAIL PROTECTED]>

Re: Auto-Increment Starting Point? (Multimaster Replication Question)

2004-11-19 Thread Gary Richardson
The binary logs used for replication set the value used for autoincrementing before each insert query. The number on the master will always be replicated properly. If a row already exists with the autoincrement value, my guess is that replication will die with an error. I'm not too sure which vers

RE: Auto-Increment Starting Point? (Multimaster Replication Question)

2004-11-18 Thread Peter Lovatt
5001 Peter > -Original Message- > From: Robinson, Eric [mailto:[EMAIL PROTECTED] > Sent: 18 November 2004 21:35 > To: [EMAIL PROTECTED] > Subject: Auto-Increment Starting Point? (Multimaster Replication > Question) > > > When you set a field to auto-increment, can you tell it where to s

Re: auto increment fields

2004-09-20 Thread SGreen
By replacing deleted records with new information, you run the risk of misidentifying data in related tables. What if you had a record in a table called "person" with an ID of 6 that belonged to Mary Jones. You delete it and create a new record 6 for Bob Mondo? Let's say you have a related tab

RE: auto increment fields

2004-09-19 Thread Osvaldo Sommer
Hi Mike: Instead off delete a record, i would put a status field to indicate that the record is deleted, and create a function that returns the key of the first record with the deleted status for reuse, and in case that there is no record to reuse, to create a new one and return that key. But you

Re: auto increment fields

2004-09-19 Thread Andrew Kreps
On Sun, 19 Sep 2004 23:59:02 +0300, Mike <[EMAIL PROTECTED]> wrote: > hi. > I have a rather childish question on tables and auto increment fields. > Scenario: I have a table with an field. The > deal is that everything works fine (I'm talking about the auto > incrementation part) > until I choose

Re: Auto Increment Column

2004-08-12 Thread Cemal Dalar
mmy System Administrator & Web Developer http://www.dalar.net - Original Message - From: "Naresh Sadhnani" <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, August 12, 2004 3:35 PM Subject: RE: Auto Increment Co

RE: Auto Increment Column

2004-08-12 Thread Naresh Sadhnani
: 12 August 2004 13:25 To: Naresh Sadhnani; [EMAIL PROTECTED] Subject: Re: Auto Increment Column | Subject: Auto Increment Column | | Hi, | | Does anyone know how to extract only the Auto_Increment column from | the command results of "SHOW TABLE STATUS" Do you mean that you want a co

Re: Auto Increment Column

2004-08-12 Thread Rhino
| Subject: Auto Increment Column | | Hi, | | Does anyone know how to extract only the Auto_Increment column from the | command results of "SHOW TABLE STATUS" Do you mean that you want a command that will run on the command line that will show the value of the Auto_Increment column? Or are you try

Re: auto increment using even numbers

2003-12-19 Thread Paul DuBois
At 16:26 -0800 12/19/03, K Q-B wrote: I am creating a table and would like to use auto increment, but I would like one column to increment in only odd numbers 1,3,5... and another column of the same table to increment in even numbers 2,4,6... Is it possible to do this? Not using an AUTO_INCREMENT c

Re: auto increment using even numbers

2003-12-19 Thread Tobias Asplund
On Fri, 19 Dec 2003, K Q-B wrote: > I am creating a table and would like to use auto > increment, but I would like one column to increment in > only odd numbers 1,3,5... and another column of the > same table to increment in even numbers 2,4,6... > > Is it possible to do this? Not without a little

Re: Auto increment sequence

2003-10-27 Thread bluejack
On Mon, 27 Oct 2003 15:24:37 -0500, Priyanka Gupta <[EMAIL PROTECTED]> wrote: Is there a way in mYSQL to just define an auto increment sequence rather than defining a field inside a table which is an auto increment. Bsically I need some functionality similarto that in ORACLE where CREATE SEQUENC

Re: auto increment

2003-09-25 Thread Egor Egorov
"Louie Miranda" <[EMAIL PROTECTED]> wrote: > When i exported the data, i found an option on the lower part of the sql > code. > >> ) TYPE=MyISAM AUTO_INCREMENT=0 ; > > I tried to make a table again, and when i entered it resets to whatever > options i last type it on the "AUTO_INCREMENT=0" value.

Re: auto increment

2003-09-24 Thread Louie Miranda
: Thursday, September 25, 2003 11:00 AM Subject: RE: auto increment Hi, Check the behaviour of auto_increment in the change logs - it changed from using the highest available number to carrying on from where it left off some time ago, but I believe there is a was to reset it manually. Hope t

RE: auto increment

2003-09-24 Thread Quentin Bennett
Hi, Check the behaviour of auto_increment in the change logs - it changed from using the highest available number to carrying on from where it left off some time ago, but I believe there is a was to reset it manually. Hope this helps. Quentin Bennett Senior Analyst Infinity Solutions Ltd PO Box

RE: Auto Increment ID of Inserted Row

2003-09-04 Thread Dan Greene
eene > Cc: [EMAIL PROTECTED] > Subject: Re: Auto Increment ID of Inserted Row > > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Dan Greene wrote: > > > (newbie to MySQL) > > > > I've been banging my head against the wall on this one for >

Re: Auto Increment ID of Inserted Row

2003-09-02 Thread Mark Matthews
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dan Greene wrote: > (newbie to MySQL) > > I've been banging my head against the wall on this one for a bit now, and I understand that last_insert_id() is per-connection based, but most webapps are connection pooled (simple) or clustered (harder). Wha

Re: Auto Increment ID of Inserted Row

2003-09-02 Thread Dan Greene
(newbie to MySQL) I've been banging my head against the wall on this one for a bit now, and I understand that last_insert_id() is per-connection based, but most webapps are connection pooled (simple) or clustered (harder). What are my options to get the id of the inserted row in a webapp? As a

Re: auto increment

2003-01-06 Thread vinita Vigine Murugiah
DuBois" <[EMAIL PROTECTED]> To: "vinita Vigine Murugiah" <[EMAIL PROTECTED]>; "kayamboo" <[EMAIL PROTECTED]>; "mysql" <[EMAIL PROTECTED]> Sent: Monday, January 06, 2003 10:49 PM Subject: Re: auto increment At 14:34 +1100 1/7/03, vinita V

Re: auto increment

2003-01-06 Thread Paul DuBois
site-key, multiple-independent-sequences the way he wants. :-) Matt - Original Message - From: "Paul DuBois" <[EMAIL PROTECTED]> To: "vinita Vigine Murugiah" <[EMAIL PROTECTED]>; "kayamboo" <[EMAIL PROTECTED]>; "mysql" <[EMAIL P

Re: auto increment

2003-01-06 Thread Matt Hargraves
e Murugiah" <[EMAIL PROTECTED]>; "kayamboo" <[EMAIL PROTECTED]>; "mysql" <[EMAIL PROTECTED]> Sent: Monday, January 06, 2003 10:49 PM Subject: Re: auto increment > At 14:34 +1100 1/7/03, vinita Vigine Murugiah wrote: > >HI > > > >kayam

Re: auto increment

2003-01-06 Thread Paul DuBois
d automatically!! regards - Original Message - From: "vinita Vigine Murugiah" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, January 07, 2003 11:35 AM Subject: Re: auto increment HI ALL I couldn't have an auto-increment in ver 3.23.53 for the table

Re: auto increment

2003-01-06 Thread vinita Vigine Murugiah
nt the ID to be incremented automatically!! regards - Original Message - From: "vinita Vigine Murugiah" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, January 07, 2003 11:35 AM Subject: Re: auto increment HI ALL I couldn't have an auto-inc

Re: auto increment

2003-01-06 Thread vinita Vigine Murugiah
HI ALL I couldn't have an auto-increment in ver 3.23.53 for the table INNODB, mysql> CREATE TABLE roomLockAuto ( -> roomNum CHAR(20) NOT NULL, -> id INT(2) unsigned zerofill NOT NULL auto_increment, -> lockNum CHAR(20) NOT NULL, -> PRIMARY KEY (roomNum, id) -> ) TYPE=INN

Re: auto increment question

2003-01-04 Thread Stefan Hinz, iConnect \(Berlin\)
Kevin, > I have a table with an ID column and a viewed column. I would like the > viewed column to increment by one each time the row is updated. > Stats > === > ID > views UPDATE Stats SET Views = Views + 1 WHERE ID = (selected row) Or is there more behind this question? Regards, -- Stef

Re: auto increment question

2003-01-04 Thread Arthur Fuller
sage - From: "Adolfo Bello" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 03, 2003 7:15 PM Subject: RE: auto increment question > It sounds to me that a trigger would help, but mysql doesn't has them > yet. > > Adolfo > > >

RE: auto increment question

2003-01-03 Thread Adolfo Bello
It sounds to me that a trigger would help, but mysql doesn't has them yet. Adolfo > -Original Message- > From: Paul DuBois [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 03, 2003 8:04 PM > To: Kevin; [EMAIL PROTECTED] > Subject: Re: auto increment question >

RE: auto increment question

2003-01-03 Thread Adolfo Bello
It sounds to me that a trigger would help, but mysql doesn't has them yet. Adolfo > -Original Message- > From: Paul DuBois [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 03, 2003 8:04 PM > To: Kevin; [EMAIL PROTECTED] > Subject: Re: auto increment question >

Re: auto increment question

2003-01-03 Thread Paul DuBois
At 15:28 -0800 1/3/03, Kevin wrote: Hello, I have a table with an ID column and a viewed column. I would like the viewed column to increment by one each time the row is updated. Stats === ID views is this possible? Sure. Since you're updating the row anyway, set the column value to one m

Re: auto increment value in tables

2002-10-15 Thread Jim Lundeen
as far as i know, you can only have one auto_increment field. you'd have insert, then grab the id and update that record, just like you've said. make sure that you grab the last assigned id using a valid method. if it's a sign-up form, do something like the following to make sure you are actua

Re: Auto Increment ID of Inserted Row

2002-09-19 Thread Dan Nelson
In the last episode (Sep 19), Steven Kreuzer said: > >What is the SQL to get the created AutoInc ID from a row that I have > >just inserted? > > SELECT MAX(id_field) FROM table Nope. If someone else inserted a record between the time you inserted yours and the time you run that select, your answ

RE: Auto Increment ID of Inserted Row

2002-09-19 Thread Tam, Michael
not be id you are expecting. Regards, Michael -Original Message- From: Steven Kreuzer [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 10:24 AM To: Davis, Tim Cc: Mysql (E-mail) Subject: Re: Auto Increment ID of Inserted Row SELECT MAX(id_field) FROM table SK On Thursday

Re: Auto Increment ID of Inserted Row

2002-09-19 Thread Rodney Broom
From: Steven Kreuzer <[EMAIL PROTECTED]> > SELECT MAX(id_field) FROM table > On Thursday, September 19, 2002, at 12:55 PM, Davis, Tim wrote: > > What is the SQL to get the created AutoInc ID from a row that I > > have just inserted? More formally, you can do this: SELECT LAST_INSERT_ID(); -

Re: Auto Increment ID of Inserted Row

2002-09-19 Thread Paul DuBois
At 13:23 -0400 9/19/02, Steven Kreuzer wrote: >SELECT MAX(id_field) FROM table That won't give you the correct answer if some other client gets in there an inserts a row before you have a change to get the MAX() value. LAST_INSERT_ID() is designed for this; it's not affected by whatever other cl

Re: Auto Increment ID of Inserted Row

2002-09-19 Thread Steven Kreuzer
SELECT MAX(id_field) FROM table SK On Thursday, September 19, 2002, at 12:55 PM, Davis, Tim wrote: > What is the SQL to get the created AutoInc ID from a row that I have > just > inserted? > > Tim Davis > Sunbelt Systems Concepts, Inc > [EMAIL PROTECTED] > Client/Server Database Programmer/Ana

Re: Auto Increment ID of Inserted Row

2002-09-19 Thread Paul DuBois
At 12:55 -0400 9/19/02, Davis, Tim wrote: >What is the SQL to get the created AutoInc ID from a row that I have just >inserted? SELECT LAST_INSERT_ID(); Seems like there's an echo in here...this question has been asked about 4 times in the last couple of days. :-) > >Tim Davis >Sunbelt Syste

Re: auto increment as primary key

2002-08-16 Thread Dan Nelson
In the last episode (Aug 16), Fr. Robert Bower said: > Is it a good idea to use an auto increment field as a primary key in mysql? > I know in some products like paradox it is a bad idea because of possible > corruption problems down the road? If you get corrupt databases, don't blame the primary

Re: auto increment as primary key

2002-08-16 Thread David Lloyd
Father, [ mysql, query ] > Is it a good idea to use an auto increment field as a primary key in mysql? > I know in some products like paradox it is a bad idea because of possible > corruption problems down the road? I don't believe there would be any problems in the latest versions of MySQL; o

Re: auto-increment usage question

2002-07-12 Thread Gerald Clark
I verified his problem with 3.23.38 here using myisam files. The key here is that the unique index is across TWO integer fields, one of which is auto_increment. Victoria Reznichenko wrote: >Richard, >Thursday, July 11, 2002, 7:26:00 PM, you wrote: > >RF> But the default table type is already MyI

Re: Re: auto-increment usage question

2002-07-12 Thread Victoria Reznichenko
Richard, Thursday, July 11, 2002, 7:26:00 PM, you wrote: RF> But the default table type is already MyISAM If you didn't set up another default table type. Please, show us the output of SHOW TABLE STATUS LIKE "your_table_name"; Can you create a repeatable testcase? And some more info.. Wha

Re: auto-increment usage question

2002-07-11 Thread Richard Fox
But the default table type is already MyISAM > That is the normal behavior for ISAM type files. > Convert them to MYISAM. > > Richard Fox wrote: > > >>Hi, > >> > >>I have a mysql table which has a run_id which together with user_id forms > >> > >the > > > >>primary key for the table. run_id is no

Re: auto-increment usage question

2002-07-10 Thread Gerald Clark
That is the normal behavior for ISAM type files. Convert them to MYISAM. Richard Fox wrote: >>Hi, >> >>I have a mysql table which has a run_id which together with user_id forms >> >the > >>primary key for the table. run_id is not null and auto-increment. I delete >>records from this table, and a

Re: auto-increment usage question

2002-07-10 Thread Richard Fox
> > Hi, > > I have a mysql table which has a run_id which together with user_id forms the > primary key for the table. run_id is not null and auto-increment. I delete > records from this table, and add new records. I want the run_id to keep > incrementing and not reuse values, but here is the actu

Re: Auto-increment across multiple tables / Atomicity of update statements

2002-06-13 Thread Joseph Bueno
Andy Sy a écrit : > > In MySQL, > > I want to use an auto-incrementing value that works > across multiple tables. For example I have 3 tables > forumA, forumB, forumC, each of which has a primary > key field called 'msgnum'. However, if I declare > 'msgnum' auto_increment, 'msgnum' will not be >

Re: Auto-increment across multiple tables / Atomicity of updatestatements

2002-06-12 Thread Arjen Lentz
Hi Andy, On Thu, 2002-06-13 at 05:02, Andy Sy wrote: > I want to use an auto-incrementing value that works > across multiple tables. For example I have 3 tables > forumA, forumB, forumC, each of which has a primary > key field called 'msgnum'. However, if I declare > 'msgnum' auto_increment,

RE: Auto-increment across multiple tables / Atomicity of update statements

2002-06-12 Thread Lopez David E-r9374c
Andy 2) Locks are by thread. If thread dies, so does it's lock. David > -Original Message- > From: Andy Sy [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 12, 2002 12:03 PM > To: [EMAIL PROTECTED] > Subject: Auto-increment across multiple tables / Atomicity of update > statements

Re: auto-increment across multiple tables / Atomicity of update statements

2002-06-12 Thread Andy Sy
In MySQL, I want to use an auto-incrementing value that works across multiple tables. For example I have 3 tables forumA, forumB, forumC, each of which has a primary key field called 'msgnum'. However, if I declare 'msgnum' auto_increment, 'msgnum' will not be unique across the 3 tables.

Re: Auto increment (Newbie)

2002-05-29 Thread Ray a PowerWeb Tech
manual_Reference.html#CREATE_TABLE >create_definition: > col_name type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT] >[PRIMARY KEY] [reference_definition] create table MyTestTable(cno int AUTO_INCREMENT, name varchar(20)); can't seem to find the ref right now, but < i

Re: auto increment problem

2002-02-25 Thread Rodney Broom
From: Chetan Lavti <[EMAIL PROTECTED]> > 1. When I am inserting the values and the Query fails, the increment > should not took place and It doesn't. > 2. When I delete a particular row from the table there should not be any > gap in the auto increment sequence. This doesn't work. Although y

Re: auto increment problem

2002-02-25 Thread Paul DuBois
At 0:44 +0530 2/26/02, Chetan Lavti wrote: >hi, >I creating a table where I am using one field as Auto Increment. I want >to know two things or rather I want to do to thinks for the same column > >1. When I am inserting the values and the Query fails, the increment >should not took place and >2. W

RE: auto increment problem

2002-02-25 Thread Rick Emery
1. The auto_increment will not occur on failure. Try it yourself to verify; I did. 2. When you delete a row, you DO NOT WANT the auto-increment to re-number. You SHOULD have gaps. Why? Because if the auto_incremented field is a primary key, and there are other tables who fields refer to that

Re: Auto Increment field duplicate key ...

2002-02-12 Thread Hank Marquardt
Just for further puzzlement -- I've run 'check table extended' on the table, dropped the table and reloaded it, shut down the server and restarted it ... all to the same effect. First insert to the table is the 214... integer limit then duplicate key errors. On Sat, Feb 09, 2002 at 11:18:08AM -

Re: Auto Increment field duplicate key ...

2002-02-09 Thread Hank Marquardt
Just for further puzzlement -- I've run 'check table extended' on the table, dropped the table and reloaded it, shut down the server and restarted it ... all to the same effect. First insert to the table is the 214... integer limit then duplicate key errors. On Sat, Feb 09, 2002 at 11:18:08AM -

RE: auto increment

2001-12-04 Thread Rick Emery
You can't, except programmatically. That is, -Original Message- From: Yamin Prabudy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 3:04 PM To: [EMAIL PROTECTED] Subject: auto increment Hi there I have an auto increment table that starts with number 1,2,3, and so on...

Re: Auto Increment Fields

2001-10-05 Thread Kyle Hayes
On Thursday 04 October 2001 13:37, Paul DuBois wrote: > At 4:08 PM -0400 10/4/01, Jason Frisvold wrote: > >Is there a way to have DBI return the value of the auto-incremented field > >upon insert? Or do I have to insert and then do a select afterwards? > > $dbh->do ("your insert statement"); > $a

RE: Auto Increment Fields

2001-10-05 Thread Jason Frisvold
y, and I'm not sure about the former." -- Albert Einstein [1879-1955] -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 04, 2001 4:37 PM To: Jason Frisvold; '[EMAIL PROTECTED]' Subject: Re: Auto Increment Fields At 4:08 PM -0400

RE: auto increment problems

2001-10-04 Thread Paul DuBois
ew table first. > >Thanks > > >-Original Message- >From: Will French [mailto:[EMAIL PROTECTED]] >Sent: Thursday, October 04, 2001 1:50 PM >To: MySQL >Subject: RE: auto increment problems > > >> Error: 1062 - Duplicate entry '2147483647' for key 1 >T

Re: Auto Increment Fields

2001-10-04 Thread Paul DuBois
At 4:08 PM -0400 10/4/01, Jason Frisvold wrote: >Is there a way to have DBI return the value of the auto-incremented field >upon insert? Or do I have to insert and then do a select afterwards? $dbh->do ("your insert statement"); $auto_inc = $dbh->{mysql_insertid}; -- Paul DuBois, [EMAIL PROTEC

RE: Auto Increment Fields

2001-10-04 Thread Don Read
On 04-Oct-2001 Jason Frisvold wrote: > Is there a way to have DBI return the value of the auto-incremented field > upon insert? Or do I have to insert and then do a select afterwards? > $sth->insertid; -- Don Read [EMAIL PROTECTED] -- It's always darkes

RE: auto increment problems

2001-10-04 Thread Schmidt, Allen J.
-Original Message- From: Will French [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 04, 2001 1:50 PM To: MySQL Subject: RE: auto increment problems > Error: 1062 - Duplicate entry '2147483647' for key 1 That number is the largest number which can be stored in a signe

RE: auto increment problems

2001-10-04 Thread Will French
> Error: 1062 - Duplicate entry '2147483647' for key 1 That number is the largest number which can be stored in a signed 32-bit (INT) field. As I rather doubt that your table contains > 2 billion rows, I am betting that your auto-numbers are starting at 1. My advice would be to create a new table

RE: auto increment problems

2001-10-04 Thread Will French
> Error: 1062 - Duplicate entry '2147483647' for key 1 That number is the largest number which can be stored in a signed 32-bit (INT) field. As I rather doubt that your table contains > 2 billion rows, I am betting that your auto-numbers are starting at 1. My advice would be to create a new table

RE: AUTO INCREMENT Q U E S T I O N in MySQL

2001-07-08 Thread Edward Surov
You should refer to manual, your case depends on the type of your table. MyISAM tables do assign new number always, and there's some another kind of table which is reusing numbers the same way you need. I don't remember what type exactly, so refer to the manual. -Original Message- From:

Re: auto-increment & sequence question

2001-06-27 Thread Gunnar von Boehn
thank you all for your help, this was the explanation I needed, >LAST_INSERT_ID() with an argument creates a value that can be treated >just like it's an AUTO_INCREMENT value. That means you can call >LAST_INSERT_ID() without an argument later in the current session to >retrieve the value you

Re: auto-increment & sequence question

2001-06-26 Thread Paul DuBois
At 1:49 PM +0200 6/26/01, Gunnar von Boehn wrote: >Hello everybody, > > >I thing, that I have a problem that needs a sequence and that >auto-increment can't do the job this time. > >I already consulted the manual and the mailarchive. >I saw several different proposals, now I'm a bit confused and d

Re: auto-increment & sequence question

2001-06-26 Thread Kyle Hayes
On Tuesday 26 June 2001 04:49, Gunnar von Boehn wrote: > Hello everybody, > > > I thing, that I have a problem that needs a sequence and that > auto-increment can't do the job this time. > > So, I think the only way to solve this is a sequence table. > > Lets take a single row, integer value for h

Re: auto-increment & sequence question

2001-06-26 Thread Siomara Pantarotto
Hi Gunnar, Why don't you keep the key out of the business rule and create a column to identify the type of customer? How are you going to handle the application when your business reaches more than vip customers??? This is an issue that can be avoided by creating a type column . Siomara

Re: auto-increment & sequence question

2001-06-26 Thread Matthias Urlichs
At 13:49 +0200 2001-06-26, Gunnar von Boehn wrote: >Lets take a single row, integer value for holding the sequence: >CREATE TABLE sequence( > id int4; >); That works, though I would use a single table for all sequences, not a new table per sequence. The other solution would be to do check the

  1   2   >