TaoZhiMLND commented on issue #5421:
URL: https://github.com/apache/shardingsphere/issues/5421#issuecomment-624144419


   1、I found an answer in stackoverflow may explain the use of semicolon in 
Oracle JDBC.
   
   >   Usually the semi-colon is not part of the actual syntax of a statement 
(as most database internal APIs execute a single statement at a time). Instead 
the semi-colon is an 'end-of-statement' marker or statement separator that is - 
usually - defined in CLI or scripting tools for the database. This allows that 
tool to know when a statement ends, so it can send that single statement to the 
database for execution.
     On the other hand, the JDBC api is intended to execute a single(!) 
statement at a time, therefor you don't need such a separator (the statement is 
the whole string). This means that a semi-colon is not needed, and as it is not 
part of the actual statement syntax for a lot of database it is also a syntax 
error to include it. Some JDBC drivers will strip the last ; from a statement 
to 'fix' that, some drivers don't.
     Some drivers allow - contrary to the JDBC specification - multiple 
statements to be executed as a single string, this usually has to be enabled 
with a connection property, for example for MySQL it is the option 
allowMultiQueries (see the MySQL properties for details).
   
   Original answer link: 
<https://stackoverflow.com/questions/18941539/is-the-semicolon-necessary-in-sql>


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

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


Reply via email to