Firebird Documentation Index → Firebird 1.5 Language Ref. Update → PSQL statements → LEAVE |
Available in: PSQL
Added in: 1.5
Description: LEAVE immediately terminates a WHILE or FOR loop and continues with the first statement after the loop.
Example:
while (b < 10) do begin insert into Numbers(B) values (:b); b = b + 1; when any do begin execute procedure log_error (current_timestamp, 'Error in B loop'); leave; end end c = 0; while (c < 10) do begin ... ... end
If an error occurs during the insert, the event is logged and the loop terminated. The program continues at the line of code reading “
c = 0;
”
Firebird Documentation Index → Firebird 1.5 Language Ref. Update → PSQL statements → LEAVE |