MySQL Forums
Forum List  »  Stored Procedures

Re: Create TEMPORARY Table using dynamic SQL
Posted by: John Noble
Date: December 20, 2022 04:40AM

Hi folks,

I managed to get a workaround for this...

SET @vSQL = CONCAT("SELECT * FROM ", @vTableName);
CREATE TEMPORARY TABLE tempTable @vSQL;

I just changed the SQL to :
SET @vSQL = CONCAT("CREATE TEMPORARY TABLE AS SELECT * FROM ", @vTableName);

Thanks,

John

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Create TEMPORARY Table using dynamic SQL
38
December 20, 2022 04:40AM


Sorry, only registered users may post in this forum.

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.