我有以下场景:
CREATE DEFINER=`test`@`%` PROCEDURE `prTest`()
BEGIN
SET @prepared_sql = 'select field1, field2 from table_data1');
PREPARE stmt FROM @prepared_sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END
我必须循环打开“stmt”。如何读取这个循环和每一行,获取“field1”和“field2”的值并将值插入另一个表中?