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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.