The Oracle Relational Database Management System (rdbms) is an industry leading database system designed for mission critical data storage and retrieval



Download 113.08 Kb.
Page2/3
Date28.05.2018
Size113.08 Kb.
#50904
1   2   3

3.2 SQL*Plus Commands


SQL*Plus commands allow a user to manipulate and submit SQL statements. Specifically, they enable a user to:

  • Enter, edit, store, retrieve, and run SQL statements

  • List the column definitions for any table

  • Format, perform calculations on, store, and print query results in the form of reports

  • Access and copy data between SQL databases

The following is a list of SQL*Plus commands and their functions. The most commonly used commands are emphasized in italics:

  • / - Execute the current SQL statement in the buffer - same as RUN

  • ACCEPT - Accept a value from the user and place it into a variable

  • APPEND - Add text to the end of the current line of the SQL statement in the buffer

  • AUTOTRACE - Trace the execution plan of the SQL statement and gather statistics

  • BREAK - Set the formatting behavior for the output of SQL statements

  • BTITLE - Place a title on the bottom of each page in the printout from a SQL statement

  • CHANGE - Replace text on the current line of the SQL statement with new text

  • CLEAR - Clear the buffer

  • COLUMN - Change the appearance of an output column from a query

  • COMPUTE - Does calculations on rows returned from a SQL statement

  • CONNECT - Connect to another Oracle database or to the same Oracle database under a different user name

  • COPY - Copy data from one table to another in the same or different databases

  • DEL - Delete the current line in the buffer

  • DESCRIBE - List the columns with datatypes of a table (Can be abbreviated as DESC)

  • EDIT - Edit the current SQL statement in the buffer using an external editor such as vi or emacs

  • EXIT - Exit the SQL*Plus program

  • GET - Load a SQL statement into the buffer but do not execute it

  • HELP - Obtain help for a SQL*Plus command (In some installations)

  • HOST - Drop to the operating system shell

  • INPUT - Add one or more lines to the SQL statement in the buffer

  • LIST - List the current SQL statement in the buffer

  • QUIT - Exit the SQL*Plus program

  • REMARK - Place a comment following the REMARK keyword

  • RUN - Execute the current SQL statement in the buffer

  • SAVE - Save the current SQL statement to a script file

  • SET - Set an environemnt variable to a new value

  • SHOW - Show the current value of an environemnt variable

  • SPOOL - Send the output from a SQL statement to a file

  • START - Load a SQL statement located in a script file and then run that SQL statement

  • TIMING - Used to time the execution of SQL statements for performance analysis

  • TTITLE - Place a title on the top of each page in the printout from a SQL statement

  • UNDEFINE - Delete a user defined variable

Examples of these SQL*Plus commands are given in the following sections.

Note the distinction made between SQL*Plus Commands and SQL Statements. SQL*Plus commands are proprietary to the Oracle SQL*Plus tool. SQL is a standard language that can be used is just about any Relational Database Management System (RDBMS).

3.3 SQL*Plus Help Facilities

Some versions of SQL*Plus store the help documentation in the database and make it available via the SQL*Plus command line. Newer installations have changed this and now store the documentation in HTML format which can be read using a World Wide Web Browser such as MS Internet Explorer or Firefox.



The following two sections describe how to invoke help in SQL*Plus under Windows and under UNIX. The method you use to access help may differ according to how your software was installed.

3.3.1 Getting Help Under Windows

To get HELP on any of the oracle tools, use the Oracle8 or Oracle8i Documentation which is accessible through a web browser. To access the Oracle8 Documentation, click on the Windows button, then Programs, Oracle - OraHomeXX and finally Oracle8 Documentation: . This will launch your local Web Browser (Netscape Navigator/Communicator or Microsoft Internet Explorer) and the Welcome to the Oracle8 Documentation Library! screen will be displayed. From here, click on the "TEXT VERSION" link to get to the Oracle Product Documentation Library.

Once in the Oracle8 Documentation main screen, click on Oracle8 Enterprise Edition and then SQL*Plus Getting Started for Windows . Other documentation you may find useful are:



Help File/Link

Contents

SQL Reference

Comprehensive syntax for all SQL statements

SQL*Plus Getting Started for Windows

Specific SQL*Plus commands and options for Windows NT/2000/XP users.

SQL*Plus Quick Reference

Quick reference guide to SQL*Plus commands.

SQL*Plus User's Guide and Reference

Comprehensive guide to using SQL*Plus.

Download 113.08 Kb.

Share with your friends:
1   2   3




The database is protected by copyright ©ininet.org 2024
send message

    Main page