I'm trying to rename some tables for archival, but the table renaming is failing when I use CONCAT() to form the table string name:

mysql> RENAME TABLE flows TO flows_tmp, flows_new TO flows, flows_tmp TO CONCAT("flows_", DATE_SUB(CURDATE(), interval 1 day)); ERROR 1064: You have an error in your SQL syntax near 'CONCAT("flows_", DATE_SUB(CURDATE(), interval 1 day))' at line 1

If I run the CONCAT() command by itself, everything works as expected:

+--------------------------------------------------------+
| CONCAT("flows_",  DATE_SUB(CURDATE(), interval 1 day)) |
+--------------------------------------------------------+
| flows_2005-05-27                                       |
+--------------------------------------------------------+
1 row in set (0.00 sec)


Is there some magic pixie dust I need to throw around the CONCAT() to have it interpolate into the RENAME TABLE command correctly? This is on mysql-server 3.23.58 on a RHEL 3 clone.

Thanks,

--
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net


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

Reply via email to