1 declare 2 3 str_mid varchar2(100); 4 str_end varchar2(100); 5 begin 6 7 for j in (select t.id,t.ques_desc from cqdn_qa_list_tmp t) 8 loop 9 for i in 1 .. length(j.ques_desc) 10 loop 11 12 case substr(j.ques_desc,i,1) 13 when '一' then str_mid:=1 ; 14 when '二' then str_mid:=2 ; 15 when '三' then str_mid:=3 ; 16 when '四' then str_mid:=4 ; 17 when '五' then str_mid:=5 ; 18 when '六' then str_mid:=6 ; 19 when '七' then str_mid:=7 ; 20 when '八' then str_mid:=8 ; 21 when '九' then str_mid:=9 ; 22 when '零' then str_mid:=0 ; 23 end case; 24 25 str_end:=str_end||str_mid; 26 end loop; 27 28 dbms_output.put_line(str_end); 29 30 update cqdn_qa_list_tmp t set t.ques_desc = str_end where t.id = j.id; 31 commit; 32 str_end:=null; 33 end loop; 34 end;