--------第2种--------
WHILE ... LOOP
END LOOP;
declare
n number(3) :=1;
begin
WHILE n<=10 LOOP
dbms_output.put_line(n);
n:=n+1;
END LOOP;
end;
declare
str varchar2(50):='中国人';
len number(5);
c char(2);
begin
len := length(str);
while len>0 loop
c := substr(str,len,1);
dbms_output.put_line(c);
len := len-1;
end loop;
end;