56,687
社区成员
发帖
与我相关
我的任务
分享
create procedure uu()
-> begin
-> declare o int;
-> declare u char(50);
-> declare done boolean default 0;
-> declare hh cursor for select cust_name from customers;
-> declare continue handler for not found set done = 1;
-> open hh;
-> create table bb(cust_name char(50) not null);
-> repeat
-> fetch hh into u;
-> insert into bb(cust_name) values(u);
-> until done end repeat;
-> close hh;
-> end //