MySQL Forums
Forum List  »  MySQL Workbench

Error 1064 on forward engineering db model
Posted by: tomas bar
Date: September 16, 2008 03:48AM

Hi,
I've created a MysqQL model with MySQL Workbench and then tried forward engineering it to create the database.
However I get a Error 1064.
I also tried exporting the creation script from MySQL Workbench and then executing it in MySQL Query Browser, but I get the
same Error 1064. More precisely I get the following error message:

Script line: 11 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
REFERENCES `htest1`.`cotxes` ()
ON DELETE NO ACTION
ON UPDATE N' at line 6


And the creation script that I execute is the following

***** BEGINNING OF SCRIPT

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

CREATE SCHEMA IF NOT EXISTS `htest1` DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci ;
USE `htest1`;

-- -----------------------------------------------------
-- Table `htest1`.`chofers`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `htest1`.`chofers` (
`idchofer` INT NOT NULL AUTO_INCREMENT ,
`nom` VARCHAR(45) NOT NULL ,
PRIMARY KEY (`idchofer`) ,
CONSTRAINT `idchofer`
FOREIGN KEY ()
REFERENCES `htest1`.`cotxes` ()
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `htest1`.`cotxes`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `htest1`.`cotxes` (
`idcotxe` INT NOT NULL AUTO_INCREMENT ,
`marca` VARCHAR(45) NOT NULL ,
`chofers_idchofer` INT NOT NULL ,
`updated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP ,
PRIMARY KEY (`idcotxe`, `chofers_idchofer`) ,
INDEX `fk_cotxes_chofers` (`chofers_idchofer` ASC) ,
CONSTRAINT `fk_cotxes_chofers`
FOREIGN KEY (`chofers_idchofer` )
REFERENCES `htest1`.`chofers` (`idchofer` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;



SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

**** END OF SCRIPT


Do you have any idea of what I do wrong?
Thank you very much.

Options: ReplyQuote


Subject
Views
Written By
Posted
Error 1064 on forward engineering db model
4417
September 16, 2008 03:48AM


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.