Try putting the name inside of backticks;

>From the Manual:
6.1.2 Database, Table, Index, Column, and Alias Names
-----------------------------------------------------------------------
Note that if the identifier is a restricted word or contains special characters you 
must always
quote it with a ` (backtick) when you use it:
mysql> SELECT * FROM `select` WHERE `select`.id > 100;
See Section 6.1.7 [Reserved words], page 437.

KL

Rusty Wright wrote:

> I have a user who unfortunately named one of his tables "order".  He also
> has table names with a dash in them.  mysqldump is unable to dump the
> "order" table and I'm unable to use the ALTER command on it and the tables
> with the dashes in their names to rename them.  Is there any way to quote
> the table names so it doesn't treat them as sql commands?
>
> /local_a/servers/mysql/bin/mysqldump: Got error: 1064: 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 'order READ /*!32311 LOCAL */,order_pricing READ /*!32311 
> LOCAL  when using LOCK TABLES
>
> --
> 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