For some combinations of actual type and derived type, an automatic repreparation of the statement is triggered, to ensure closer compatibility with previous versions of MySQL. Repreparation does not occur if any of the following conditions are true: 

• NULL  is used as the actual parameter value. 

•A parameter is an operand of a CAST() . (Instead, a cast to the derived type is attempted, and an exception raised if the cast fails.) 

•A parameter is a string. (In this case, an implicit CAST(? AS derived_type )  is performed.) 

•The derived type and actual type of the parameter are both INTEGER  and have the same sign. 

•The parameter’s derived type is DECIMAL  and its actual type is either DECIMAL  or INTEGER . 

•The derived type is DOUBLE  and the actual type is any numeric type. 

•Both the derived type and the actual type are string types. 

•If the derived type is temporal and the actual type is temporal. Exceptions : The derived type is TIME  and the actual type is not TIME ; the derived type is DATE  and the actual type is not DATE . 

•The derived type is temporal and the actual type is numeric. 

For cases other than those just listed, the statement is reprepared and the actual parameter types are used instead of the derived parameter types. 

These rules also apply to a user variable referenced in a prepared statement. 

Using a different data type for a given parameter or user variable within a prepared statement for executions of the statement subsequent to the first execution causes the statement to be reprepared. This is less efficient; it may also lead to the parameter’s (or variable’s) actual type to vary, and thus for results to be inconsistent, with subsequent executions of the prepared statement. For these reasons, it is advisable to use the same data type for a given parameter when re-executing a prepared statement. 

## 13.5.2 EXECUTE Statement 

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

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. 

## 13.5.3 DEALLOCATE PREPARE Statement 

For examples, see Section 13.5, “Prepared Statements” . 

{DEALLOCATE | DROP} PREPARE stmt_name 

To deallocate a prepared statement produced with PREPARE , use a DEALLOCATE PREPARE  statement that refers to the prepared statement name. Attempting to execute a prepared statement after deallocating 

