The following are examples of procedures with a single statement that is not enclosed in a BEGIN … END compound statement:
- A procedure with a single SET statement:
CREATE PROCEDURE sp_sample4a (IN in_param INTEGER, OUT out_param INTEGER) SET out_param = in_param + 1;
- A procedure with a WHILE statement:
CREATE PROCEDURE sp_sample4b (IN in_param INTEGER, OUT out_param INTEGER) WHILE (in_param < 20) SET out_param = in_param + 1; END WHILE;