Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 1.13 KB

File metadata and controls

50 lines (33 loc) · 1.13 KB
title DO | TiDB SQL Statement Reference
summary An overview of the usage of DO for the TiDB database.
category reference
aliases
/docs/dev/reference/sql/statements/do/

DO

This statement executes an expression, without returning a result. In MySQL, a common use-case is to execute stored programs without needing to handle the result. Since TiDB does not provide stored routines, this function has a more limited use.

Synopsis

DoStmt:

DoStmt

ExpressionList:

ExpressionList

Expression:

Expression

Examples

mysql> SELECT SLEEP(5);
+----------+
| SLEEP(5) |
+----------+
|        0 |
+----------+
1 row in set (5.00 sec)

mysql> DO SLEEP(5);
Query OK, 0 rows affected (5.00 sec)

mysql> DO SLEEP(1), SLEEP(1.5);
Query OK, 0 rows affected (2.50 sec)

MySQL compatibility

This statement is understood to be fully compatible with MySQL. Any compatibility differences should be reported via an issue on GitHub.

See also