SQL*Plus(TM) Getting Started for Windows NT and Windows 95
Release 8.0

A53633-01

Library

Product

Contents

Index

Prev Next

2
Using SQL*Plus

This chapter describes how to start and use SQL*Plus from the command line interface, graphical user interface and menu options. These topics are covered:

Using Command Line SQL*Plus

If you are using a remote Oracle database connection, initialize and load the drivers and executables to establish a network connection before starting SQL*Plus. Use the following steps to start SQL*Plus command line:

  1. Open an MS-DOS Prompt session.
  2. At the command line prompt, enter:
    SQLPLUS username/password[@connectstring] or
    PLUS80 username/password[@connectstring]
    Note:

    You can also run "PLUS80.EXE <argument list>" to invoke the command line SQL*Plus.  

For Windows NT and Windows 95 NT and Windows 95, the rules for interpreting arguments are:

Command Line Interface Special Keys

Several keys on your keyboard have special meaning in SQL*Plus:

SQL*Plus Key Names   Keyboard Key Names   Function  

[Return]  

Enter  

End a line of input.  

[Backspace]  

Backspace  

Move a cursor left one character to correct an error.  

[Pause]  

Pause  

Suspend program operation and display output.  

[Resume]  

Any key  

Resume program operation and output.  

[Cancel]  

CTRL+Break  

Halt program operation; return to the SQL*Plus command prompt.  

[Interrupt]  

None  

Exit SQL*Plus and return to the host operating system.  

Using Graphical Interface SQL*Plus

If you are using a remote Oracle database connection, initialize and load the drivers and executables to establish a network connection before starting SQL*Plus. Use the following steps to start SQL*Plus graphical interface:

  1. Open the Oracle program group, or choose the Oracle program group from the Windows NT and Windows 95 taskbar.
  2. Double-click (or select in Windows 95) the SQL*Plus icon from the program group and the SQL*Plus Logon dialog box appears.
  3. Enter your userid and password. If connecting to a remote Oracle database, enter the Net8 connect string.
    Note:

    You can also run PLUS80W.EXE <argument list> to invoke the graphical interface SQL*Plus.  

For Windows NT and Windows 95, the rules for interpreting arguments are:

Using the SQL*Plus Windows

After you install and start, SQL*Plus displays the SQL prompt in the SQL*Plus window. The SQL*Plus window contains basic Microsoft Windows elements, such as dialog boxes, pull-down menus, scroll bars, and minimize and maximize buttons.

To enter SQL*Plus and SQL commands, type them in the SQL*Plus interface window, then press Enter. Input commands one line at a time.

For more information about the operation of these elements, refer to your Microsoft Windows NT and Windows 95 documentation.

Commands Using Both Mouse Buttons to Copy SQL

In addition to the functionality provided by the Microsoft Windows NT and Windows 95 elements, SQL*Plus allows you to use the mouse buttons to copy previously entered SQL commands to the current SQL prompt. To quickly copy a command, highlight it and hold down the left mouse button. While holding down the left button, click the right button. SQL*Plus copies the text.

Using the Command Keys

SQL*Plus assigns the traditional functions to most of the command keys. However, the following command keys have special functions in SQL*Plus for Windows NT and Windows 95

Key   Function  

HOME  

Top of screen buffer  

END  

Bottom of screen buffer  

CTRL+HOME  

Right side of screen buffer  

CTRL+END  

Left side 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  

F3  

Find  

ALT+F3  

Find next  

CTRL+C  

Copy text  

CTRL+V  

Paste text  

SHIFT+DEL  

Clear the screen buffer  

:

SQL*Plus Menus

File Menu

The File menu consists of the following:

Menu Item   Function  

Open  

The Open option retrieves a previously stored command file. By default, SQL*Plus for Windows NT and Windows 95 assigns the .SQL extension to command files. You can specify a different extension in the File Name text box.  

Save  

The Save menu item includes three options for saving: Save Create, Save Replace, and Save Append.

