rename table amc to concat('amf_',@t_name); 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 'concat('amf_',@t_name)' at line 1
On 7/10/08, Octavian Rasnita <[EMAIL PROTECTED]> wrote: > > Have you tried: > > rename table amc to concat('amf_', @t_name); > > Octavian > > ----- Original Message ----- > From: "Ananda Kumar" <[EMAIL PROTECTED]> > To: "mysql" <mysql@lists.mysql.com> > Sent: Thursday, July 10, 2008 1:54 PM > Subject: rename a table > > > > Hi All, > > I was to rename a table as below > > > > set @t_name=now(); > > rename table amc to concat('amf_',t_name); > > > > but i am getting below error. How do i fix 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 'concat('amf_',t_name)' at line 1 > > > > > > I can do the same using unix script, but just wanted to check if i can do > > this in mysql itself. > > > > > > regards > > anandkl > > >