oracle处理数据
来源:互联网 发布:大数据未来前景 编辑:程序博客网 时间:2024/06/07 20:37
create or replace procedure xs_test_BIRTHDAY(temp_name in varchar2, temp_num out number)
is
str_birthday varchar2(200);
new_birthday varchar2(10);
--校友用户
cursor curTestAlumniUser is
select *
from dcp_apps.TEST_alumni_user;
--校友用户行类型
rec_curTestAlumniUser curTestAlumniUser%rowtype;
begin
--判断游标是否被打开,如果已经打开,首先关闭
if curTestAlumniUser%isopen then
--关闭游标
close curTestAlumniUser;
end if;
--打开游标
open curTestAlumniUser;
--进行循环
loop
--打开游标里的一条记录,赋到游标变量里
fetch curTestAlumniUser
into rec_curTestAlumniUser;
--判断游标里是否还有记录,如果没有记录,关闭游标,退出循环
if curTestAlumniUser%notfound then
close curTestAlumniUser;
exit;
else
str_birthday:= rec_curTestAlumniUser.Birshday;
if (str_birthday is not null) then
--判断6,7,8
str_birthday:=trim(str_birthday);
if length(str_birthday)='6' then
new_birthday:=substr(str_birthday,1,4) || '-' || '0' || substr(str_birthday,5,1) || '-' || '0' || substr(str_birthday,6,1);
update dcp_apps.TEST_alumni_user tau set tau.birshday_yuan=new_birthday where tau.id=rec_curTestAlumniUser.Id;
end if;
if length(str_birthday)='7' then
new_birthday:=substr(str_birthday,1,4) || '-' || '0' || substr(str_birthday,5,1) || '-' || substr(str_birthday,6,2);
update dcp_apps.TEST_alumni_user tau set tau.birshday_yuan=new_birthday where tau.id=rec_curTestAlumniUser.Id;
end if;
if length(str_birthday)='8' then
new_birthday:=substr(str_birthday,1,4) || '-' || substr(str_birthday,5,2) || '-' || substr(str_birthday,7,2);
update dcp_apps.TEST_alumni_user tau set tau.birshday_yuan=new_birthday where tau.id=rec_curTestAlumniUser.Id;
end if;
end if;
-- rec_curTestAlumniUser.
-- update B表 set B表的字段A=rec_source_table.字段b where zgh=rec_source_table.zgh;
commit;
end if;
end loop;
update test_alumni_user set sex=trim(sex);
update test_alumni_user set sexID=1 where sex='男';
update test_alumni_user set sexID=2 where sex='女';
update test_alumni_user set sexID=3 where ( sex is null);
update test_alumni_user set sexID=4 where (sex='无' or sex is null);
update test_alumni_user set sexID=3 where sexID is null;
commit;
exception
when others then
rollback;
end;
- oracle数据异常处理
- 处理oracle数据
- Oracle(七)-------------------------处理数据
- oracle处理数据
- oracle处理数据
- oracle 高效处理数据
- Oracle DB 处理数据
- Oracle:处理数据
- oracle--处理数据
- oracle处理重复插入数据
- Oracle处理Blob类型数据
- Oracle复杂数据的处理。
- Oracle学习(八):处理数据
- oracle,重点处理数据语句
- 【oracle学习】4.处理数据
- oracle 数据锁表处理
- jdbc处理Oracle中longrow类型数据
- jdbc处理Oracle中Blob类型数据
- unrecognized selector sent to instance
- LaTeX之公式及编号
- STM32F系列JTAG口重映射成为普通GPIO
- Android Camera 架构
- 车子内部雾刷
- oracle处理数据
- MPEG2压缩编码技术应用原理
- 错误总结:error LNK2001
- iPhone5预测:在微创新中逐渐沦陷[转]
- makefile
- c++中关于return的用法总结
- 非关语言: 设计模式
- DatePicker的使用方法
- 随机数的种子问题、泛型集合:list Dictionary、字典Dictionary【充实的一天~!】