pb on create with foreign key
Posted by: bocquet denis
Date: August 30, 2005 09:26AM

CREATE TABLE `infos_bloc` (
`infb_code_partenaire` INT(2) NOT NULL,
`infb_reference` VARCHAR(30) NOT NULL,
`infb_numero` INT(3) NOT NULL,
`infb_type` VARCHAR(3) NULL,
`infb_actif` INT(1) NULL,
PRIMARY KEY (`infb_code_partenaire`, `infb_reference`, `infb_numero`),
CONSTRAINT `fk_infos_bl_ref_652_infos`
FOREIGN KEY `fk_infos_bl_ref_652_infos` (`infb_code_partenaire`)
REFERENCES `infos` (`inf_code_partenaire`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,

)
ENGINE = INNODB;
An error occured while executing the SQL statement.
Can't create table './xxxx/infos_bloc.frm' (errno: 150)

the solution is after "no action" you don't put a comma and it's ok
REFERENCES `infos` (`inf_code_partenaire`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,

)

Options: ReplyQuote


Subject
Written By
Posted
pb on create with foreign key
August 30, 2005 09:26AM


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.