Home Why does this script fail because it doesn't like the column name?
Reply: 0

Why does this script fail because it doesn't like the column name?

user1305
1#
user1305 Published in April 24, 2018, 8:15 am

This question already has an answer here:

  • Syntax error due to using a reserved word as a table or column name in MySQL 1 answer

It doesn't like the word release as a column name.

 CREATE TABLE external_db (

      external_db_id          INT not null,
      db_name                     VARCHAR(100) NOT NULL,
      release                    VARCHAR(40)  NOT NULL,
      status                      ENUM ('KNOWNXREF','KNOWN','XREF','PRED','ORTH', 'PSEUDO') not null,

      PRIMARY KEY( external_db_id ) 

    );

I changed the field name to releaseX and the error went away.

This script came from https://github.com/Ensembl/ensembl/blob/release/91/sql/table.sql, which is supposed to be mySQL. Is this a versioning issue in MySQL or can I decorate the word release in the script so it can be used as a column name?

I am using MySQL 5.7 and MySQLWorkbench 6.3.

I know release is a bad name for a column but I didn't write the script.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.348817 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO