如何在存储过程中定义一个访问临时表的游标?
游标需要在定义临时表的语句前declare,但是如果这样,定义游标的语句又会出错。该如何解决?
BEGINdrop table if exists temp_tablecreate temporary table temp_table(bookId integer,count integer,sum integer) as select......
*计算订阅书的更新频率*/
declare bc_cursor cursor for select * from temp_table;
declare continue handler for not found set stopFlag=0;......END
游标需要在定义临时表的语句前declare,但是如果这样,定义游标的语句又会出错。该如何解决?
BEGINdrop table if exists temp_tablecreate temporary table temp_table(bookId integer,count integer,sum integer) as select......
*计算订阅书的更新频率*/
declare bc_cursor cursor for select * from temp_table;
declare continue handler for not found set stopFlag=0;......END
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货