使用Firebird 2.5跳过循环

Wel*_*Wel 3 sql firebird

我需要While...Do在这样的存储过程中跳过循环迭代

While (v_counter <= :v_total) do begin

  If (<condition>) then continue;

  ...

end
Run Code Online (Sandbox Code Playgroud)

但是CONTINUE在Firebird 3.0之前不可用.那么有一轮工作吗?

Mar*_*eel 5

如果你想在没有循环的情况下跳过迭代CONTINUE,那么只需对块的其余部分使用continue条件的反转:

While (v_counter <= :v_total) do begin

  If (NOT <condition>) then
  BEGIN
     ...
  END

end
Run Code Online (Sandbox Code Playgroud)