[begin_label:] BEGIN statement(s) END [end_label]
Stored routines may contain multiple statements, using a BEGIN ... END compound statement.
begin_label and end_label must be the same, if both are specified.
Please note that the optional [NOT] ATOMIC clause is not yet supported. This means that no transactional savepoint is set at the start of the instruction block and the BEGIN clause used in this context has no effect on the current transaction.
Multiple statements requires that a client is able to send query strings containing ;. This is handled in the mysql command-line client with the delimiter command. Changing the ; end-of-query delimiter (for example, to |) allows ; to be used in a routine body.