Oracle: SQL*Plus
Tutorial


Under construction
For additional information, the following sites can be accessed:

Yahoo's Oracle index section identifies a number of Oracle related sites
Oracle faq contains several hints on Oracles products, including SQL Plus and Oracle SQL
Oracle Underground contains many Oracle related links.


[Logging on/off |SQL Plus Commands |Data Definition |Data Manipulation ]

Logging On/Off

In windows, find the Oracle group and click on SQL Plus. You will be prompted for your UserID, password, hoststring. Enter the information indicated in class. If successful, you will see the SQL> prompt.

SQL Plus Commands

[Introduction |Line Editing |Using Notepad for editing |Sending results to a file |Retrieving a file ]

Introduction

At the SQL prompt, you can begin typing any SQL command. Upon hitting return (i.e., enter key) the SQL prompt will change to line number prompts. When you are finished typing a command, type / or RUN to execute the SQL command. Also, a semicolon at the end of the SQL command will execute the command immediately after hitting return. In addition to SQL commands, /, and RUN, other commands can be issued at the SQL prompt (a semicolon does not have to follow the nonSQL commands).

Line Editing

One way to change an SQL statement in the buffer is by using the line editor. The following are a list of line edit commands.

Using Notepad for Editing

You can use Notepad to edit the contents of the buffer. There are two ways to enter Notepad. When you are finished editing, click on File/exit (in Notepad). Next, type GET buffername at the SQL prompt. The buffer name will be listed a few lines up in SQL Plus upon returning to SQL Plus. Type RUN, to execute the command.

Notepad can also be used to save the buffer contents. Use File/Save As to create a permanent file.

Multiple SQL commands can be typed in Notepad. End each SQL command (except the last one) with a semicolon. After exiting notepad, type Start buffername instead of GET buffername to run all of the commands. Start filename can also be used to execute SQL command that are stored in a file.

Sending the Results to a File

To send queries and their results to a file for later printing (e.g., turning in homework assigments), the spool command is used. On the menu go to FILE/Spool to begin spooling--it will ask for a file name. To quit spooling, go to FILE/Spool and then click on end Spool.

Retrieving a File

To retrieve SQL command from a file use GET filename or START filename. GET filename places the file into the buffer. START filename executes the commands in the file.
Last modified: December 11, 2000
Dirk Baldwin, MIS, UW-Parkside, dirk.baldwin@uwp.edu