これは古いスレッドですが、偶然見つけただけで、完全には説明されていないと感じています。
/ の意味の間には、SQL*Plusに大きな違いがあります。 および; 動作が異なるためです。
;コード> / に対して、SQLステートメントを終了します 現在の「バッファ」にあるものは何でも実行します。したがって、;を使用する場合 および / ステートメントは実際には2回実行されます。
/を使用すると簡単にわかります ステートメントを実行した後:
SQL*Plus: Release 11.2.0.1.0 Production on Wed Apr 18 12:37:20 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning and OLAP options
SQL> drop table foo;
Table dropped.
SQL> /
drop table foo
*
ERROR at line 1:
ORA-00942: table or view does not exist
この場合、実際にエラーに気づきます。
ただし、次のようなSQLスクリプトがあると仮定します。
drop table foo;
/
そして、これはSQL * Plus内から実行されるため、非常に混乱します。
SQL*Plus: Release 11.2.0.1.0 Production on Wed Apr 18 12:38:05 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning and OLAP options
SQL> @drop
Table dropped.
drop table foo
*
ERROR at line 1:
ORA-00942: table or view does not exist
/ ;が埋め込まれたステートメントを実行するために主に必要です CREATE PROCEDUREのように 、 CREATE FUNCTION 、 CREATE PACKAGE ステートメントおよびBEGIN... ENDの場合 ブロック。