Library |
Product |
Contents |
Index |
SQL*Plus enables you to manipulate SQL commands and PL/SQL blocks, and to perform many additional tasks as well. Through SQL*Plus, you can
command
An instruction you give SQL*Plus or Oracle.
block
A group of SQL and PL/SQL commands related to one another through procedural logic.
table
The basic unit of storage in Oracle.
query
query results
The data retrieved by a query.
report
Query results formatted by you through SQL*Plus commands.
The design of the SQL*Plus command language makes it easy to use. For example, to give a column labelled ENAME in the database the clearer heading "Employee", you might enter the following command:
COLUMN ENAME HEADING EMPLOYEE
Similarly, to list the column definitions for a table called EMP, you might enter this command:
DESCRIBE EMP
Designer/2000
a set of client/server design tools for database applications
a set of client/server and Web development tools
a set of end-user query tools
a set of 3GL programming language interfaces
an option to include full text storage and retrieval in databases
an option to include multi-dimensional (spatial) data in databases
a tool for applications using mobile and/or detached clients
a tool which enables database access through Web browsers and the Internet
Oracle Open Gateway Technology
a tool which enables access to data in non-Oracle databases
a development tool for object-oriented multimedia applications
an electronic messaging (Email), calendar, scheduling and document management system
a cross-platform tool for developing client/server applications against heterogeneous back-end data sources
a set of tools that enable cartridges to be programmed in multiple languages
a tool for developers using object oriented 3GL applicaions of Oracle8
Throughout this Guide, examples showing how to enter commands use a common command syntax and a common set of sample tables. Both are described below. You will find the conventions for command syntax particularly useful when referring to the reference portion of this Guide.
Feature
Example
Explanation
uppercase
BTITLE
Enter text exactly as spelled; it need not be in uppercase.
lowercase italics
column
A clause value; substitute an appropriate value.
words with specific meanings
c
A single character.
char
A CHAR value--a literal in single quotes--or an expression with a CHAR value.
d or e
A date or an expression with a DATE value.
expr
An unspecified expression.
m or n
A number or an expression with a NUMBER value.
text
A CHAR constant with or without single quotes.
variable
A user variable (unless the text specifies another variable type).
Table 1 - 1. Commands, Terms, and Clauses
Other words are explained where used if their meaning is not explained by context.
Feature
Example
Explanation
vertical bar
|
Separates alternative syntax elements that may be optional or mandatory.
brackets
[OFF|ON]
One or more optional items. If two items appear separated by |, enter one of the items separated by |. Do not enter the brackets or |.
braces
{OFF|ON}
A choice of mandatory items; enter one of the items separated by |. Do not enter the braces or |.
underlining
{OFF|ON}
A default value; if you enter nothing, SQL*Plus assumes the underlined value.
ellipsis
n...
Preceding item(s) may be repeated any number of times.
Table 1 - 2. Punctuation
Enter other punctuation marks (such as parentheses) where shown in the command syntax.
The exercises make use of the information in two sample tables:
EMP
Contains information about the employees of the sample company.
DEPT
Contains information about the departments in the company.
Figure 1 - 1 and Figure 1 - 2 show the information in these tables.
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO ----- ----- -------- ---- ----------- ------ ------ ------ 7369 SMITH CLERK 7902 17-DEC-80 800 20 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30 7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30 7566 JONES MANAGER 7839 02-APR-81 2975 20 7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30 7698 BLAKE MANAGER 7839 01-MAY-81 2850 30 7782 CLARK MANAGER 7839 09-JUN-81 2450 30 7788 SCOTT ANALYST 7566 09-DEC-82 3000 20 7839 KING PRESIDENT 17-NOV-81 5000 10 7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30 7876 ADAMS CLERK 7788 12-JAN-83 1100 20 7900 JAMES CLERK 7698 03-DEC-81 950 30 7902 FORD ANALYST 7566 03-DEC-81 3000 20 7934 MILLER CLERK 7782 23-JAN-82 1300 10
Figure 1 - 1. EMP Table
DEPTNO DNAME LOC --------- ------------- ----------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON
Figure 1 - 2. DEPT Table
Before you can begin using SQL*Plus, both Oracle and SQL*Plus must be installed on your computer. Note that in order to take full advantage of the enhancements in SQL*Plus Release 8.0, you must have Oracle8. For a list of SQL*Plus Release 8.0 enhancements, see Appendix B.
If you have multiple users on your computer, your organization should have a Database Administrator (called a DBA) who supervises the use of Oracle.
The DBA is responsible for installing Oracle and SQL*Plus on your system. If you are acting as DBA, see the instructions for installing Oracle and SQL*Plus in the Oracle installation and user's manual(s) provided for your operating system.
Keep a copy of your Oracle installation and user's manual(s) available for reference as you work through this Guide. When necessary, this Guide will refer you to your installation and user's manual(s).
When you have no more use for the sample tables, remove them by running another Oracle-supplied command file named DEMODROP. For instructions on how to run DEMOBLD and DEMODROP, see the Oracle installation and user's manual(s) provided for your operating system.
Prev Next |
Copyright © 1997 Oracle Corporation. All Rights Reserved. |
Library |
Product |
Contents |
Index |