SQL*Plus Getting Started
Release 8.1.5 for Windows NT and Windows 95/98
A69025-01

Library

Product

Contents

Index

PrevNext

2
Using SQL*Plus

This chapter explains how to start and use SQL*Plus from both the command line interface and the graphical user interface, and describes the menu options.

Specific topics discussed are:

Using the Command Line Interface

The command line interface is a standard feature of SQL*Plus on all operating system platforms.

To start the SQL*Plus command line interface:

  1. If you are connecting to a remote Oracle database, make sure your SQL*Net/networking software is installed and working properly. For more information, see  Net8 Administrator's Guide.
  2. Start an MS-DOS command prompt window.
  3. Enter the following at the command prompt to start SQL*Plus:

  4. SQLPLUS
For more information about SQL*Plus commands, refer to SQL*Plus User's Guide and Reference.


Interpreting Arguments in Windows NT

The rules for interpreting arguments within MS-DOS in Windows NT and Windows 95/98 are as follows:

Using the Graphical User Interface

The graphical user interface is a feature of SQL*Plus for Windows NT and Windows 95/98.

To start the graphical user interface:

If you are connecting to a remote Oracle database, make sure your SQL*Net/networking software is installed and working properly. For more information, see Net8 Administrator's Guide.
    Choose Start > Programs > Oracle - HOME_NAME > Application Development > SQL Plus 8.1.
    The Log On dialog box appears.


     
  1. Enter a valid user name and password. If you are connecting to a remote Oracle database, enter the SQL*Net connect string in the Host String field.
  2.  
  3. Click OK.

  4. The Oracle SQL*Plus application window is displayed.

     

Using the SQL*Plus Application Window

SQL*Plus displays the SQL command prompt in the application window.

To enter SQL and SQL*Plus commands, type each command at the SQL prompt and press Enter.

Using the Mouse Buttons to Copy SQL Commands in the Application Window

You can use the mouse buttons to copy previously entered SQL commands to the current SQL prompt.

To copy a command, highlight the intended command with the left mouse button. While still holding down the left mouse button, click the right mouse button. SQL*Plus copies the text to the SQL prompt.

Using the Command Keys

The following command keys have special functions in SQL*Plus:

Key Function

Home 

Top of screen buffer 

End 

Bottom of screen buffer 

Page Up 

Previous screen page 

Page Down 

Next screen page 

Ctrl+Page Up 

Show page on left of current screen page 

Ctrl+Page Down 

Show page on right of current screen page 

Alt+F3 

Find 

F3 

Find next 

Ctrl+C 

Copy text 

Ctrl+V 

Paste text 

Shift+Del 

Clear the screen and the screen buffer 

Using the SQL*Plus Menus

This section describes the menus in the GUI version of SQL*Plus.

File Menu

The File menu contains the following commands:

File Menu Command Description Command Line Equivalent
Open  The Open command retrieves a previously stored command file.

By default, SQL*Plus looks for a command file with the .SQL extension. 

GET filename
Save  The Save command contains three subcommands: Save Create, Save Replace, and Save Append SAVE 

 

  • Save Create saves the contents of the SQL*Plus buffer in a command file. By default, SQL*Plus assigns the .SQL extension to command files. You can specify a different extension in the File name text box.
SAVE filename CREATE 

 

  • Save Replace replaces the contents of an existing file with the contents of the SQL*Plus buffer. If the file does not exist, SQL*Plus creates the file.
SAVE filename REPLACE 

 

  • Save Append adds the contents of the SQL*Plus buffer to the end of the file you specify.
After you save a command file, you can do the following: 
  • Retrieve the file with the Open command from the File menu.
  • Edit the file with the Editor command from the Edit menu.
  • Start or run the file with the START or RUN commands from the SQL*Plus command prompt.
SAVE filename APPEND 
Save As  The Save As command saves the contents of the SQL*Plus buffer in a command file.

By default, SQL*Plus assigns the .SQL extension to command files. You can specify a different extension in the File name text box. 

SAVE filename
Spool  The Spool command contains two subcommands: Spool File and Spool Off

 

 

  • Spool File stores query results in a file. By default, SQL*Plus assigns the .LST extension to spool files. You can specify a different extension in the File name text box. You can edit the results with the Editor command from the Edit menu, and print the file from a Windows NT or Windows 95/98 text editor.
SPOOL filename
  • Spool Off turns off spooling. 
SPOOL OFF 
Run  The Run command lists and executes the SQL command or PL/SQL block currently stored in the SQL buffer.  RUN 
Cancel  The Cancel command cancels an in-progress operation.

Ctrl+C is the keyboard shortcut for the Cancel command. 

Ctrl-C 
Exit  The Exit command commits all pending database changes and closes the SQL*Plus application window.  EXIT 

Edit Menu

The Edit menu contains the following commands:

