[KLUG Members] Sequences & MySQL

Adam Tauno Williams adam at morrison-ind.com
Thu Apr 21 11:23:37 EDT 2005


> > As far as I can see the only option is to create a helper table
> > which contains one otherwise unused record for each unique key.
> > Creating a new key would imply inserting a record in the helper
> > and retrieving the auto-increment value (which is then used in
> > the real tables).
> > Obviously this is kinda fragile, so maybe someone knows a better
> > workaround? :-|
> That's the recommended way to implement sequences:
> http://dev.mysql.com/doc/mysql/en/information-functions.html
> (scroll down to "LAST_INSERT_ID")
> In practice, there's no reason for the table that holds the sequence
> counter to be empty:  one may as well put real data into it, too.

Thanks; the trunk version of SOPE (the application server environment
for OpenGroupware) now supports MySQL 5.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.kalamazoolinux.org/pipermail/members/attachments/20050421/f910dcc0/attachment.bin


More information about the Members mailing list