--取出第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;