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/09/07 15:49:56 UTC
[GitHub] [shardingsphere] Icesource commented on a change in pull request #12247: add SQLServer grammar Create View
Icesource commented on a change in pull request #12247:
URL: https://github.com/apache/shardingsphere/pull/12247#discussion_r703632921
##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DDLStatement.g4
##########
@@ -39,6 +39,10 @@ createProcedure
: CREATE (OR ALTER)? (PROC | PROCEDURE) procedureName procParameters createProcClause
;
+createView
+ : CREATE (OR ALTER)? VIEW viewName createViewClause
+ ;
+
Review comment:
@jingshanglu The grammar definition here is a bit confusing. ```CREATE (OR ALTER)?``` is defined in CREATE syntax. It corresponds to such a sentence “CREATE OR ALTER VIEW ...”. This is a new T-SQL language statement announced in SQL Server 2016 SP1. And it can be applied on the following object: procedures,functions,triggers and views.
https://docs.microsoft.com/en-us/archive/blogs/sqlserverstorageengine/create-or-alter-another-great-language-enhancement-in-sql-server-2016-sp1.
Create View Definition: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-view-transact-sql?view=sql-server-ver15
Alter View Definition: https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-view-transact-sql?view=sql-server-ver15
Although their grammar is almost the same, should I think it(```CREATE OR ALTER```) should be parsed as a SQLServerCreateViewStatement ?
--
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