You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2018/04/09 18:20:00 UTC

[jira] [Created] (CALCITE-2244) CTEs in DML: "WITH ... INSERT / UPDATE / DELETE / MERGE"

Julian Hyde created CALCITE-2244:
------------------------------------

             Summary: CTEs in DML: "WITH ... INSERT / UPDATE / DELETE / MERGE"
                 Key: CALCITE-2244
                 URL: https://issues.apache.org/jira/browse/CALCITE-2244
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde
            Assignee: Julian Hyde


Support common-table expressions (CTEs) in DML. In other words, allow INSERT, UPDATE, DELETE, MERGE statements to be prefixed by a WITH clause that defines "temporary views".

E.g. {code}WITH TokyoEmps AS
  SELECT *
  FROM Emps
  WHERE office = 'Tokyo'
DELETE FROM Tokyo Emps{code}

The effect should be pretty much the same as if {{TokyoEmps}} were a view.

This is not standard SQL. As of SQL 2014, only a {{<query expression>}} can have a {{<with clause>}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)