MySQL Forums
Forum List  »  General

creating InnoDB table with primary key with multiple columns and auto increment
Posted by: arnott r
Date: July 22, 2005 02:20PM

Hi all,
why does the following create statement fail ?

CREATE TABLE test (
id INT NOT NULL,
id1 INT NOT NULL auto_increment,
last_name CHAR(30) NOT NULL,
first_name CHAR(30) NOT NULL,
PRIMARY KEY (id,id1),
INDEX name (last_name,first_name))
type=InnoDB
;

ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

we want to create InnoDB table because we want to be able to use 'delete on cacasde'.

is there a solution to this ?

Thanks
Arnott

Options: ReplyQuote


Subject
Written By
Posted
creating InnoDB table with primary key with multiple columns and auto increment
July 22, 2005 02:20PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.