List:General Discussion« Previous MessageNext Message »
From:Frank Bax Date:January 13 2005 6:20pm
Subject:RE: create sequence
View as plain text  
You obviously do not understand auto-increment capability.  You wouldn't 
"get that value" of the sequence, because you would always retrieve the 
same value.  You would have to add a row to the 'extra' table for the 
auto-increment field to work as designed, then use the highest value of 
auto-increment field in your other tables.  You end up with as many rows in 
your 'extra' table as you have "sequences" used in your other 
tables.  There are probably plenty of other flaws with such an implementation.

Of course, had you bothered to search for "sequence mysql" on google, you 
would have found the first hit is a page at dev.mysql.com that contains an 
example of how to simulate sequence in mysql.


At 01:05 PM 1/13/05, Scott Purcell wrote:

>I understand the auto-increment capability, but how would one share it 
>amount three different tables?
>
>Would one have to do a rig, and create an extra table with increment in 
>it, then get that value to update table 1, then repeat process again to 
>get new increment and put it into table 2, etc.?
>
>I am used to asking for the sequence.nextId, then using it in any table I 
>need.
>
>Am I missing something here, or does someone know how to handle this in 
>multiple tables?
>
>Scott
>
>
>
>-----Original Message-----
>From: Peter Brawley [mailto:peter.brawley@stripped]
>Sent: Thursday, January 13, 2005 11:38 AM
>To: Scott Purcell
>Cc: mysql@stripped
>Subject: Re: create sequence
>
>
>You want AUTO_INCREMENT,
>http://dev.mysql.com/doc/mysql/en/example-AUTO_INCREMENT.html.
>
>PB
>
>-----
>
>Scott Purcell wrote:
>
> >Hello,
> >
> >I would like to create a sequence object in mysql that I could use in 
> multiple tables through a application I am developing.
> >
> >Could someone please send my the syntax of how to create a simple 
> sequence that starts at 1 increments by 1.
> >
> >thanks,
> >
> >
> >
> >
> >
>
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:    http://lists.mysql.com/mysql?unsub=1

Thread
create sequenceScott Purcell13 Jan
  • Re: create sequencePeter Brawley13 Jan
  • Re: create sequenceJochem van Dieten13 Jan
RE: create sequenceJay Blanchard13 Jan
RE: create sequenceScott Purcell13 Jan
  • RE: create sequenceSGreen13 Jan
  • RE: create sequenceFrank Bax13 Jan