SQL*Plus Commands
Here is a list of some essential SQLPlus Commands:
Command | Syntax | Description |
---|---|---|
CONNECT | CONNECT username/password@hostname:port/service_name; | Connects to a database using the specified credentials and connection details. |
SELECT | SELECT * FROM tablename; | Executes an SQL query to retrieve data from a table. |
DESCRIBE | DESCRIBE tablename; | Displays the structure of a table (columns, data types, etc.). |
SET LINESIZE | SET LINESIZE n; | Sets the maximum line width for query output. |
SET PAGESIZE | SET PAGESIZE n; | Sets the number of lines per page for query output. |
SPOOL | SPOOL filename; | Redirects query output to a file. |
START | START script.sql; | Executes a script file. |
EDIT | EDIT; | Opens the default text editor to edit the current command buffer. |
HOST | HOST command; | Executes an operating system command. |
QUIT or EXIT | QUIT; or EXIT; | Disconnects from the database and exits SQL*Plus. |
VARIABLE | VARIABLE my_var NUMBER; | Defines and uses variables in SQL*Plus. |
COLUMN | COLUMN column_name FORMAT A20; | Formats query output for a specific column. |
SET ECHO | SET ECHO OFF; | Suppresses command echoing. |
SET TIMING | SET TIMING ON; | Displays execution time for SQL statements. |
SQL*Plus Command Reference
SQL*Plus is a command-line tool for Oracle Database that allows users to interact with the database using SQL and PL/SQL commands.
Here, we will discuss the SQL*Plus commands, and understand how to use the SQL*Plus command-line argument.
Contact Us