日期:2014-05-17 浏览次数:20864 次
UPDATE a_person p
SET p.avatar = nvl2(mobi_number, SUBSTR(utl_encode.base64_decode(hextoraw(mobi_number)),-10), email)
WHERE p.avatar IS NULL;
create or replace procedure you_pro_name(RetMemo out varchar2 --返回信息
)
is
v_nicheng varchar2(20);--id 为a_person主键
v_count number;
cursor c_find is
select * from a_person;
cc c_find%rowtype;
begin
RetMemo :='';
v_count :=0;
open c_find;
loop
fetch c_find into cc;
exit when c_find%notfound;
if cc.nicheng is null then
if cc.phone is null then
v_nicheng :=cc.mail;
else
v_nicheng :=substr(utl_raw.cast_to_varchar2(utl_encode.base64_decode(utl_raw.cast_to_raw(cc.phone))),-10);
end if;
update a_person set nicheng=v_nicheng where id = cc.id;
commit;
v_count :=v_count+1;
end if;
end loop;
close&nb