PARSE SQL

Description

The PARSE SQL syntax is used to parse SQL and output abstract syntax tree.

Syntax

Grammar Railroad diagram

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

Return Value Description

ColumnDescription
parsed_statementparsed SQL statement type
parsed_statement_detaildetail of the parsed statement

Example

  • Parse SQL and output abstract syntax tree
  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)

Reserved word

PARSE