call modify_collation(@num,@count_num)
> 1146 - Table 'test.table_name' doesn't exist
> 时间: 0.009s
我在使用mysql存储过程时,打印时游标取值为空,报错找不到表。我的过程语句是这样的:
drop procedure if exists modify_collation;
DELIMITER //
create PROCEDURE modify_collation(out origin_num int(10),out count_num int(10))
COMMENT 'modify_collation'
SQL SECURITY DEFINER
BEGIN
DECLARE table_name VARCHAR(100);
declare column_name VARCHAR(100);
declare done int(10) default 0;
declare collation_cursor cursor for SELECT table_name, column_name FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'test' and collation_name = 'utf8mb4_0900_ai_ci';
declare continue handler for not found set