- 15.6.7.1 声明 ...CONDITION 语句15.6.7.1 DECLARE ... CONDITION Statement
- 15.6.7.2 声明 ...HANDLER 语句15.6.7.2 DECLARE ... HANDLER Statement
- 15.6.7.3 GET DIAGNOSTICS 语句15.6.7.3 GET DIAGNOSTICS Statement
- 15.6.7.4 RESIGNAL 语句15.6.7.4 RESIGNAL Statement
- 15.6.7.5 SIGNAL 语句15.6.7.5 SIGNAL Statement
- 15.6.7.6 处理程序的作用域规则15.6.7.6 Scope Rules for Handlers
- 15.6.7.7 MySQL 诊断区15.6.7.7 The MySQL Diagnostics Area
- 15.6.7.8 条件处理以及 OUT 或 INOUT 参数15.6.7.8 Condition Handling and OUT or INOUT Parameters
条件,在需要特殊处理的存储程序执行过程中出现,例如退出当前程序块或继续执行。处理程序可以定义为一般条件,如警告或异常,也可以定义特定条件,如特定错误代码。特定条件可以被赋予名称,并在处理程序中以此方式引用。Conditions may arise during stored program execution that require special handling, such as exiting the current program block or continuing execution. Handlers can be defined for general conditions such as warnings or exceptions, or for specific conditions such as a particular error code. Specific conditions can be assigned names and referred to that way in handlers.
要命名条件,请使用 DECLARE ...
CONDITION 语句。要声明一个处理程序,请使用 DECLARE ...
HANDLER 语句。参见 第 15.6.7.1 节,“DECLARE ...CONDITION 语句“,以及 第 15.6.7.2 节,”声明 ...HANDLER 语句“。关于服务器在条件发生时如何选择处理程序的信息,请参见 第 15.6.7.6 节,”Scope Rules for Handlers“。To name a condition, use the
DECLARE ...
CONDITION statement. To declare a handler, use the
DECLARE ...
HANDLER statement. See
Section 15.6.7.1, “DECLARE ... CONDITION Statement”, and
Section 15.6.7.2, “DECLARE ... HANDLER Statement”. For information about how the
server chooses handlers when a condition occurs, see
Section 15.6.7.6, “Scope Rules for Handlers”.
要提出条件,请使用 SIGNAL语句。要修改条件处理程序中的条件信息,可以使用RESIGNAL。参见 第 15.6.7.1 节,”DECLARE ...CONDITION Statement“,以及 第 15.6.7.2 节,”DECLARE ...HANDLER 语句“。To raise a condition, use the
SIGNAL statement. To modify
condition information within a condition handler, use
RESIGNAL. See
Section 15.6.7.1, “DECLARE ... CONDITION Statement”, and
Section 15.6.7.2, “DECLARE ... HANDLER Statement”.
要从诊断区域获取信息,请使用 GET DIAGNOSTICS 语句(参见 第 15.6.7.3 节,“GET DIAGNOSTICS Statement”)。有关诊断区的信息,请参见 第 15.6.7.7 节,“MySQL 诊断区”。To retrieve information from the diagnostics area, use the
GET DIAGNOSTICS statement (see
Section 15.6.7.3, “GET DIAGNOSTICS Statement”). For information about the
diagnostics area, see Section 15.6.7.7, “The MySQL Diagnostics Area”.