Save Create saves the contents of the SQL*Plus buffer in a command file. By default, SQL*Plus for Windows NT and Windows 95 assigns the .SQL extension to command files. You can specify a different extension in the File Name text box.

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

Save Append adds the contents of the SQL*Plus buffer to the file that you specify.  

After you save a command file, you can do the following:

Edit Menu

The Edit menu consists of the following:

Menu Item   Function  

Copy  

The Copy option copies selected text to the Windows NT and Windows 95 clipboard.
After you copy text to the clipboard, you can paste the copied text into other Windows NT and Windows 95 applications, such as Microsoft Excel and Microsoft Word.

CTRL+C is the keyboard shortcut for the Copy menu item.  

Paste  

The Paste option pastes the contents of the Windows NT and Windows 95 clipboard onto the SQL*Plus command line.
CTRL+V is the keyboard shortcut for the Paste menu item.
Note: A maximum of 3625 characters can be pasted from the Windows NT and Windows 95 clipboard onto the SQL*Plus command line during a single paste operation.  

Clear  

The Clear option clears the Windows NT and Windows 95 screen buffer and the screen. The CLEAR SCREEN clause is the command line equivalent of the Clear menu item.
SHIFT+DEL is the keyboard shortcut for the Clear menu item.  

Editor  

The Editor menu item consists of two options: Invoke Editor and Define Editor.

Invoke Editor loads the contents of the buffer into a Notepad window. By default, Notepad saves the file to AFIEDT.BUF. You can specify a different filename by using the Save As option in the Notepad file menu. You can also specify another editor by using the Define Editor option (EDIT is the command line equivalent of Invoke Editor option.).

Define Editor defines the editor that is invoked when you select the Invoke Editor option.

Note: See Edit in SQL*Plus User's Guide and Reference for more information.  

Search Menu

The Search menu includes two options: Find and Find Next.

Menu Item   Function  

Find  

The Find option looks for a character, word, or a group of characters or words in the SQL*Plus application window. When you choose the Find option from the Search menu (you can also press ALT+F3 for Find), SQL*Plus starts the search from the top of the displayed screen. Note that when SQL*Plus reaches the end of the SQL*Plus session display, SQL*Plus will not automatically continue searching from the top of the SQL*Plus session display.  

Find Next  

The Find Next option (you can also press F3 for Find Next) finds the next occurrence of the search text.  

To find text:

  1. Display the screen where you want to start the search, using the Home, End, Page Up, and Page Down keys.
  2. Select Find and enter the text you want to find.
  3. Select the Case Sensitive check box if you want to match capitalization exactly.

Option Menu
Menu Item   Function  

Environment  

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

Set Options area provides a list of variables you can choose 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

SQL*Plus allows you to make multiple changes to Options before clicking the OK button to commit the changes.

To establish an aspect of the SQL*Plus environment:

  1. In the Environment dialog box, select a variable from the list box.
  2. Depending on the variable you selected, SQL*Plus activates the Switch region and the Value region. The switch region toggles a variable on or off. The value region sets the variable to the default value or the value you specify. Click the switch buttons and enter the values for each variable you select, then click OK.

Note: SET command and variables are the command line equivalents of the options available from the Environment menu items.  


 

Screen Buffer

When you change the Screen Buffer option, SQL*Plus displays a warning 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.

The Screen Buffer dialog box consists of two text boxes: Buffer Width and Buffer Length.

Buffer Width

Sets the number of characters 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 80 characters. You can specify from 80 to 1,000 characters on one line.

Buffer Length

Sets the number of lines 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 parameter is 100 lines. You can specify from 100 to 2,000 lines on one screen.  

Help Menu

All SQL*Plus is included in the Oracle Documentation. To view the SQL*Plus documents, you must install the Oracle Documentation.

Menu Item   Function  

About SQL*Plus  

The About SQL*Plus option contains the version and the copyright information for SQL*Plus.  




Prev

Next
Oracle
Copyright © 1997 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index