MySQL : use of create sequence statement

For a unique id we don't want to use an auto_increment, but want to
construct a unique id incorporating a sequence (combination of letters
and a number) to make it more meaningful and to distinguish between
different projects and servers (alternative would be to create primary
key on more than one field). Using Google and the PEAR manual I found
the create sequence statement for MySQL. The create sequence statement
is mentioned on dev.mysql.com but not in the MySQL manual.
How come ? Is it dangerous to use it ? Prone to errors ? Bad programming
style ?
Or did they forget to mention it ?

thanx

JM
JM [ Mo, 20 November 2006 20:29 ] [ ID #1542077 ]

Re: MySQL : use of create sequence statement

JM wrote:
> For a unique id we don't want to use an auto_increment, but want to
> construct a unique id incorporating a sequence (combination of letters
> and a number) to make it more meaningful and to distinguish between
> different projects and servers (alternative would be to create primary
> key on more than one field). Using Google and the PEAR manual I found
> the create sequence statement for MySQL. The create sequence statement
> is mentioned on dev.mysql.com but not in the MySQL manual.
> How come ? Is it dangerous to use it ? Prone to errors ? Bad programming
> style ?
> Or did they forget to mention it ?

Speculations from my side: it can generate non unique sequences, which would
require you to make some error checking and if the sequence already used, then
generate a new one and retry.


//Aho
Shion [ Mo, 20 November 2006 22:15 ] [ ID #1542082 ]
PHP » alt.php.sql » MySQL : use of create sequence statement

Vorheriges Thema: SQL query question
Nächstes Thema: Linux distribution with php and mysql included.