--取出第n个字符
select substr('abc',,1) from dual;
--主要思想:从字符串开头依次取出每个字符将其放到最后一个位置后用for循环语句依次连接起来
declare
i number :=1;
top char(1);
c_str_temp varchar2(20) := '&num';
c_str_reverse varchar2(100);
begin
for i in 1.. length(c_str_temp)
loop
top:= substr(c_str_temp,i,1);
c_str_reverse := top||c_str_reverse;
end loop;
dbms_output.put_line(c_str_reverse);
end;
转载于:https://blog.51cto.com/piggysky/1294453