List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:May 30 2001 3:05am
Subject:Re: Cannot create table with file named INFILE
View as plain text  
At 2:23 PM +0200 5/28/01, Alessandro Staltari wrote:
>Hello. I'm new to MySQL but I have a problem that appears serious, 
>al least for me.
>I can't create a table with a field named INFILE. I think mysql 
>consider INFILE as a keyword. Is there work around for this?
>Shouldn't INFILE be used only within a LOAD statement? I think it is 
>a bug in the query parser?

Well, by that reasoning, COMMIT reasoning is used only in a COMMIT statement,
so it should be allowable as a column name.

Doesn't matter where a keyword is used; if it's a keyword, it's a keyword.

Anyway, if you really want to use INFILE as a column name, you can do so,
but you need to enclose it in backquote (`INFILE`) each time you refer
to it.  This will allow you to port your table from another database,
but since it still requires some rewriting (to add those pesky backquotes),
you may find it just as easy to rename the column.

>
>Regards
>
>Alessandro Staltari


-- 
Paul DuBois, paul@stripped
Thread
Cannot create table with file named INFILEAlessandro Staltari28 May
  • Re: Cannot create table with file named INFILEB. van Ouwerkerk28 May
    • Re: Cannot create table with file named INFILEAlessandro Staltari28 May
  • Re: Cannot create table with file named INFILEPaul DuBois30 May