Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: TIDB存储过程替代方案请教

【TiDB Usage Environment】Testing
【TiDB Version】7.4
TiDB does not support functions and stored procedures, and of course, it also does not support anonymous blocks. I need to generate some test data with the following requirements. Is there any simple way to do this?
begin
declare l_n1 int default 1;
while l_n1 <= 1000000 DO
insert into big_table values (l_n1, substring(md5(rand()), 1, 4));
set l_n1 = l_n1 + 1;
end while;
end;