I believe you got the autoincrement = 10 from Oracle? It doesn't work here -----Mensaje original----- De: Paul DuBois [mailto:[EMAIL PROTECTED] Enviado el: Domingo, 22 de Junio de 2003 11:37 a.m. Para: Fandango del Morro; [EMAIL PROTECTED] Asunto: Re: Big problem with autoincrementing
At 7:35 +0000 6/22/03, Fandango del Morro wrote: >Hello, >I'm new in this list and I also a newbie with MySql. I have a big >problem with autoincrementing with an initial value. For example: > >use Database Business; >create Table Clients(Client_ID int not null primary key >auto_increment=10, Full_Name varchar(30)); > >Each time I assign an initial value to auto_increment I get an error >and worse, the MySql server only tell me there is an error, it >doesn't tell me what kind of error is. > >I tried at leat 30 times before writing this message. I really >unable to solve this problem. auto_increment=n is an accepted syntax >and it is documented in all sql books. I know of no documentation that states you should use the option in the way you show above. To set the initial AUTO_INCREMENT value, you use an AUTO_INCREMENT option *following* the closing parenthesis that ends the column definitions in the CREATE TABLE statement. Try this instead: CREATE TABLE Clients ( Client_ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, Full_Name VARCHAR(30) ) AUTO_INCREMENT = 10; You can put that all on one line if you like. I put it on multiple lines to make it clearer where the table option at the end goes. > >Can you explain me why I have this problem? > >Thanks >Fandango -- Paul DuBois, Senior Technical Writer Madison, Wisconsin, USA MySQL AB, www.mysql.com Are you MySQL certified? http://www.mysql.com/certification/ -- 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]