Oracle Server Manager User's Guide

Contents Index Home Previous Next

The SQL Worksheet

Using the SQL Worksheet, you can enter, edit, and execute SQL and PL/SQL code. You can also execute the Server Manager commands described in Appendix A, "Server Manager Command Reference." You can also run scripts from the SQL Worksheet. The SQL Worksheet maintains a history of the commands you have issued, so you can easily retrieve and re-execute previous commands.

Starting a SQL Worksheet

You can start a SQL Worksheet from any Server Manager window by choosing New Worksheet from the File menu. The new worksheet is connected to the same database as the window from which you started the SQL Worksheet.

Using the SQL Worksheet

A SQL Worksheet window consists of the following elements:

The following figure illustrates a SQL Worksheet window.

Figure 9 - 1. SQL Worksheet Window

The SQL Worksheet window is described below:

Input Pane Upper window pane. Enter and edit commands in the input pane.
Output Pane Lower window pane. Displays recently executed commands and output. Server Manager stores the last 32 KB of output for display in the output pane. The actual amount stored may vary by operating system.
Split Bar Adjusts the relative sizes of the panes. Click the button and drag the split bar vertically to resize the panes.
Execute Executes the command in the input pane. See "Executing Commands in the SQL Worksheet" [*] for information about executing commands in a SQL Worksheet.
Command History Displays the Command History dialog box, which displays previously executed commands. See "Using the Command History" [*] for information about using the command history.
Run Script Allows you to select and execute a script. See "Running Scripts from the SQL Worksheet" [*] for information about running scripts from a SQL Worksheet.

The Worksheet Menu

The following figure illustrates the Worksheet pull-down menu.

Figure 9 - 2. Worksheet Pull-Down Menu

The Worksheet menu items are described below:

Command History Displays the Command History dialog box, which displays previously executed commands. Equivalent to the Command History button. See "Using the Command History" [*] for information about using the command history.
Execute Executes the command in the input pane. Equivalent to the Execute button or the Enter key. If there are multiple commands in the input pane, commands are executed up to the first terminator (; or /). See "Executing Commands from the SQL Worksheet" [*] for information about executing commands in a SQL Worksheet.
Run Script Allows you to select and execute a script. Equivalent to the Run Script button. See "Running Scripts from the SQL Worksheet" [*] for information about running scripts from a SQL Worksheet.
Spool Writes output to a specified file. See "Saving Your Work" [*] for information about spooling the output of a SQL Worksheet.
Stop Spooling Closes the previously opened spool file.
Clear Lines Off Top Clears the lines that have scrolled off the top of the output pane.
Write Log Writes the output pane, including lines that have scrolled off the pane, to a specified file. See "Saving Your Work" [*] for information about saving the output pane.
Write Selection Writes selected text to a specified file. Text can be selected from the input or output pane. See "Saving Your Work" [*] for information about saving selected text.
Previous Command Retrieves the previous command from the command history and enters it in the input pane. The retrieved command replaces the entire contents of the input pane.
You can execute Previous Command repeatedly to work back through the command history. Previous Command is unavailable if you have currently retrieved the oldest command from the command history.
Next Command Retrieves the next command from the command history and enters it in the input pane. The retrieved command replaces the entire contents of the input pane.
Next Command is unavailable if you have currently retrieved the most recent command from the command history.
Suggestion: Use the keyboard shortcuts to quickly access and execute commands from the command history.


Contents Index Home Previous Next