First of all to create a new stored procedure mode select in
Set the character length in the created parameter.
Reference reference
c is the parameter that I set here.
IN `c` varchar(100)
BEGIN
SET @sqlStr:=CONCAT("select * from ",c);
PREPARE stmt from @sqlStr;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END
When calling, you need to pay attention to the number table name can be directly entered, the text needs to be quoted or an error will be reported