Hi Gilles!

Just use `dec` and it will work fine. DEC is as you suspected a reserved
word and can only be used as column namne if you put it in
`<column>`-syntax.


Example:

create table astronomicalvskeywords (
`dec` float not null,
`ra`  float not null
);

...will create:


desc astronomicalvskeywords;
+-------+-------+------+-----+---------+-------+
| Field | Type  | Null | Key | Default | Extra |
+-------+-------+------+-----+---------+-------+
| dec   | float | NO   |     | NULL    |       |
| ra    | float | NO   |     | NULL    |       |
+-------+-------+------+-----+---------+-------+
2 rows in set (0.01 sec)


Regards 

Thomas L.


tis 2006-05-30 klockan 15:46 +0200 skrev Gilles MISSONNIER:
> Hello
> 
> I could not find the answer through the online "Search the MySQL manual".
> I run MySQL 4.1
> 
> In astronomy, RA and DEC are widely used coordinate names.
> Then I try to add a column named "DEC" :
> 
> mysql> alter table my_table add dec float;
> ERROR 1064 (42000): You have an error in your SQL syntax; check the manual 
> that corresponds to your MySQL server version for the right syntax to use 
> near 'dec float' at line 1
> 
> UPPER case lead to the same error.
> 
> It seems that the reason is that "DEC" is a keyword standing for 
> "decimal". I do not understand why this cannot be allowed for a column 
> name.
> 
> Is there a turn around ?
> 
> This is annoying ; I add to name the column as "DECL" which is much less 
> meaning full in the astronomy community.
> 
> thanks,
> =_==_==_==_==_==_=
> =¯==¯==¯==¯==¯==¯=
> Gilles Missonnier
> IAP - [EMAIL PROTECTED]
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to