表 2 的结构为 v_1、v_2、v_3
每次我只想选择一个变量,所以想在存储过程中引用循环索引 i。这在TD中可能吗?
++++++++++++++++++++++++++
replace procedure abc();
begin;
declare i integer default 0;
loopi: loop
set i = i + 1;
if i > 10 then leave loopi;
end if;
insert into table1
select * from table2
where v_i = 1;
end loop loopi;
end;