SQL*Plus

SQL*Plus (commonly known as sqlplus) is an Oracle database client that can run SQL and PL/SQL commands and display their results. SQL*Plus is the default, the simplest and the most basic Oracle utility, with a basic command-line interface, commonly used by users, administrators, and programmers.

Contents

Command types

SQL*Plus understands three categories of text:[1]

  1. SQL statements
  2. PL/SQL blocks
  3. SQL*Plus internal commands, for example:
    1. environment control commands such as SET
    2. environment monitoring commands such as SHOW

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" before the release of this version.

As of January 2012 the product continues to bear the name SQL*Plus.

Usage

Graphical interfaces from Oracle or third parties have diminished the proportion of Oracle database 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 11g

Starting from Oracle database 11g, iSqlplus (web based) and sqlplus graphical GUI no longer ship with Oracle database software.[6] The command-line SQL*Plus interface continues in use, mostly for non-interactive scripting or for administrative purposes (connect internal before Oracle 8i; sqlplus ... as sysdba later).

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 from Quest Software.

Integration

Variables

SQL*Plus-internal variables, accessible within an SQL*Plus session, include:

Supplementary software

See also

Oracle SQL Developer

References

  1. ^ "SQL*Plus at orafaq.com". Archived from the original on 2007-11-09. http://web.archive.org/web/20071109104758/http://www.orafaq.com/faq/sqlplus. Retrieved 2007-11-26. 
  2. ^ Evans, Robert (2008-10-01). "The SQL*Plus Worksheet". Cardiff University. http://docs.cs.cf.ac.uk/html/601/node4.html. Retrieved 2008-11-21. "Oracle's SQL*Plus Worksheet is a straight-forward, easy-to-use, graphical user interface for SQL." 
  3. ^ "ISQLPlus". Oracle FAQ. 2008-02-29. http://www.orafaq.com/wiki/ISQLPlus. Retrieved 2008-11-21. "iSQLPlus (iSQL*Plus) is a web-based utility similar to the SQL*Plus command line utility for executing SQL and PL/SQL commands (available up to Oracle 10gR2)." 
  4. ^ "Oracle SQL Developer 1.5: Feature List". Oracle Corporation. http://www.oracle.com/technology/products/database/sql_developer/files/featurelist_1_5.htm#nf_sql. Retrieved 2008-11-21. "The SQL*Plus commands supported by Oracle SQL Developer SQL Worksheet are listed [...]" 
  5. ^ "Oracle Application Express". Oracle Corporation. http://www.oracle.com/technology/products/database/application_express/html/what_is_apex.html. Retrieved 2008-11-21. "SQL Workshop provides tools to enable you to view and manage database objects from a Web browser. Use SQL Commands to run SQL and PL/SQL statements. ..." 
  6. ^ Deprecated Components in Oracle Database 11g Release 1 (11.1), retrieve by 25-Jun-2009
  7. ^ Alapati, Sam R. (2008) "4" Expert Oracle Database 11g Administration Apress pp. 118–119 ISBN 9781430210153 http://books.google.com/books?id=tdRes4IdLiIC&pg=PA118&lpg=PA118&dq=sqlplus+predefined+variable&source=bl&ots=7Qx008gycp&sig=PYHPGw7CVSsrKJwaXXLDR_ZtsLc&hl=en&ei=QcFvStL6NYPwsQOx48zNCA&sa=X&oi=book_result&ct=result&resnum=9. Retrieved 2009-07-29 
  8. ^ Roshak, Natalka (2005-11-06). "Spice up your SQL Scripts with Variables". Oracle FAQ. http://www.orafaq.com/node/515. Retrieved 2009-07-29. "& and && indicate substitution variables in SQL*Plus scripts or commands." 
  9. ^ Nyffenegger, René. "Using bind variables in SQL*Plus". René Nyffenegger's collection of things on the web. http://www.adp-gmbh.ch/ora/sqlplus/use_vars.html. Retrieved 2009-07-29. "In SQL*Plus, a bind variable is declared with variable [...] The value of the bind variable can then be printed with print" 

External links