Example of MySQL stored procedure begin END Compound statement usage
Begin_label:] BEGIN
[Statement_list]
End [End_label]
Stored subroutines can use the begin ... End Compound statement to contain multiple statements. Statement_list represents a list of one or more statements. Within Statement_list, each statement must end with a semicolon (;).
Compound statements can be marked. Unless Begin_label exist, End_label cannot be given, and if both exist, they must be the same.
Note that the optional [NOT] atomic clause is not currently supported. This means that a storage point with no interaction at the beginning of the instruction block is set, and that the BEGIN clause used in the context has no effect on the current interaction action.
Using multiple statements requires the client to send a query string containing the statement delimiter. This symbol is handled using the delimiter command on the command-line client. Change the end of the query delimiter (e.g. change to//) to make; Can be used in subroutine bodies.
Note : Please pay attention to the triple programming Tutorials section for more wonderful articles .