Terminating module execution

    Available in

    Syntax

    The EXIT statement causes execution of the procedure or trigger to jump to the final END statement from any point in the code, thus terminating the program.

    Using the EXIT statement in a selectable procedure:

    1. CREATE PROCEDURE GEN_100
    2. RETURNS (
    3. )
    4. BEGIN
    5. I = 1;
    6. WHILE (1=1) DO
    7. BEGIN
    8. IF (I=100) THEN
    9. EXIT;
    10. I = I + 1;
    11. END

    See also