Cannot create a table with a char field

2 posts / 0 new
Last post
bcromwell
bcromwell's picture
Offline
Last seen: 1 month 6 days ago
Joined: Aug 15 2013
Junior Boarder

Posts: 3

Ben Cromwell
Cannot create a table with a char field

I'm trying to create a dimension table with a char field.

 

CREATE TABLE `d_time_of_day` (
  `key` char(4),
  `hour` tinyint(2),
  `minute` tinyint(2),
  `minute_in_hour` tinyint(2),
  `minute_in_day` smallint(4),
  `quarter_hour_period_in_hour` tinyint(1),
  `quarter_hour_period_in_day` tinyint(2),
  `half_hour_period_in_hour` tinyint(1),
  `half_hour_period_in_day` tinyint(2),
  `hour_period_in_day` tinyint(2)
) ENGINE=InfiniDB DEFAULT CHARSET=utf8;

 

InfiniDB responds with the non-specific "ERROR 138 (HY000): The syntax or the data type(s) is not supported by InfiniDB. Please check the InfiniDB syntax guide for supported syntax or data types."

 

If I remove the `key` column it works. I've tried varchar, varchar(4) and char as well to no avail.

 

Is this a limitation of the community edition?

bcromwell
bcromwell's picture
Offline
Last seen: 1 month 6 days ago
Joined: Aug 15 2013
Junior Boarder

Posts: 3

Ben Cromwell
The answer is that `key` is a

The answer is that `key` is a reserved word and cannot be used even if enclosed within backticks.