mysql 存储过程中游标的使用
来源:互联网 发布:轻淘宝设置pid 编辑:程序博客网 时间:2024/06/06 06:56
游标须在存储过程中使用.
delimiter $$
begin
declare rid integer(11) default 0;
declare name varchar(100) default '';
declare cid varchar(6) default '';
declare temp1 varchar(6) default '';
declare temp2 varchar(6) default '';
declare cur_exe cursor for(select rowid,taskname from tt_task1);
declare continue handler for not found set name = null;
open cur_exe;
fetch cur_exe into rid,name;
while (name is not null) do
set temp1=substr(name,instr(name,'C'),6);
set temp2=substr(name,char_length(name)-instr(reverse(name),'C')+1,6);
if (temp1 like 'C0%' or temp1 like 'CT%') then
set cid=temp1;
else
if (temp2 like 'C0%' or temp2 like 'CT%') then
set cid=temp2;
else
set cid='';
end if;
end if;
if cid!='' then
update tt_task1 set chgid=cid where rowid=rid;
end if;
fetch cur_exe into rid,name;
end while;
close cur_exe;
end$$
- mysql 存储过程中游标的使用
- 存储过程中游标的使用
- Mysql存储过程中游标的使用以及错误处理
- 存储过程(1)mysql中游标的使用
- 存储过程中游标的使用一例
- oracle存储过程中游标的使用
- MySQL中游标的使用
- MySQL中游标的使用
- mysql中游标的使用
- MySQL中游标的使用
- DB2 中游标的使用以及 存储过程的写法
- Java调用Oracle存储过程,以及Oracle中游标的使用
- MySql中游标的定义与使用方式
- MySql中游标的定义与使用方式
- MySql中游标的定义与使用方式
- MySql中游标的定义与使用方式
- MySql中游标的定义与使用方式
- MySql中游标的定义与使用方式
- 2014 项目经理-累觉不爱
- How to Set size for picture in datadrigview
- VS2010制作安装文件后,使用安装文件时出错-“Can't find console path, Please install main UI...”
- C++开发者都应该使用的10个C++11特性
- 开始记录成长的点滴
- mysql 存储过程中游标的使用
- 过水润初春 五款养生花草茶
- 可访问类型不一致:参数类型的Vector比运算符operator +的(Vector,Vector)的可访问性低的解决方法
- linux系统负载检查方法
- ArrayList和LinkedList的区别
- android版本app本地调试虚拟机地址
- Storyboard全解析(二)
- Android使用VideoView播放网络视频
- 看代码技巧