EXECUTE
+3
T
C
d
O
The EXECUTE
statement provides an SQL interface to server-side prepared statements.
Synopsis
- ExecuteStmt
ExecuteStmt ::=
'EXECUTE' Identifier ( 'USING' UserVariable ( ',' UserVariable )* )?
Examples
mysql> PREPARE mystmt FROM 'SELECT ? as num FROM DUAL';
Query OK, 0 rows affected (0.00 sec)
mysql> SET @number = 5;
Query OK, 0 rows affected (0.00 sec)
mysql> EXECUTE mystmt USING @number;
+------+
| num |
+------+
| 5 |
+------+
1 row in set (0.00 sec)
mysql> DEALLOCATE PREPARE mystmt;
Query OK, 0 rows affected (0.00 sec)
MySQL compatibility
The EXECUTE
statement in TiDB is fully compatible with MySQL. If you find any compatibility differences, report a bug.
See also
EXECUTE | TiDB SQL Statement Referencewas last updated 10/23/2024, 6:30:27 AM: *: init release-8.4 configs (#19187)