List:General Discussion« Previous MessageNext Message »
From:Steve Edberg Date:May 13 2002 10:42pm
Subject:Re: Problem with DDL
View as plain text  
'when' is a reserved word:

	http://www.mysql.com/doc/R/e/Reserved_words.html

I don't think MySQL is using it yet, but it's probably forbidden by 
the ANSI SQL standard. If you really want to use it as a column name, 
I think you can quote it -

	CREATE TABLE news(..., 'when' timestamp, ....)

- but it's probably best to pick another name that's not in the reserved list.

	-steve


At 4:22 PM -0400 5/13/02, Elliot L. Tobin wrote:
>I pulled this DDL from a MySQL server and am trying to load it into a
>MySQL server runinng 3.22.49, but I get errors with the DDL.
>
>CREATE table news (
>  id smallint(5) unsigned DEFAULT '0' NOT NULL auto_increment,
>  subject varchar(80),
>  when timestamp(14),
>  body text,
>  who smallint(5) unsigned DEFAULT '0' NOT NULL,
>  PRIMARY KEY (id)
>);
>
>ERROR 1064 at line 3: You have an error in your SQL syntax near 'when
>timestamp(14),
>   body text,
>   who smallint(5) unsigned DEFAULT '0' NOT NULL' at line 4
>
>
>--
>
>Any help is appreciated..  Please email me directly..
>


-- 
+------------------------------------------------------------------------+
| Steve Edberg                                      sbedberg@stripped |
| University of California, Davis                          (530)754-9127 |
| Programming/Database/SysAdmin               http://pgfsun.ucdavis.edu/ |
+------------------------------------------------------------------------+
| "If only life would imitate toys."                                     |
|                  - Ted Raimi, March 2002                               |
|                  - http://www.whoosh.org/issue67/friends67a.html#raimi |
+------------------------------------------------------------------------+
Thread
Problem with DDLElliot L. Tobin13 May
  • RE: Problem with DDLGurhan Ozen13 May
  • RE: Problem with DDLPeter Lovatt13 May
  • Re: Problem with DDLJeff Kilbride13 May
  • Re: Problem with DDLSteve Edberg14 May
  • Re: Problem with DDLJeff Kilbride14 May