如何使用从 Cursor 返回的值作为 mysql 过程中的表名?
DECLARE cur CURSOR FOR
select table_name, column_name
from information_schema.columns
where table_schema = 'foo' and table_name like 'bar%';
OPEN cur;
loop1: LOOP
FETCH cur
INTO table_val, column_val;
IF no_more_rows THEN
CLOSE cur;
LEAVE loop1;
END IF;
update table_val SET column_val ...
这会引发错误foo.table_val doesnt exist
。如何获取要传递给 select 语句的实际表名?