oracle存储过程
来源:互联网 发布:淘宝店铺层级的排名 编辑:程序博客网 时间:2024/06/16 19:51
create or replace procedure XS_TEST_UPDATE_BAC is
cursor curTestUpdateBac is
select id,
substr(bachelor_edu,
instr(bachelor_edu, '从') + 1,
instr(bachelor_edu, '年到') - 2) as startYear,
substr(substr(bachelor_edu, instr(bachelor_edu, '年到') + 2),
1,
instr(substr(bachelor_edu, instr(bachelor_edu, '年到') + 2),
'年') - 1) as endYear,
substr(substr(bachelor_edu, instr(bachelor_edu, '年到') + 2),
instr(substr(bachelor_edu, instr(bachelor_edu, '年到') + 2),
'年') + 1) as yuanxi,
bachelor_edu
from test_alumni_user
where bachelor_edu <> '从年到年'
and bachelor_edu <> '无'
and instr(bachelor_edu, '年到') > 0;
--校友用户类型
rec_curTestUpdateBac curTestUpdateBac%rowtype;
begin
--判断游标是否被打开,如果已经打开,首先关闭
if curTestUpdateBac%isopen then
--关闭游标
close curTestUpdateBac;
end if;
--打开游标
open curTestUpdateBac;
--进行循环
loop
--打开游标里的一条记录,赋到游标变量里
fetch curTestUpdateBac
into rec_curTestUpdateBac;
--判断游标里是否还有记录,如果没有记录,关闭游标,退出循环
if curTestUpdateBac%notfound then
close curTestUpdateBac;
exit;
else
update test_alumni_user u
set u.bachelor_edu_begin_day=rec_curTestUpdateBac.Startyear,
u.bachelor_edu_end_day = rec_curTestUpdateBac.Endyear,
u.bachelor_departments = rec_curTestUpdateBac.Yuanxi
where u.id = rec_curTestUpdateBac.Id;
end if;
commit;
end loop;
exception
when others then
rollback;
end XS_TEST_UPDATE_BAC;
- Oracle:存储过程,存储函数
- Oracle-存储过程 存储函数
- Oracle存储过程、存储函数
- oracle 存储函数,存储过程
- Oracle存储过程
- 调试oracle存储过程。
- ORACLE 存储过程实战
- Oracle 存储过程
- oracle存储过程使用
- Oracle 创建存储过程
- 调试oracle存储过程
- oracle java存储过程
- 创建Oracle存储过程
- 加密oracle存储过程
- oracle存储过程分页
- oracle存储过程笔记
- ORACLE存储过程--注意事项
- oracle procedure 存储过程
- 整理一系列优秀的Android开发源码
- Oracle的instr函数使用
- C++中左移右总结
- 改写ListView 实现加载本地图片 非 id
- Telnet使用小结(window7)
- oracle存储过程
- 12个有趣的C语言面试题
- c++ 判断第几天 源码(控制台)
- 按钮手动绑定事件处理
- 元元模型(Meta Object Facility)的个人理解
- UIEdgeInsetsMake的作用
- 风的世界里有海的七滴泪水
- CentOS下如何安装libevent
- DataTable使用时的小问题