error in mysql syntax

前端 未结 3 1673
傲寒
傲寒 2021-01-25 14:56

while executing the following query, i get an error that there\'s an error in the syntax near line 9. since i\'m using mysql workbench, i can\'t really figure out what could be

3条回答
  •  故里飘歌
    2021-01-25 15:30

    The syntax error appears to be the empty parenthesis at: INDEX vAuthorID (), FOREIGN KEY () and REFERENCES proquotes.author_info (). Those parenthesis should reference one or more table attributes.

    For example:

    INDEX `vAuthorID` (`vAuthorID`) ,
    CONSTRAINT `vAuthorID`
       FOREIGN KEY (`vAuthorID`)
       REFERENCES `proquotes`.`author_info` (`vAuthorID`)
    

    The last parenthesis for the REFERENCES clause should reference an attribute in author_info, and not from thquotes. Therefore you may need to change vAuthorID accordingly.

提交回复
热议问题