Matt Edminster
Matt Edminster

Reputation: 21

Syntax error keeping me from creating a new table

I am trying to create a SQL table into which I will later import data from a csv file. I'm getting an error when I try to create the table but I have no idea what I'm doing wrong. Here is my SQL code:

CREATE TABLE `table_name`. ( 
    `YID` INT(8) NOT NULL AUTO_INCREMENT , 
    `AST` INT(4) NOT NULL , 
    `KID` INT(5) NOT NULL , 
    `PKD` INT(12) NULL , 
    `LAT` DOUBLE(8,6) NULL , 
    `LNG` DOUBLE(8,6) NULL , 
    `KOGnim` VARCHAR(50) ,
    `PST` INT ,
    `ESI` INT ,
    `PLK` VARCHAR(50),
    `PRE` INT,
    `LKM` INT,
    PRIMARY KEY (`YID`)
) ENGINE = MyISAM;

And here is the error message:

#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 '(
    `YID` INT(8) NOT NULL AUTO_INCREMENT ,
    `AST` INT(4) NOT NULL ,
' at line 1

I'm running mySQL v5.7

Upvotes: 0

Views: 24

Answers (2)

wonder.glen
wonder.glen

Reputation: 66

I think that this will do the trick

CREATE TABLE `table_name` ( 
    `YID` INT(8) NOT NULL AUTO_INCREMENT , 
    `AST` INT(4) NOT NULL , 
    `KID` INT(5) NOT NULL , 
    `PKD` INT(12) NULL , 
    `LAT` DOUBLE(8,6) NULL , 
    `LNG` DOUBLE(8,6) NULL , 
    `KOGnim` VARCHAR(50) ,
    `PST` INT ,
    `ESI` INT ,
    `PLK` VARCHAR(50),
    `PRE` INT,
    `LKM` INT,
    PRIMARY KEY(`YID`)
) ENGINE = MyISAM;

Upvotes: 0

Matt Edminster
Matt Edminster

Reputation: 21

Found it! It was the period after table_name

Upvotes: 1

Related Questions