本博客是自己在学习和工作途中的积累与总结,仅供自己参考,也欢迎大家转载,转载时请注明出处
http://www.cnblogs.com/king-xg/p/6839738.html
create or replace function formate(val in number)
return varchar2 is res varchar2(); begin
if val= then res:='一';
elsif val= then res:='二';
elsif val= then res:='三';
elsif val= then res:='四';
elsif val= then res:='五';
elsif val= then res:='六';
elsif val= then res:='七';
elsif val= then res:='八';
elsif val= then res:='九';
elsif val= then res:='十';
elsif val= then res:='十一';
elsif val= then res:='十二';
elsif val= then res:='十三';
elsif val= then res:='十四';
elsif val= then res:='十五';
elsif val= then res:='十六';
elsif val= then res:='十七';
elsif val= then res:='十八';
elsif val= then res:='十九';
elsif val= then res:='二十';
elsif val= then res:='二十一';
elsif val= then res:='二十二';
elsif val= then res:='二十三';
elsif val= then res:='二十四';
elsif val= then res:='二十五';
elsif val= then res:='二十六';
elsif val= then res:='二十七';
elsif val= then res:='二十八';
elsif val= then res:='二十九';
elsif val= then res:='三十';
elsif val= then res:='三十一';
elsif val= then res:='三十二';
elsif val= then res:='三十三';
elsif val= then res:='三十四';
elsif val= then res:='三十五';
elsif val= then res:='三十六';
elsif val= then res:='三十七';
elsif val= then res:='三十八';
elsif val= then res:='三十九';
elsif val= then res:='四十';
elsif val= then res:='四十一';
elsif val= then res:='四十二';
else
res:='';
end if;
return res;
end;
如果还有延展,就往后叠加elsif即可。