TPN 1: The SQL Command Editor: Types of Commands in Sqlplus
TPN 1: The SQL Command Editor: Types of Commands in Sqlplus
SQLPlus Commands: Internal commands of the SQLPlus editor, mainly used for
configuration. These commands do not manipulate database data. We will test these
commands in this lab.
SQL Commands: The query language used to retrieve and manipulate database data.
PL/SQL Commands: Oracle's procedural language, which integrates SQL queries with
procedural constructs (such as variables, loops, control structures, etc.).
Important Instruction
Once the SQL> prompt is displayed, you can start entering SQL commands.
Do not leave an empty line in SQLPlus for the same SQL statement.
SQLPlus is not case-sensitive for commands (e.g., SELECT and select are equivalent).
SQLPlus is case-sensitive for string values. Example: 'example' is different from
'EXAMPLE'.
SQL statements can be spread across multiple lines for better readability.
These statements are stored in a buffer, and the lines are numbered.
To execute a SQL statement:
o End the line with a semicolon (;).
o Press Enter to execute the command.
After executing a SQL command, SQLPlus will display the result.
USTHB – Computer Science Faculty 2024-2025
Module DB- L2 ISIL A
Command Description
SQLPlus
CONNECT Establishes a new connection. Syntax: CONN[ECT]
"username" "password"
DISCONNECT Disconnects from the database. Syntax: DISC[ONNECT]
QUIT Exits the SQLPlus tool and disconnects Syntax: QUIT
from the database.
RUN The RUN command or « / » displays the Syntax: R[UN] or /
content of the buffer and executes the
stored instruction.
EDIT Opens a file. Syntax: ED[IT]
filename[.extension]
SHOW USER Displays the currently connected user. Syntax: SHO[W] USER
SPOOL path\to\save_directory\filename_without_extension
SPOOL c:/TPBDD/sauvegarde
SPOOL OFF