MySQL Forums
Forum List  »  Stored Procedures

Re: SQL Query with variable name table in Stored Procedure using MySql 8 version
Posted by: Peter Brawley
Date: April 10, 2021 12:49PM

> SET table_name = CONCAT('t_contents_q_,@tbl,'');

Missing quote trailing quote in 't_contents_q_.

And why the redundancy of appending empty strings to concat()?

And a suggestion ... creating a table name as a runtime variable but its column names as constants looks like an invitation to future errors.

Options: ReplyQuote




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.