日期:2014-05-17 浏览次数:21128 次
create or replace function ff_lwb (in_str varchar2)--将字符串转为驼峰格式这样应该就会了吧
return varchar2 is
v_start varchar2(100);
v_endstr varchar2(100);
begin
v_start := in_str;
if instr(v_start, '_') = 0 then
v_endstr := v_start;
else
select replace(v_start,
substr(v_start, instr(v_start, '_'), 2),
upper(substr(v_start, instr(v_start, '_') + 1, 1)))--upper将小写转为大写
into v_endstr
from dual;
v_start := v_endstr;
select ff_lwb(v_start) into v_endstr from dual;
end if;
return v_endstr;
exception
when others then
return in_str;
end;