EXECUTE 语句

语法

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

说明

准备好一个用 PREPARE 修饰的语句后,可以通过EXECUTE 命令执行它。如果语句含有参数,就必须用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.

Example

See example in PREPARE.

Comments

Comments loading...
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.