BEGIN END

Stai visualizzando una vecchia versione di questo article. Visualizza la versione più recente.

Sintassi

[begin_label:] BEGIN
    [lista_istruzioni]
END [end_label]

Spiegazione

La sintassi BEGIN ... END serve per scrivere istruzioni composte, che possono apparire all'interno degli Stored Program. Un'istruzione composta può contenere diverse istruzioni racchiuse tra le parole chiave BEGIN e END. lista_istruzioni rappresenta una lista di una o più istruzioni, ognuna delle quali termina con un punto e virgola (;). lista_istruzioni è opzionale; questo significa che le istruzioni composte vuote (BEGIN END) sono permesse.

Use of multiple statements requires that a client is able to send statement strings containing the ; statement delimiter. This is handled in the mysql command-line client with the delimiter command. Changing the ; end-of-statement delimiter (for example, to //) allows ; to be used in a program body.

A compound statement can be labeled. end_label cannot be given unless begin_label also is present. If both are present, they must be the same.

Commenti

Sto caricando i commenti......
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.