
Executing SQL script in server ERROR: Error 1064: 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 ') VIRTUAL, `TOTAL_PRICE` INT NOT NULL, PRIMARY KEY (`ORDER_HEADER_ID`), UN' at line 8 SQL Code: -- ----------------------------------------------------- -- Table `mydb`.`` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`` ( `ORDER_HEADER_ID` INT NOT NULL, `USER_ID` INT NOT NULL, `ORDER_NUMBER` VARCHAR(45) NOT NULL, `ORDER_DATE` DATETIME GENERATED ALWAYS AS () VIRTUAL, `TOTAL_PRICE` INT NOT NULL, PRIMARY KEY (`ORDER_HEADER_ID`), UNIQUE INDEX `Order_number_UNIQUE` (`ORDER_NUMBER` ASC) VISIBLE, INDEX `USER_ID_idx` (`USER_ID` ASC) VISIBLE, CONSTRAINT `USER_ID` FOREIGN KEY (`USER_ID`) REFERENCES `mydb`.`CUSTOMER` (`USER_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB
I have tried everything, like getting rid of VISIBLE from Order_number and USER_ID or deleting the comma in line INDEX USER_ID_idx
(USER_ID
ASC) VISIBLE, . Nothing seems to be working, how can I fix this and get my forward engineering working without any errors. I am aware that problem is visible as it says there, “Error 1064: 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 ‘) VIRTUAL” but nothing i did seemed to work and get it fixed
submitted by /u/Leave_Administrative to r/mysql
[link] [comments]
More Stories
Will County, Illinois 1864 Map – May 20, 2023 at 04:14AM
This kid on Google Map trying to get by – April 27, 2023 at 05:05PM
World of Hyatt: Complete list of all-inclusive properties in Europe (with map) – April 27, 2023 at 04:57PM