RelationalDBDesign RelationalDBDesign


DB Creation   «Prev 

Using a forwardslash to terminate SQL statements

You can use the forward slash character to terminate an SQL statement as an alternative to the semicolon. Many of the Oracle-supplied DBA scripts use this method. When the forward slash is used, it must be on a line by itself and it must be the first character on that line. The following common query illustrates the use of the forwardslash character. The query retrieves a list of users who are currently logged into the database.

SVRMGR> SELECT username, sid, serial#
2> FROM v$session
3> /

USERNAME                      SID        SERIAL#

----------------------------- ---------- ----------

																																		1          1

																																		2          1

																																		3          1

																																		4          1

																																		5          1

																																		6          1

																																		7         35

																																		8         35

SYS                                   11          5

9 rows selected.
SVRMGR>

Using SQL*Plus to execute SQL statements

The choice between using a forward slash and a semicolon is purely a matter of personal preference. Use whichever method is easiest for you.