« Return to Thread: Documentation Style Issue - semi-colon at the end of SQL statement examples

Re: Documentation Style Issue - semi-colon at the end of SQL statement examples

by Bernt M. Johnsen :: Rate this Message:

Reply to Author | View in Thread

Details from the standard (maybe I'm just nit-picking.... ;-)

Semicolon in SQL is used
1) After statements in trigger and procedure bodies (we don't support this)
2) In various embedded SQL variants (Statements are terminated with
semicolon when SQL is embedded in Ada, C, Pascal, PL/I. Declarations is
terminated with semicolon when SQL is embedded in C and MUMPS... etc)
3) A "direct SQL statement" is terminated by semicolon (as in ij)

I think semicolon should *only* be used in examples when the standard
requires a semicolon. And that is basically exactly what Army and Knut
Anders points out.

Knut Anders Hatlen wrote:

> Laura Stewart <scotsmatrix@...> writes:
>
>> Hi -
>> Should there be a semi-colon at the end of the SQL statement examples
>> in the Derby documentation.  In other documentation work that I have
>> done, this was the standard. I just wanted to check with the Derby
>> community to see what is appropriate for the Derby docs.
>
> If the example is shown in ij, it should be there. If it is just an
> example SQL statement, I think it should be written without a
> semicolon.
>

--
Bernt Marius Johnsen, Database Technology Group,
Staff Engineer, Technical Lead Derby/Java DB
Sun Microsystems, Trondheim, Norway



signature.asc (260 bytes) Download Attachment

 « Return to Thread: Documentation Style Issue - semi-colon at the end of SQL statement examples