10bet网址
MySQL 5.7 Reference Manual
Related Documentation Download this Manual Excerpts from this Manual

13.5.2 EXECUTE Statement

EXECUTEstmt_name[USING @var_name[, @var_name] ...]

After preparing a statement withPREPARE, you execute it with anEXECUTEstatement that refers to the prepared statement name. If the prepared statement contains any parameter markers, you must supply aUSINGclause that lists user variables containing the values to be bound to the parameters. Parameter values can be supplied only by user variables, and theUSINGclause 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.

For examples, seeSection 13.5, “Prepared Statements”.