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:[EMAIL PROTECTED]
Sent: Thursday, January 13, 2005 11:38 AM
To: Scott Purcell
Cc: mysql@lists.mysql.com
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/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to