PARSE SQL

描述

PARSE SQL 语法用于解析 SQL 并输出抽象语法树。

语法

语法 铁路图

  1. ParseSql ::=
  2. 'PARSE' sqlStatement

返回值说明

说明
parsed_statement解析SQL语句类型
parsed_statement_detail解析SQL语句细节

示例

  • 解析 SQL 并输出抽象语法树
  1. PARSE SELECT * FROM t_order;
  1. mysql> PARSE SELECT * FROM t_order;
  2. +----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  3. | parsed_statement | parsed_statement_detail |
  4. +----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  5. | MySQLSelectStatement | {"projections":{"startIndex":7,"stopIndex":7,"projections":[{"startIndex":7,"stopIndex":7}],"distinctRow":false},"from":{"tableName":{"startIndex":14,"stopIndex":20,"identifier":{"value":"t_order","quoteCharacter":"NONE"}}},"parameterCount":0,"parameterMarkerSegments":[],"commentSegments":[]} |
  6. +----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  7. 1 row in set (0.01 sec)

保留字

PARSE

相关链接