DECLARE CONDITION

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

Sintassi

DECLARE nome_condizione CONDITION FOR valore_condizione

condition_value:
    SQLSTATE [VALUE] valore_sqlstate
  | codice_errore

Description:

L'istruzione DECLARE ... CONDITION definisce una condizione di errore con nome. Questo comando specifica una condizione che deve essere gestita separatamente e le associa un nome. E' possibile fare riferimento ad essa con il suo nome, in un'istruzione compostaDECLARE ... HANDLER.

A condition_value for DECLARE ... CONDITION can be an SQLSTATE value (a 5-character string literal) or a MySQL error code (a number). You should not use SQLSTATE value '00000' or MySQL error code 0, because those indicate sucess rather than an error condition. For a list of SQLSTATE values and MySQL error codes, see http://dev.mysql.com/doc/refman/5.1/en/error-messages-server.html.

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.