DEALLOCATE

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

语法图

DeallocateStmt

DEALLOCATE - 图1

DeallocateSym

DEALLOCATE - 图2

Identifier

DEALLOCATE - 图3

  1. DeallocateStmt ::=
  2. DeallocateSym 'PREPARE' Identifier
  3. DeallocateSym ::=
  4. 'DEALLOCATE'
  5. | 'DROP'
  6. Identifier ::=
  7. identifier
  8. | UnReservedKeyword
  9. | NotKeywordToken
  10. | TiDBKeyword

示例

  1. PREPARE mystmt FROM 'SELECT ? as num FROM DUAL';
  1. Query OK, 0 rows affected (0.00 sec)
  1. SET @number = 5;
  1. Query OK, 0 rows affected (0.00 sec)
  1. EXECUTE mystmt USING @number;
  1. +------+
  2. | num |
  3. +------+
  4. | 5 |
  5. +------+
  6. 1 row in set (0.00 sec)
  1. DEALLOCATE PREPARE mystmt;
  1. Query OK, 0 rows affected (0.00 sec)

MySQL 兼容性

DEALLOCATE 语句与 MySQL 完全兼容。如发现任何兼容性差异,请尝试 TiDB 支持资源

另请参阅