
SQL Plus is the most basic
Oracle Database
Oracle Database (commonly referred to as Oracle DBMS, Oracle Autonomous Database, or simply as Oracle) is a proprietary multi-model database management system produced and marketed by Oracle Corporation.
It is a database commonly used for ru ...
utility, with a basic
command-line interface
A command-line interface (CLI) is a means of interacting with software via command (computing), commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user ...
, commonly used by users, administrators, and programmers.
Command types
SQL Plus understands five categories of text:
# SQL statements
#
PL/SQL
PL/SQL (Procedural Language for SQL) is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database (since version 6 - stored PL/SQL procedures/functions/packages/triggers sinc ...
blocks
# SQL Plus internal commands, for example:
#* environment control commands such as SET
#* environment monitoring commands such as SHOW
# Comments
# External commands prefixed by the ! char
Scripts can include all of these components.
An Oracle programmer in the appropriately configured software environment can launch SQL Plus, for example, by entering:
$ sqlplus scott/tiger
where the Oracle user
scott
has the password
tiger
. SQL Plus then presents a prompt with the default form of:
SQL>
Interactive use can then start by entering a SQL statement (terminated by a semicolon), a PL/SQL block, or another command. For example:
SQL> select 'Hello world' as example from dual;
EXAMPLE
--------------------------------
Hello world
History
The first version of SQL Plus was called ''UFI'' ("User Friendly Interface"). UFI appeared in Oracle database releases up to Version 4.
After Oracle programmers had added new features to UFI, its name became ''Advanced UFI''. The name "Advanced UFI" changed to "SQL Plus" with the release of the version 5 of Oracle.
Usage
Graphical interfaces from Oracle or third parties have diminished the proportion of
Oracle database
Oracle Database (commonly referred to as Oracle DBMS, Oracle Autonomous Database, or simply as Oracle) is a proprietary multi-model database management system produced and marketed by Oracle Corporation.
It is a database commonly used for ru ...
end-users who depend on the SQL Plus environment. Oracle shops typically continue to use SQL Plus scripts for batch updating or simple reports.
Oracle Corporation's wrappers/gui-fications/replacements for SQL Plus include:
* Oracle SQL Plus Worksheet, a component of
OEM
* iSQL Plus or iSQLPlus, a web-based utility
* SQL Worksheet, a component of
Oracle SQL Developer
* SQL Workshop (part of
Oracle Application Express)
Oracle 11g
Starting from Oracle database 11g, iSqlplus (web based) and sqlplus GUI no longer ship with Oracle database software.
The command-line SQL Plus interface continues in use, mostly for non-interactive scripting or for administrative purposes. The Server Manager Command Line a replacement of SQL*DBA is obsolete and SQL Plus 8i and later allows the user to issue statements like and when connected as SYSDBA. Server Manager 7.1 introduced the command to replace . SQL Plus 8i and later allows the use of CONNECT / AS SYSDBA
Compatibility
Other vendors have made their software somewhat compatible with SQL Plus script commands or offer a SQL Plus mode of operation. Relevant products include
TOAD
Toad (also known as a hoptoad) is a common name for certain frogs, especially of the family Bufonidae, that are characterized by dry, leathery skin, short legs, and large bumps covering the parotoid glands.
In popular culture (folk taxonomy ...
from
Quest Software
Quest Software, also known as Quest, is a privately held software company headquartered in Aliso Viejo, California, United States. Quest provides cloud management, software as a service, security, workforce mobility, and backup & recovery. The co ...
.
Integration
Variables
SQL Plus-internal variables, accessible within an SQL Plus session, include:
* user variables, displayable with the
DEFINE
command and referenceable with one or two cases of a prefixed character (default prefixes: '&' and '&&'). Oracle Corporation calls these variables "substitution variables". Programmers can use them anywhere in a SQL or PL/SQL statement or in SQL Plus commands. They can be populated by a literal using
DEFINE
or from the database using the
column
command.
** predefined variables, prefixed with an underscore ('_')
** substitution variables, useful for interacting with user-input
* bind variables, prefixed by a colon (':'), which can interact with the PL/SQL environment. Displayable with the VARIABLE and PRINT commands
Error trapping
The
WHENEVER
command specifies an action to perform in the event of the system detecting an SQL error
or an operating-system error
while running a subsequent SQL Plus command.
Installation and configuration
SQL*Plus needs to be installed and configured on the machine where you intend to use it. This usually involves setting up Oracle client software and configuring network connections to Oracle databases.
Supplementary software
SQL AssistantSQL Assistant add-on for SQL Plus Windows version extends SQL Plus with SQL automatic word completion, in-line Oracle SQL Reference, data export/import, code unit testing, data browsing, and code development functions.
rlwraprlwrap does
GNU
GNU ( ) is an extensive collection of free software (394 packages ), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operating systems popu ...
Readline like command completion for SQL Plus on
UNIX
Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
and
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
.
See also
*
Oracle SQL Developer
*
Oracle SQL/PLSQL Developer
*
techaid71/most-common-sqlplus-commands
References
External links
SQL Plus documentationPlus FAQ SQL Plus FAQSQL Plus tutorial
{{DEFAULTSORT:Sql Plus
Oracle Database
PL/SQL editors
SQL clients