From the Execution Console you can select an entry point (for packages), enter the parameter input values, and choose various run options, such as profiling and directing the results to DBMS_OUTPUT.
The Execution Console helps you set various parameters for wrapping an anonymous block around a stored program so that you can execute it. If you generate an anonymous block, the Console assigns a file name to your block in the form: <Schema name>.<procedure name>.STB. If the anonymous block is for a packaged procedure, then the assigned name has an additional component—the entry point.
|
Note: If an error occurs when trying to run a generated code block (for example, due to a syntax error), the text is opened in the Output Window. |
Run Time Parameters
Parameter |
Name and type of each input parameter. |
Input |
Define input values for each parameter.
Def |
Select to use the default input value. |
Null |
Select to use a Null input value. |
Exp |
Select to use a PL/SQL Expression. |
Value/Expression |
When Exp is selected, enter a value or expression in the Value/Expression column. | |
Load/Save |
Click to load the input parameter values from an external file. |
Save |
Click to save the input parameter values to an external file. |
Reset |
Click to Reset changes to the parameter values. |
Run Options
Auto-create test case after code execution |
When selected a test case is automatically created (when you click Execute) based on the parameter values (both input and output) currently displayed in the grid.
For more information, see Code Test. |
Use Profiler |
Select to use the PL/SQL Profiler.
Analyze the execution time and efficiency of your stored programs.
Click (...) to open the Profiler Options dialog.
Collect Session Statistics when Creating the Profiling Run |
Select to store session statistics in a table. |
Before Creating the Profiling Run … |
Select when measuring performance and tuning.
Re-initialize the execution environment after a previous run, giving you a better basis for comparison between one run and another. |
For more information, see PL/SQL Profiler. |
Direct results to Output |
Select |
Generate a DBMS_OUTPUT PUT statement for each OUT parameter. |
Clear |
Generate a Bind variable for each OUT parameter. This is useful when you want to view complex data returned by the procedure, such as REF cursors and LOBs. |
For more information, see DBMS_OUTPUT. |
Include exception block |
Select to populate the Exception block when the Stub tab is generated.
|
TIP: Click Preview to generate the Stub tab. | |
Commit changes after code execution |
Once the procedure has finished executing, do you want to COMMIT / ROLLBACK changes made by the procedure? |
Preview |
Show the code to be executed.
|
Execute |
Execute the PL/SQL code.
If Use Profiler is selected, opens PL/SQL Profiler. |
Code Test
The Code Test panel automates the process of testing PL/SQL programs. See also the module: Code Test.
Test Case |
Select the test case to work on. |
In/Out |
Display the in/out parameters and associated values for the selected test case. |
New |
Create a test case. Open Test Case Properties |
Edit |
Edit the selected test case. Open Test Case Properties |
Delete |
Delete the selected test case. |
Test > Param |
Upload the selected test case into the parameters. |
Param > Test |
Update the selected test case with the current parameters. |
Manage |
Clone and edit existing test cases, create new test cases and run multiple test cases at once. Open Code Test |
Run Test |
Run the selected test case. The result of the test is displayed in the Test case status pane. |
Run All Tests |
Run all code tests available for the current object. |
Instead of using the Execution Console, you can generate and preview a PL/SQL block to execute a stored program.
To generate a stub
From the PL/SQL Execution Console
- Enter the run time parameters.
- Select Include exception block to populate the exception block when the stub is generated.
- Click Preview.
|
Note: Different stubs are generated depending on the selected options. |
The DBMS_OUTPUT package is a standard package provided by Oracle specifically for the purpose of debugging stored programs.
Insert a DBMS_OUTPUT.PUT_LINE statement in the code |
Edit Menu | Insert | DBMS_OUTPUT.PUT_LINE ('') |
Create a DBMS_OUTPUT.PUT_LINE statement for the selected variable in the editor. |
In the Code Editor
- Place the cursor on the variable.
- Click Edit |Insert | Debug Variable. The debug statement is generated and copied to the clipboard.
- Place the curser where you would like to insert the debug statement in your code. Click Edit | Paste.
|
Capture output from DBMS_OUTPUT |
The SQL Navigator Output Window captures output from DBMS_OUTPUT. |
|
Note: The SYS schema owns this package. To view the procedure and parameter definitions of this package you can display it in the Code editor. |
Right Click Over The Editing Pane
|
Cut |
CTRL+X |
Remove the selected text from the editing pane. Place on the Clipboard ready to Paste elsewhere. |
|
Copy |
CTRL+C |
Alternative shortcut: CTRL+Insert |
|
Paste |
CTRL+V |
Alternative shortcut: SHIFT+Insert |
Nil |
Select All |
CTRL+A |
Select all the text in the editing pane. This is usually followed by Cut or Copy. |
|
Auto Code Completion |
CTRL+ALT+A |
Turn on/off Auto Code Completion. (Auto Code Completion)
Use SHIFT+Spacebar to force code completion. |
|
Go to Definition |
CTRL+Enter |
Open the selected object in an appropriate editor: Visual Object Editors.
Errors are sent to the Output Window. |
|
Describe Object at Cursor |
CTRL+F3 |
Open Describe.
As per Object | Describe. |
Nil |
Toolbox | Next Page |
CTRL+ALT+N |
Scroll through the pages of the Code Editor toolbox.
Toolbox: PL/SQL Debugger | Code Explorer | Outline | DB Explorer | Describe | History | Dependencies | Columns |
Nil |
Toolbox | Previous Page |
CTRL+ALT+P |
|
File | New SQL Tab |
CTRL+T |
Open a new tab for a SQL script in the Code Editor. |
|
File | Open File |
CTRL+O |
Open a file from Windows Explorer. |
|
File | Save to File |
CTRL+S |
Save the file.
This option is enabled once the file has a name. For an Untitlted tab, save the file using File | Save to File As first. |
|
Object | New Stored Object |
CTRL+N |
Create a stored object. |
|
Object | Open/Create Package Body |
ALT+N |
Create a body for an existing package or (object) type |
|
Object | Execute |
F9 |
Opens PL/SQL Execution Console. |
|
Object | Generate Execution Stub |
SHIFT+F9 |
Generate PL/SQL Stub. |
|
Object | Save to Database |
CTRL+S |
Save the object to the database. |
|
Edit | Duplicate Line |
ALT+Y |
|
|
Edit | Format Text |
CTRL+R |
As per Tools Menu | Formatter Tools | Format Code |
|
Edit | Comment Selection |
ALT+F7 |
Enclose the selected text in comments. |
|
Edit | Uncomment Selection |
CTRL+ALT+F7 |
Remove comment markers from the selected text. |
|
Edit | Jump to Matching Bracket |
CTRL+] |
Jump to matching Bracket. |
|
Bookmarks | Toggle Bookmark |
Ctrl+Shift+0...Ctrl+Shift+9 |
Set a bookmark. The gutter margin in the Code Editor marks the bookmark. |
|
Bookmarks | Go To Bookmark |
Ctrl+0...Ctrl+9 |
Go to the set bookmark.
See also Edit | List Bookmarks ALT+B. |
|
Split/Compare | Vertical Split |
SHIFT+ALT+F11 |
Adjust the layout of the editing pane.
Select from the options to split the editing pane in half either horizontally or vertically. The content of the editing pane will be visible in both panes. You can scroll the panes independent of each other. |
|
Split/Compare | Horizontal Split |
SHIFT+F11 |
|
Split/Compare | No Split |
SHIFT+CTRL+F11 |
|
Execute | Skip to Top |
SHIFT+F7 |
Execute SQL statement in Code Editor.
As per Code Editor SQL |
|
Execute | Skip to Previous |
SHIFT+F8 |
|
Execute | Execute to End |
F9 |
|
Execute | Execute Step |
F8 |
|
Execute | Skip to Next |
F10 |
|
Execute | Skip to Bottom |
F11 |
PL/SQL Debugger Keyboard Shortcuts
For more information, see PL/SQL Debugger.
|
PL/SQL Debugger |
CTRL+ALT+S |
|
Toggle Breakpoint |
F5 |
|
Abort Debug Session |
SHIFT+CTRL+F9 |
|
Trace Into |
F7 |
|
Step Over |
F8 |
|
Add Watch |
CTRL+F5 |
|
Trace Out |
SHIFT+F8 |
|
Run to Cursor |
F4 |
|
Stop on Exception |
CTRL+ALT+X |
|
Auto Step Over |
SHIFT+CTRL+F8 |
|
Auto Trace Into |
SHIFT+CTRL+F7 |
|
Pause Auto Stepping |
ALT+P |
Further Shortcuts In The Code Editor Editing Pane
CTRL+Home |
Go to the top of the file |
CTRL+End |
Go to the bottom of the file |
Home |
Go to the beginning of the line |
End |
Go to the end of the line |
CTRL+Right Arrow |
Go to the next word |
CTRL+Left Arrow |
Go to the previous word |
CTRL+I |
Indent current line/selection |
CTRL+U |
Unindent current line/Selection |
F6 |
Go to the next tab |
SHIFT+F6 |
Go to the previous tab |
Further Shortcuts Viewing SQL Code Execution Results
ALT+n |
Following a SQL query with many result tabs, go to the result tab numbered n. |
CTRL+F11 |
Switch between the Query and Results page. |
ALT+Enter |
Edit Cell Data. |
Shortcuts In The Code Editor Toolbar
|
New SQL Tab |
CTRL+T |
Open a new tab for a SQL script in the Code Editor. |
|
New Stored Object |
CTRL+N |
Create a stored object. |
|
File | Open File |
CTRL+O |
Open a file from Windows Explorer. |
|
File | Save to File |
CTRL+S |
Save the file.
This option is enabled once the file has a name. For an Untitlted tab, save the file using File | Save to File As first. |
|
Auto Code Completion |
CTRL+ALT+A |
Turn on/off Auto Code Completion. (Auto Code Completion)
Use SHIFT+Spacebar to force code completion. |
|
Split/Compare | Vertical Split |
SHIFT+ALT+F11 |
Adjust the layout of the editing pane.
Select from the options to split the editing pane in half either horizontally or vertically. The content of the editing pane will be visible in both panes. You can scroll the panes independent of each other. |
|
Split/Compare | Horizontal Split |
SHIFT+F11 |
|
Split/Compare | No Split |
SHIFT+CTRL+F11 |
|
SQL History |
CTRL+ALT+R |
Recall SQL statement.
Open in the Toolbox: History |
|
PL/SQL Debugger |
CTRL+ALT+S |
Open in the Toolbox: PL/SQL Debugger |
|
Execute | Skip to Top |
SHIFT+F7 |
Execute SQL statement in Code Editor.
As per Code Editor SQL |
|
Execute | Skip to Previous |
SHIFT+F8 |
|
Execute | Execute to End |
F9 |
|
Execute | Execute Step |
F8 |
|
Execute | Skip to Next |
F10 |
|
Execute | Skip to Bottom |
F11 |
|
Object | Open/Create Package Body |
ALT+N |
Create a body for an existing package or (object) type |
|
Save to Database |
CTRL+S |
Save the object to the database. |
|
Execute Procedure / Function |
F9 |
Opens PL/SQL Execution Console. |
|
Toggle Breakpoint |
F5 |
Add / Remove breakpoint on the selected line of code. |
|
PL/SQL Debugger |
CTRL+ALT+S |
Open in the Toolbox: PL/SQL Debugger |
|
Abort Debug Session |
SHIFT+CTRL+F9 |
For more information see PL/SQL Debugger. |