Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skip a loop iteration with Firebird 2.5

I need to skip a While...Do loop iteration inside a stored procedure like this

While (v_counter <= :v_total) do begin

  If (<condition>) then continue;

  ...

end

However CONTINUE won't be available until Firebird 3.0. Is there a work a round for this?

like image 828
zac Avatar asked Oct 29 '25 17:10

zac


1 Answers

If you want to skip an iteration through a loop without CONTINUE, then you can use the inverse of the continue-condition for the rest of the block:

While (v_counter <= :v_total) do begin

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

end
like image 118
Mark Rotteveel Avatar answered Oct 31 '25 07:10

Mark Rotteveel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!