Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Standards: Semicolon or Backslash
Hi all,
We're having a discussion over SQL scripting standards. We're trying to decide on best practice for ending a SQL statement.
OPTION (A) - BACKSLASH
BEGIN
EXECUTE PL_SQL_BLOCK;
END;
/
UPDATE TABLE
SET COLUMN = VALUE
/
OPTION (B) - SEMICOLON
BEGIN
EXECUTE PL_SQL_BLOCK;
END;
/
UPDATE TABLE
SET COLUMN = VALUE;
The argument for option (A) is that since we need '/' at the end of PL/SQL
blocks, it is consistent to have them for SQL too.
The argument for option (B) is that some developers have a tendency to use ';' and '/' and you end up with the update being run twice. ie.
UPDATE TABLE
SET COLUMN = VALUE;
/
I'd personally favour (B) as I think the merit of discouraging inadvertent duplicate runs of the same SQL is a better gain than the consistency of having everything end in a '/'.
Any comments, suggestions etc. on this?
Many thanks
- Bill.
-- Intasys Billing Technologies Ltd. www.intasysbilling.com 74 Commercial Street, Commercial Quay, Leith, Edinburgh EH6 6LX tel (0)131 625 8200 fax (0)131 625 8201 email wbuchan_at_uk.intasys.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Bill Buchan INET: wbuchan_at_uk.intasys.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Tue Nov 19 2002 - 11:19:25 CST