I did the following (not much different):

CREATE TABLE `foo` (
  `pri_1` INT UNSIGNED NOT NULL,
  `pri_2` INT UNSIGNED NOT NULL,
  `pri_3` INT UNSIGNED NOT NULL,
  `test_data` VARCHAR(120) NOT NULL,
  PRIMARY KEY (`pri_1`, `pri_2`, `pri_3`)
) TYPE = InnoDB;

Regards,
Ritter

--
Jason k Larson


Fortuno, Adam wrote:
All,

I've got an InnoDb table that requires a composit key constraint. However,
I'm not certain how to word the DDL syntax.

Pretending for a sec this was SQL Server 2000 or Sybase ASE 12.5 I'd use the
following.


CREATE TABLE foo(
 pri_1 INTEGER NOT NULL,
 pri_2 INTEGER NOT NULL,
 pri_3 INTEGER NOT NULL,
 test_data VARCHAR(120) NULL
 CONSTRAINT pk_foo PRIMARY KEY (pri_1, pri_2, pri_3)
) Type = InnoDB;

In MySQL, this would return an error. I'd really appreciate knowing if its
possible and (if so) what the syntax is.

Regards,
Adam




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



Reply via email to