Skip to content

Latest commit

 

History

History
80 lines (54 loc) · 1.22 KB

sql-statement-deallocate.md

File metadata and controls

80 lines (54 loc) · 1.22 KB
title summary category aliases
DEALLOCATE
TiDB 数据库中 DEALLOCATE 的使用概况。
reference
/docs-cn/dev/reference/sql/statements/deallocate/

DEALLOCATE

DEALLOCATE 语句用于为服务器端预处理语句提供 SQL 接口。

语法图

DeallocateStmt:

DeallocateStmt

DeallocateSym:

DeallocateSym

Identifier:

Identifier

示例

{{< copyable "sql" >}}

PREPARE mystmt FROM 'SELECT ? as num FROM DUAL';
Query OK, 0 rows affected (0.00 sec)

{{< copyable "sql" >}}

SET @number = 5;
Query OK, 0 rows affected (0.00 sec)

{{< copyable "sql" >}}

EXECUTE mystmt USING @number;
+------+
| num  |
+------+
| 5    |
+------+
1 row in set (0.00 sec)

{{< copyable "sql" >}}

DEALLOCATE PREPARE mystmt;
Query OK, 0 rows affected (0.00 sec)

MySQL 兼容性

DEALLOCATE 语句与 MySQL 完全兼容。如有任何兼容性差异,请在 GitHub 上提交 issue

另请参阅