What’s wrong with this SQL? Why can’t I run it?
CREATE TABLE `test` (
`format_id` VARCHAR NOT NULL ,
bef_aft_flag TINYINT NOT NULL ,
"order"INT NOT NULL ,
`format_name` VARCHAR( 0 ) NOT NULL ,
`file_path` VARCHAR( 0 ) NOT NULL ,
`create_date` TIMESTAMP NOT NULL ,
`update_dat` TIMESTAMP NOT NULL ,
PRIMARY KEY ( `format_id` )
);
#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 'NOT NULL , bef_aft_flag TINYINT NOT NULL , "order"INT NOT NULL , `format_name` ' at line 3
VARCHARrequires length of the filed in parenthesis. You need this,But it might be wrong, just keep reading. There are a lot of problems in your code.
From its name,
format_idseems INT not character sequence. Did you meanformat_id INT NOT NULL,
double quote in
"order"not supported in MySQL use backtick0lengthVARCHARonformat_nameandfile_pathdoes not make sense. Did you mean?Did you miss any
eonupdate_datfield. It seems you didn’t miss it oncreate_dateat all.