The
exit statement terminates a procedure or
user-defined function before normal processing is expected to end. When the statement is executed, processing stops for the current procedure or function, and control is passed to the next procedure or function.
When utilized in a user-defined function, an optional argument, return_value, sets the function's return value before exiting the function. The type of the argument, either a numeric or string expression, must match the function's return type.