TherChenYang commented on code in PR #29329:
URL: https://github.com/apache/shardingsphere/pull/29329#discussion_r1421419718


##########
parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/value/literal/impl/StringLiteralValue.java:
##########
@@ -30,7 +30,11 @@ public final class StringLiteralValue implements 
LiteralValue<String> {
     private final String value;
     
     public StringLiteralValue(final String value) {
-        this.value = value.substring(1, value.length() - 1);
+        if (value.startsWith("N")) {

Review Comment:
   Ok, thank you for your CR. I will revise it carefully



##########
parser/sql/dialect/sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4:
##########
@@ -167,7 +168,11 @@ serviceName
     ;
 
 columnName
-    : (owner DOT_)? name
+    : (owner DOT_)? (name | scriptVariableName)
+    ;
+
+scriptVariableName
+    : DOLLAR_ LP_ name RP_

Review Comment:
   In SqlServer, $(ColumnName) looks more like a whole, and the '($' and '()' 
need to be preserved. After parsing, when using it, you need to determine if 
'$()' is a script variable. Then, when executing SQL similar to 'sqlcmd -v 
ColumnName="FirstName" -i c:\testscript.sql', replace the corresponding script 
variable.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to