does mysql not allow the keyword 'check' ?
eg .. this doesnt work
CREATE TABLE ex (
sess char(2) not null check (sess in ('S1','S2','X1','X2'))
);
does mysql not allow the keyword 'check' ?
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
It depends what table types you are using:
http://www.mysql.com/doc/en/CREATE_TABLE.html
http://www.mysql.com/doc/en/CREATE_TABLE.html
MacMySQL Manual wrote:In MySQL Version 3.23.44 or later, InnoDB tables support checking of foreign key constraints. See section 7.5 InnoDB Tables. Note that the FOREIGN KEY syntax in InnoDB is more restricted than the syntax presented above. InnoDB does not allow index_name to be specified, and the columns of the referenced table always have to be explicitly named. Starting from 4.0.8 InnoDB supports both ON DELETE and ON UPDATE actions on foreign keys. See the InnoDB manual section for the precise syntax. See section 7.5 InnoDB Tables. For other table types, MySQL Server does parse the FOREIGN KEY, CHECK, and REFERENCES syntax in CREATE TABLE commands, but without further action being taken. See section 1.7.4.5 Foreign Keys.