Jump to content

[SOLVED] Error Creating Table with ENUM column


Errant_Shadow

Recommended Posts

Using MySQL 5.0.45

 

the SQL query...

CREATE TABLE $TrackName (
segment_id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Primary Key. Auto Inremented Index.',
length TINYINT UNSIGNED NOT NULL DEFAULT 1 COMMENT 'The length of the segment.',
condition ENUM('grass', 'rocks', 'dirt', 'mud', 'snow') NOT NULL COMMENT 'What the segment is made of.',
hazard ENUM('corner', 'hill', 'jump', 'cliff', 'ice', 'debris') NOT NULL COMMENT 'What is on the segment.',
PRIMARY KEY (segment_id),
) ENGINE = MYISAM;

 

returns...

Failed to execute SQL : SQL [query] failed : 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 'condition ENUM('grass', 'rocks', 'dirt', 'mud', 'snow') NOT NULL COMMENT 'W' at line 1

 

I've looked through manuals, but I can't figure out what I've done wrong. Any advice?

Anyone? As far as I can find, the syntax is:

 

field_name ENUM('a', 'b', 'c') [NULL | NOT NULL] [DEFAULT default_value] [etc]

 

I thought it was the default that was messing it up, but even after I took that out, it's still failing.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.