Jessica,
When you are in SQL*Plus, there are three sets of commands that that environment can process:
1) SQL*Plus commands,
2) PL/SQL blocks, and
2) SQL commands
In SQL*Plus, when you issue a SQL command, such as SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, RENAME, GRANT, REVOKE, et cetera, SQL*Plus will not execute such a command until you enter either a semi-colon (";") as the last character on a command line, or enter a forward slash ("/") on a line of its own. For example, you can enter the command:
...and it will not exectute the command until it sees the semi-colon.
PL/SQL code blocks begin with either a "DECLARE" or a
"BEGIN" header, contain as many lines of PL/SQL code as your logic requires, and terminate with "END;" followed by a "/" on a line of its own. When SQL*Plus encounters the "/" character, it processes all lines of PL/SQL code in the SQL buffer.
SQL*Plus commands, however, bear absolutely no similarity or resemblance in form, structure, or syntax to SQL or PL/SQL commands. SQL*Plus commands execute upon your entry of an [Enter] (unless you use a line-continuation character, "-"). So, when I issue a SQL*Plus command such as:
Code:
COL x heading "Name" format a20
break on report
compute sum of salary on report
...et cetera
...each of the above SQL*Plus commands execute immediately upon sensing a carriage return.
Could this explain the anomalies that you are seeing?
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA)
[I can provide you with low-cost, remote Database Administration services: see our website and contact me via
www.dasages.com]