mjs0514 commented on issue #7869:
URL: 
https://github.com/apache/incubator-seata/issues/7869#issuecomment-3673601450

   Well, it may depend on your team's policy. Personally, I raised the issue 
because I didn't think it was a solution.
   
   If you use double quotes, I think the following situation will occur:
   
   For example, if you use double quotes to execute a DDL statement in Oracle, 
as follows:
   
   //oracle.sql
   CREATE TABLE vgroup_table
   (
   vGroup VARCHAR2(255) PRIMARY KEY,
   namespace VARCHAR2(255),
   "cluster" VARCHAR2(255)
   );
   
   In this case, Oracle creates the vgroup and namespace columns in uppercase, 
but cluster is created in lowercase because it's enclosed in double quotes.
   
   Also, you need to create the SQL query like this to execute it properly. 
INSERT INTO vgroup_table (vgroup, namespace, "cluster") VALUES (?, ?, ?)";
   
   Double quotes are required because they are case-sensitive. Without them, 
the query will not run because it is a reserved word in Oracle.
   
   What should I do if I need to run the same SQL statement on a different 
database vendor, such as H2 or DB2, instead of Oracle?
   
   //h2.sql
   CREATE TABLE vgroup_table
   (
   vGroup VARCHAR2(255) PRIMARY KEY,
   namespace VARCHAR2(255),
   "cluster" VARCHAR2(255)
   );
   
   Although it is not a reserved word in H2, double quotes are required to 
ensure that the cluster column is created in lowercase.
   
   If this isn't done, DAO will incur the additional cost of managing queries 
for each database vendor.
   
   In summary, if you want to use double quotes, you must choose one of two 
options:
   
   1) When writing DDL statements for each database vendor, even if a word is 
not a reserved word, if it's a reserved word for another vendor, you should 
handle case sensitivity using double quotes.
   2) The DAO should manage query statements for each database vendor.
   
   | vendor | Default Capitalization |
   |---|---|
   | H2 | Upper Case |
   | H2 | Upper Case |
   | H2 | Upper Case |
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to