KonnexionsGmbH / sqlparse

LALR grammar based SQL Parser
Other
43 stars 15 forks source link

Support table_collection_expression in DELETE, INSERT, SELECT and UPDATE. #132

Closed walter-weinmann closed 6 years ago

walter-weinmann commented 6 years ago

Grammar changes:

collection_expression
table_coll_expr

table_coll_expr -> TABLE '(' collection_expression ')'             : {table_coll_expr, '$3', []}.
table_coll_expr -> TABLE '(' collection_expression ')' '(' '+' ')' : {table_coll_expr, '$3', '+'}.

collection_expression -> column_ref   : '$1'.
collection_expression -> function_ref : '$1'.
collection_expression -> subquery     : '$1'.

table_dblink -> table_coll_expr           : '$1'.

Reference: https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/sql-language-reference.pdf

page 15-200 DELETE
page 18-63  INSERT
page 18-40  SELECT
page 19-143 UPDATE
page 19-147 table_collection_expression & collection_expression
walter-weinmann commented 6 years ago

@stoch & @c-bik: please comment.

c-bik commented 6 years ago

@walter-weinmann

  1. Can you please provide a diff style grammar rule changes in description?
  2. Can you provide some SQL examples which these grammar rules will cover along with the proposed parse tree?