You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/06/27 02:48:54 UTC

[GitHub] [shardingsphere] ThanoshanMV commented on a change in pull request #11027: Add Oracle SQL - Insert statement

ThanoshanMV commented on a change in pull request #11027:
URL: https://github.com/apache/shardingsphere/pull/11027#discussion_r659252503



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/dml/OracleInsertStatement.java
##########
@@ -17,13 +17,41 @@
 
 package org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.dml;
 
+import lombok.Setter;
 import lombok.ToString;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubquerySegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.InsertMultiTableElementSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.OracleStatement;
 
+import java.util.Optional;
+
 /**
  * Oracle insert statement.
  */
+@Setter
 @ToString
 public final class OracleInsertStatement extends InsertStatement implements OracleStatement {
+    
+    private SubquerySegment selectSubquery;

Review comment:
       In an `INSERT` statement, with the help of `insertIntoClause` we can add table elements such as `SimpleTableSegment`, `SubquerySegment`. Those are available in `InsertStatement`. But in Oracle's `insertSingleTable` and `insertMultiTable` clause, it expects a `SubquerySegment` after `insertIntoClause`. I think this is specific to Oracle insert statement.
   
   ![insertSingleTable](https://user-images.githubusercontent.com/48581379/123531196-1e2b1f80-d720-11eb-9f0c-a305b285eafb.png)
   
   ![insertMultiTable](https://user-images.githubusercontent.com/48581379/123531197-22573d00-d720-11eb-929f-b3c61c90ddc3.png)
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org