SQLPlus: Oracle's Command-Line Interface

Rumman Ansari   Software Engineer   2024-10-16 01:19:05   6747  Share
Subject Syllabus DetailsSubject Details
☰ TContent
☰Fullscreen

Table of Content:

SQL*Plus is the most basic Oracle Database utility, with a basic command-line interface, commonly used by users, administrators, and programmers.

Command types

SQL*Plus understands five categories of text:

  1. SQL statements
  2. PL/SQL blocks
  3. SQL*Plus internal commands, for example:
    • environment control commands such as SET
    • environment monitoring commands such as SHOW
  4. Comments
  5. 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