List:General Discussion« Previous MessageNext Message »
From:J.R. Bullington Date:June 7 2006 2:25pm
Subject:RE: ERROR 1064 (42000): You have an error in your SQL syntax;
View as plain text  
You can't just change the name without changing (or stating) the type.

ALTER TABLE actors CHANGE director_id actos_id varchar(96) default NULL;

J.R.

-----Original Message-----
From: Mark Sargent [mailto:powderkeg@stripped] 
Sent: Wednesday, June 07, 2006 10:10 AM
To: mysql@stripped
Subject: ERROR 1064 (42000): You have an error in your SQL syntax; 

Hi All,

gee I really hate bugging you all for this. I looked at this page,

http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

which has this,

To change column |a| from |INTEGER| to |TINYINT NOT NULL| (leaving the name
the same), and to change column |b| from |CHAR(10)| to |CHAR(20)| as well as
renaming it from |b| to |c|:

ALTER TABLE t2 MODIFY a TINYINT NOT NULL, CHANGE b c CHAR(20);


for changing the name of a column, right? So, why doesn't the below work?

mysql> ALTER TABLE actors CHANGE director_id actor_id;

I get this,

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 '' at line 1

Sorry, little confused right about now, eh. Cheers.

Mark Sargent.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1


Thread
ERROR 1064 (42000): You have an error in your SQL syntax;Mark Sargent7 Jun
  • Re: ERROR 1064 (42000): You have an error in your SQL syntax;Chris Sansom7 Jun
  • re: ERROR 1064 (42000): You have an error in your SQL syntax;Rob Desbois7 Jun
    • re: ERROR 1064 (42000): You have an error in your SQL syntax;Chris Sansom7 Jun
  • RE: ERROR 1064 (42000): You have an error in your SQL syntax;J.R. Bullington7 Jun