MySQL Forums
Forum List  »  Stored Procedures

Simple RENAME TABLE SQL in Navicat Event throwing erro
Posted by: Andy Idema
Date: April 13, 2018 11:43AM

Here is my code...


SET @tablename = '_new_table';

SELECT
@QUERY := CONCAT(
'RENAME TABLE `_new_table` TO `',
CURDATE(),
@tablename,
'`'
);

PREPARE STMT
FROM
@QUERY;

EXECUTE STMT;

Here is the error I'm getting...

1064 - You have an error in your SQL syntax; yada yada MariaDB right syntax to use near 'NULL; at line 1

Options: ReplyQuote


Subject
Views
Written By
Posted
Simple RENAME TABLE SQL in Navicat Event throwing erro
292
April 13, 2018 11:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.