8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

15.5.2 EXECUTE 语句15.5.2 EXECUTE Statement

EXECUTE stmt_name
    [USING @var_name [, @var_name] ...]

在使用 PREPARE 语句准备好语句之后,你可以使用引用该预处理语句名称的 EXECUTE 语句来执行它。如果预处理语句包含任何参数标记,则必须提供一个 USING 子句,列出包含要绑定到参数值的用户变量。参数值只能通过用户变量提供,并且 USING 子句中必须列出的变量数量与语句中的参数标记数完全一致。After preparing a statement with PREPARE, you execute it with an EXECUTE statement that refers to the prepared statement name. If the prepared statement contains any parameter markers, you must supply a USING clause that lists user variables containing the values to be bound to the parameters. Parameter values can be supplied only by user variables, and the USING clause must name exactly as many variables as the number of parameter markers in the statement.

你可以多次执行同一预处理语句,每次向其传递不同的变量,或者在每次执行之前将变量设置为不同的值。You can execute a given prepared statement multiple times, passing different variables to it or setting the variables to different values before each execution.

示例请参见 第 15.5 节,“预处理语句”。For examples, see Section 15.5, “Prepared Statements”.