Edit Menu Command Description Command Line Equivalent
Copy  The Copy command copies the selected text to the Clipboard.

After you copy text to the Clipboard, you can paste the text into other Windows applications, such as Microsoft Excel and Microsoft Word.

Ctrl+C is the keyboard shortcut for the Copy command. 

not applicable 
Paste  The Paste command pastes the contents of the Clipboard onto the SQL*Plus command line.

Note: A maximum of 3625 characters can be pasted from the Clipboard onto the SQL*Plus command line during a single paste operation.

Ctrl+V is the keyboard shortcut for the Paste command. 

not applicable 
Clear  The Clear command clears the screen of the SQL*Plus application window and the screen buffer.

Shift+Del is the keyboard shortcut for the Clear command. 

CLEAR SCREEN 
Editor  The Editor command contains two subcommands: Invoke Editor and Define Editor

 

 

  • Invoke Editor loads the contents of the SQL*Plus buffer into an editor. By default, SQL*Plus saves the file to AFIEDT.BUF. You can specify a different file name in the editor.
EDIT 

 

  • Define Editor defines the editor that is invoked.
 
DEFINE_EDITOR
= editor name

Search Menu

The Search menu contains the following commands:

Search Menu Command Description Command Line Equivalent
Find  The Find command searches for a character, a word, or a group of characters or words in the SQL*Plus application window. When you choose the Find command, SQL*Plus begins the search at the top of the displayed screen.

Note: When SQL*Plus reaches the end of the displayed screen, it will not automatically continue searching from the top of the SQL*Plus screen buffer.

ALT+F3 is the keyboard shortcut for the Find command. 

not applicable 
Find Next  The Find Next command finds the next occurrence of the search text.

F3 is the keyboard shortcut for the Find Next command. 

not applicable 

Options Menu

The Options menu contains the following command:

Options Menu Command Description Command Line Equivalent
Environment  The Environment command allows you to set system variables to alter the SQL*Plus environment for your current session.

The Environment dialog box contains three areas: Set Options, Value, and Screen Buffer.

Note: See "Setting Options and Values, Using the Environment Dialog Box" for examples of how these controls interact. 

 

 

Set Options

This area contains a list of variables you can select to establish aspects of the SQL*Plus environment for your current session, such as the following: 

  • Setting the display width for NUMBER data.
  • Setting the display width for LONG data.
  • Enabling or disabling the printing of column headings.
  • Setting the number of lines per page.
See the "Command Reference" chapter in SQL*Plus User's Guide and Reference for descriptions of each system variable in the Set command. 
SET variable value

 

Value

The Value area consists of four option buttons: Default, Custom, On, and Off.

Note: When Custom is selected, the On and Off buttons and the text field may or may not be enabled for user selection. The availability of these fields depends on the item in the Set Option you selected. 

SET variable value

 

Screen Buffer

The Screen Buffer area consists of two text boxes: Buffer Width and Buffer Length.In the Buffer Width text box, you can set the number of characters that SQL*Plus displays on one line. If you enter a number smaller than the length of output data, SQL*Plus truncates the data to match the buffer width you specified. The default value of the Buffer Width parameter is 100 characters. You can specify from 80 to 1000 characters on one line.In the Buffer Length text box, you can set the number of lines that SQL*Plus displays on the screen. If SQL*Plus displays more lines of data than you specify, the remaining lines of data will "wrap around" to the top of the screen buffer. The default value of the Buffer Length parameter is 1000 lines. You can specify from 100 to 2000 lines on one screen.

Note: When you change the Screen Buffer option, SQL*Plus displays a dialog box to alert you that if you shorten the size of your screen buffer, some data may not be displayed on your screen. Click OK if you want to proceed. 

SET variable value

Help Menu

The Help menu contains the following command:

Help Menu Command Description Command Line Equivalent
About SQL*Plus  Displays the version number and copyright information.  not applicable, product information is available upon successful login 

Setting Options and Values, Using the Environment Dialog Box

Choose Options > Environment to access the Environment dialog box. The SQL* Plus Environment dialog box is used to create a SQL environment statement for the current session.

Choose an item from the Set Options list to begin. You can use the default settings, or you can customize the settings by using the other controls in the dialog box. The controls that are available vary, depending on the options you choose. You can make multiple changes to options and values. When the text box is available, you can enter the appropriate text or an appropriate numeric value. Click OK to commit your settings. Here are some examples:

Example 2-1

The arraysize is set to 20, the default value. Since the arraysize is a numeric variable, the On and Off buttons are not available.


 

To change the arraysize setting, click Custom and enter the number in the text box.

Example 2-2

The default for echo is off. To change the setting, click Custom and then click On. Since echo can only be on or off, the text box is not available.
 
 


Prev Next
Oracle
Copyright © 1999 Oracle Corporation.
All Rights Reserved.
Library Product Contents
Index