declare b number := 100; i number; begin i := b; while i >= 0 loop dbms_output.put_line(to_char(i)); if i = 90 then dbms_output.put_line('yes'); goto out; end if; i := i - 1; end loop; <<out>> dbms_output.put_line('end'); end;
伪代码: declare b number:= 10000; for i in reverse 0..list.Count - 1 loop if list[i].a<= b then goto goto_this; end if; end loop; <<goto_this>> .... ....把你list改成oracle里的自定义TYPE吧
type reverse is table of varchar2(32767) index by binary_integer;
declare
b number := 100;
i number;
begin
i := b;
while i >= 0 loop
dbms_output.put_line(to_char(i));
if i = 90 then
dbms_output.put_line('yes');
goto out;
end if;
i := i - 1;
end loop;
<<out>>
dbms_output.put_line('end');
end;
declare
b number:= 10000;
for i in reverse 0..list.Count - 1 loop
if list[i].a<= b then
goto goto_this;
end if;
end loop;
<<goto_this>>
....
....把你list改成oracle里的自定义TYPE吧
type reverse is table of varchar2(32767) index by binary_integer;