? ? ? ? select fn_getNumber(femalestring) into femalenumber from dual;
? ? ? ? resultstring:=resultstring||femalenumber||'女';
? ? ? ? --dbms_output.put_line('女性字符串'||femalestring); --显示结果? ? ?
? ? ? end;
? ? else
? ? ? begin
? ? ? ? --获取男性数量字符串
? ? ? ? malestring:=myrecord1.column_value;
? ? ? ? dbms_output.put_line('男性数字拼音'||malestring);
? ? ? ? --转换数字拼音为数字字符
? ? ? ? select fn_getNumber(malestring) into malenumber from dual;
? ? ? ? resultstring:=malenumber||'男';
? ? ? ? --dbms_output.put_line('男性字符串'||resultstring); --显示结果
? ? ? end;
? ? end if;
? ? --判断是否取到男性数量结束
? ?
? ? end;
? ? else
? ? exit;
? ? end if;--结束判断是否有记录
? ? ?
? ? end loop;?
? ? else? ?
? ? ? ? dbms_output.put_line('游标1没有打开');?
? ? end if;? ? ? --结束打开游标成功
? ? close mycursor1;
? ? end;
? ? dbms_output.put_line(resultstring); --显示结果
? ?
? ? --更新数据库数据
? ? update TB_USER set NNDP=resultstring where ID= myrecord.ID;? ?
? ?
? ? --select NNDP from TB_USER where NNDP <> ' ';? ?
end;
else? ? ? ? ? ?
exit;
end if;
?
end loop;?
else? ?
dbms_output.put_line('游标0没有打开');?
end if;? ?
close mycursor;
end;?
附:运行截图