+ 7
Semicolon mandatory or not?
It is not clear to me the comment: Remember to end each SQL statement with a semicolon to indicate that the statement is complete and ready to be interpreted. In this tutorial, we will use semicolon at the end of each SQL statement. If semicolon must be used, why state that they will be used in the tutorial? What happen if we don't use semicolon? Thanks in advance for your help.
7 ответов
+ 4
when using more than one statement, you have to end each statement with a semicolon.
+ 2
Hi Daniele, technically you could dispense with the terminator ;
bit I suggest to use it, because if adhere to a standard without a loss of functionality, then our code is not tied to a propietary vendor.
I hope I answered to your question. Cheers Francesco.
+ 1
Its not mandatory its optional in SQL.
+ 1
basically the semicolon is used to terminal the command, separated them with others.
if your command is the last one in block of code it does not need to have semicolon, most of programing languages have that behavior
+ 1
it's optional in sql
+ 1
It depends on which "dialect" SQL you are using. T_SQL requires a semicolon when have more than 1 query in a commander. However, I do not think it is optional at all when I was using WinSQL software. It doesn't accept a semicolon at all.
+ 1
all queries should be ended with ;