Code Editor. Dell 7.2
SQL Navigator 7.2 is a complete development environment for Oracle server-side development and management. It has been conceived, designed and developed by Oracle developers and DBAs with hands-on experience in the most common problems facing Oracle developers.
Advertisement
Advertisement
5
Code Editor
SQL Development
The Code Editor opens ready to edit SQL code.
More Information Brief Description
The Code Editor toolbar in SQL development.
Write SQL code. Compile the code.
Browse the results of executed SQL queries.
View a log of executed SQL statements. Retrieve executed SQL statements.
PL/SQL Development
The Code Editor layout for PL/SQL development is used when a stored object is opened or is being created.
More Information
Brief Description
The Code Editor toolbar in PL/SQL development.
Write PL/SQL code. Compile the code.
Set input parameters. Run the PL/SQL program.
Toolbox
Icon More
Information
Brief Description
Show a hierarchical view the code.
SQL Navigator 7.2
User Guide
51
Icon More
Information
Brief Description
Show the syntax tree of the current source.
Find and open database objects.
Show the data structure for tables, indexes, views and synonyms.
Show the most recent successfully executed SELECT, UPDATE, DELETE commands and
PL/SQL blocks in the current session.
Show the Dependants and Depends On objects of the current script.
Show/hide columns of the retrieved table in the data grid.
Tools and features for debugging stored programs.
Show/Hide the PL/SQL Debugger in the Toolbox from the Code Editor toolbar.
TIP:
l
Align the Toolbox left or right of the Code Editor (Right Click on the Toolbox).
l
Pin/Unpin the Toolbox to allow more editing space.
Code Editor SQL
The Code Editor opens ready to edit SQL code. The toolbar is appropriate to SQL development. Each of the
General Code Editor Functions
Icon Tool Tip
Back
Forward
New SQL
Description
Navigate between hyperlinked database objects (in the editing pane) and their dependent objects and components.
New
Stored
Object
Open File
Write a single SQL statement or a series of SQL statements in a new editing pane. The toolbar will open for SQL development.
Create a stored object. Open the
.
Open an external file in the Code Editor.
An alternative way to open file is to drag and drop a file from Windows Explorer to the
SQL Navigator window.
SQL Navigator 7.2
User Guide
52
Icon Tool Tip Description
Save to File Save the contents of the current Code Editor pane to an external file.
Open
Object
Auto Code
Completion
Vertical
Split
Locate a stored object using the
and open the object in the editing pane.
Turn On/Off
. When turned on, the Code Editor matches variables,
parameters, procedures and types as you type.
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.
TIP:
To open a different script in one of the panes:
1. Open the second script in a new editing pane of the Code Editor.
2. Return to the split panes. In the pane to load the second script right-click and select Split/Compare | Second Source.
3. Select the second source from the list of all scripts currently open in the
Code Editor.
SQL Specific Functions
Icon Tool Tip
Send to Session
Description
Switch to other sessions and continue working within the same window, with the same script. This feature allows you to run the same script against different databases without the need to copy it into another instance of the
Code Editor. It also allows you to correct the oversight of opening a file into the wrong session.
You can choose from a list of current sessions or start a brand new session.
NOTE:
l
When you run that window (execute the SQL or compile the
PL/SQL code, for example), SQL Navigator will prompt you to change to the new (current) session. It allows you to quickly correct the oversight of opening a file into the "wrong" session.
l
You can change session while editing SQL scripts only. This option is not available to stored programs.
SQL Navigator 7.2
User Guide
53
Icon Tool Tip
Add Condition
Remove All
Conditions
Updateable
Stop on Error
Description
Insert Where clause conditions in the SQL script using a graphical interface.
1. Type the SQL statement up to the where clause (Select * from emp_table
).
2. Click Add Condition to open the Add Filter window.
3. Select and fill in the field, operator and value(s) accordingly.
4. Click Ok to insert the where clause.
The Value(s) field is shown depending on which Operator has been selected.
Use when there is no semicolon (;) in the script.
On Edit the data returned by SQL queries. Update, delete and insert new records and save your changes back to the database. This feature is particularly useful for creating test data.
TIP:
l
Updateable requires simple SELECT statements with no joins, subqueries in select clause, calculated fields, group by, having, count(), substr or DISTINCT.
l
Updateable queries are slow to execute.
Off Data returned by SQL queries is read-only.
Use in conjunction with Execute to End to validate syntax.
Not
Selected
Execute all SQL statements. Highlight all erroneous statements.
Selected Stop execution of SQL statements on encountering the first error.
Highlight the offending code.
Limit the rows retrieved on execution of the SQL statement: Fetch All
Not Selected Retrieve enough rows to fill the visible area of the grid.
Fetch additional rows on scroll down requests.
Selected Retrieve all rows.
Spool Screen Select to capture a log of executed SQL statements in the
.
Scan
Defines/Substitutions
Turn On/Off
Turn on Scan Defines/Substitutions if your script uses variables or text that contain the characters &, &&, or = :[bind variable]. Otherwise, the statements containing the variables will generate an error.
Echo SQL On/Off
SQL Navigator 7.2
User Guide
54
Icon Tool Tip
SQL History
Expand SQL Pane
Description
Show/Hide the Toolbox
If the Toolbox is unpinned, showing History will not make History visible until the Toolbox is shown.
Maximize screen real estate of the SQL pane.
Skip to Top
Skip to Previous
Execute to End
Execute Step
Stop
Skip to Next
Skip to Bottom
Execution Control Buttons: l
The location of the cursor marks the execution start point.
l
Use Skip to Previous and Skip to Next to move the cursor through the
SQL statements.
l
Click Execute to End or press F9 to run the script to the end.
l
Click Execute Step or press F8 to execute the current statement.
l
To work with the result see
.
TIP:
l
You cannot run multiple queries within the same session simultaneously. If you need to run multiple queries simultaneously, you can open another connection to the same database.
l
To validate syntax use Execute to End in conjunction with Stop
on Error.
PL/SQL Debugger Show/Hide the Toolbox
If the Toolbox is unpinned, showing the PL/SQL debugger will not make the
PL/SQL debugger visible until the Toolbox is shown.
Abort Debug Session For more on debug see
Team Coding Version Control
To enable Team Coding see
.
Icon Tool
Tip
Description
Get
Latest
Revision
Get the latest version of an object or script as it is held in the Version Control repository.
The Get Latest Revision command overwrites the version of the object or script in the database, replacing it with the latest version held in the VCS repository. You can use the
to compare versions before overwriting the object.
Check
Out
Check out or check in the current object or script.
Open:
SQL Navigator 7.2
User Guide
55
Icon Tool
Tip
Check
In
Undo
Check
Out
Description
Cancel the check-out. You are prompted to confirm that you want to discard any changes you have made and restore the database version of the item as it was prior to check-out.
Confirm
Yes
You have made and saved changes to the object and you want to discard those changes.
Confirm
No
You have made and saved changes to the object and you want those changes to be retained in the database. As a result the version saved in the third party version control repository will be different from the version saved in the database.
Tools and Applications
Icon Tool Tip
SQL Optimizer
Explain Plan
PL/SQL Formatter
Description
Format PL/SQL, SQL*Forms, Oracle Forms, and SQL*Plus source code.
Menu
Icon
Menu
Name
Format
Text
Syntax
Check
Profile
Code
More Information
Format the entire source currently in the editor.
To format just a selection, select the text you want to format.
Output is displayed in the
.
Check the syntax. Output is displayed in the
.
If syntax errors are detected, the text stays unchanged. The errors are displayed in the Output
Window.
Create a summary of the code statistics. You can copy to clipboard or save to file.
Multi-File
Formatting
Open the Multi-File Formatting Selection dialog.
l
Select Folder and enter the folder that directly
SQL Navigator 7.2
User Guide
56
Icon Tool Tip
Knowledge Xpert
Code Analysis
Description
Menu
Icon
Menu
Name
More Information
Format
Options contains the files you want to format. Or l
Select Files and enter the files you want to format.
Select Backup files to folder to create a backup copy of the files you are about to format.
Define how the Formatter Tool formats code.
Code Editor PL/SQL
The toolbar appropriate to PL/SQL development opens when you create / open a stored object in the Code
General Code Editor Functions
Icon Tool Tip
Back
Description
Navigate between hyperlinked database objects (in the editing pane) and their dependent objects and components.
Forward
New SQL Write a single SQL statement or a series of SQL statements in a new editing pane. The toolbar will open for SQL development.
Create a stored object. Open the
.
New
Stored
Object
Open File Open an external file in the Code Editor.
An alternative way to open file is to drag and drop a file from Windows Explorer to the
SQL Navigator window.
Save to File Save the contents of the current Code Editor pane to an external file.
Open Locate a stored object using the
and open the object in the
SQL Navigator 7.2
User Guide
57
Icon Tool Tip Description
Object
Auto Code
Completion editing pane.
Turn On/Off
. When turned on, the Code Editor matches variables,
parameters, procedures and types as you type.
Vertical
Split
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.
TIP:
To open a different script in one of the panes:
1. Open the second script in a new editing pane of the Code Editor.
2. Return to the split panes. In the pane to load the second script right-click and select Split/Compare | Second Source.
3. Select the second source from the list of all scripts currently open in the
Code Editor.
PL/SQL Specific Functions
Icon Tool Tip Description
Open/Create
Package Body
Navigate to a function/procedure inside the package body.
Entry Move the cursor to the function / procedure definition in the code.
Undo all changes Undo all changes since the last save.
Generate DDL script
Generate a DDL script of the procedure / function / package. Switch between the
DDL script and procedure / function / package using the tabs at the bottom of the screen. While the DDL script is on view the Code Editor toolbar adjusts to editing
SQL code.
Save to Database Save changes. Submit the PL/SQL to the database, compile, and report errors
Save to Database
As (Clone)
Execute
Procedure /
Function
Save (clone) the object. The new stored program will have a definition identical to the stored program currently open in the editor. Optionally select a new schema and name for the object.
Open the
from editing mode.
If the PL/SQL Execution Console is already open then execute the code.
TIP:
Once you have opened the PL/SQL Execution Console, toggle between execution and editing mode via the tabs at the bottom of the screen.
Use if required to stop execution of the procedure before it finishes.
Stop procedure execution
Toggle Add / Remove breakpoint on the selected line of code. For more on debug see
SQL Navigator 7.2
User Guide
58
Icon Tool Tip Description
Breakpoint
PL/SQL Debugger You can watch the result values during runtime. You can run stored programs in parallel by opening additional sessions within SQL Navigator.
Show/Hide the Toolbox
Abort Debug
Session
For more on debug see
Team Coding Version Control
To enable Team Coding see
.
Icon Tool
Tip
Description
Get
Latest
Revision
Get the latest version of an object or script as it is held in the Version Control repository.
The Get Latest Revision command overwrites the version of the object or script in the database, replacing it with the latest version held in the VCS repository. You can use the
to compare versions before overwriting the object.
Check
Out
Check
In
Check out or check in the current object or script.
Open:
Undo
Check
Out
Cancel the check-out. You are prompted to confirm that you want to discard any changes you have made and restore the database version of the item as it was prior to check-out.
Confirm
Yes
You have made and saved changes to the object and you want to discard those changes.
Confirm
No
You have made and saved changes to the object and you want those changes to be retained in the database. As a result the version saved in the third party version control repository will be different from the version saved in the database.
Tools and Applications
Icon Tool Tip
SQL Optimizer
Description
SQL Navigator 7.2
User Guide
59
Icon Tool Tip
Explain Plan
PL/SQL Formatter
Knowledge Xpert
Code Analysis
Description
Format PL/SQL, SQL*Forms, Oracle Forms, and SQL*Plus source code.
Menu
Icon
Menu
Name
Format
Text
Syntax
Check
More Information
Format the entire source currently in the editor.
To format just a selection, select the text you want to format.
Output is displayed in the
.
Check the syntax. Output is displayed in the
.
If syntax errors are detected, the text stays unchanged. The errors are displayed in the Output
Window.
Create a summary of the code statistics. You can copy to clipboard or save to file.
Profile
Code
Multi-File
Formatting
Open the Multi-File Formatting Selection dialog.
l
Select Folder and enter the folder that directly contains the files you want to format. Or
Format
Options l
Select Files and enter the files you want to format.
Select Backup files to folder to create a backup copy of the files you are about to format.
Define how the Formatter Tool formats code.
Edit, Compile And Execute
The Code Editor opens ready to edit SQL code. You will see the SQL Toolbar (
) and a blank canvas to write SQL code. If you create / open objects requiring PL/SQL code you will see the PL/SQL Toolbar
).
Features
Standard
Description
All standard editing functions are available.
SQL Navigator 7.2
User Guide
60
Features
Editing
Functions
Description
See:
Control the contents of the Code Editor window
Manage objects in schemas
Handle text-and code
Search for code or objects
Access to various SQL Navigator windows and tools
Manage database sessions
Access add-ons, integrated applications and additional tools
Working with objects
Toolbars for
as appropriate.
Main Menu |
Main Menu |
Main Menu |
Main Menu |
Main Menu |
or
See also: l
l
Code Editor Keyboard Shortcuts
l
Some functions are duplicated on the shortcut menu. Right click in the editing pane to open the shortcut menu.
Drag and drop objects from the following SQL Navigator modules into the editing pane.
l
l
l
Show the definition of the object at the cursor location:
1. Right click on the object in the editing pane and select Go to Definition.
2. The result is shown in the
.
Describe the object at the current cursor location:
1. Press CTRL and click the object's name.
2. This opens
for the object.
TIP:
l
To construct SQL statements, drag and drop column names from the Describe tool into the editing pane.
l
If the described object is a text object (view, procedure, function, package or packaged procedure/function) and the
window is open, the object’s source is automatically previewed.
SQL Navigator 7.2
User Guide
61
Features
Automated
Coding
Assistance
Description
As you type an identifier the editor displays a selectable list of matching symbols (variables, parameters, procedures, types) in the current scope.
TIP:
Turn on/off code completion from the Code Editor Toolbar.
Dot-lookup Type a dot character after a name of variable. The editor automatically displays a selectable list of members of a PL/SQL record, cursor, package or %ROWTYPE record.
The Code Explorer displays a hierarchical list of all symbols in the package or procedure, and highlights the procedure the cursor is currently in. Doubleclick on a symbol to navigate within the program. It dynamically parses and checks syntax.
Hyperlinks To see the declaration of an identifier, press Ctrl+click. The text cursor automatically jumps to the declaration of the symbol if it's defined within the same program. If it's a name of an external database object, an Auto Describe opens.
Syntax tool tips
Point to a variable, parameter or procedure with the cursor to see a description of it.
Insert ready made code
Insert ready made code into the editor.
1. Place the cursor in the editor window where you want the code to be inserted
2. Press Ctrl+J. The template names display in a drop-down list.
3. Select the name of the template you want to insert from the drop-down list.
4. Press Enter.
To manage, create and edit the ready made code, see
Drag and drop PL/SQL syntax, SQL functions, column names, and database object names into code using the
Code with multiple
SQL statements and
PL/SQL blocks
Code
SQL
Description
If you write multiple SQL statements in the editing pane then ensure each SQL statement ends with either: l l a semicolon (;)
" / " on the next line.
TIP:
There is a quick way to construct SELECT statements for multiple tables. Highlight the tables in
DB Explorer , drag and drop them into the
editing pane. This behavior is set in View | Preferences |
| Drag & Drop.
PL/SQL PL/SQL blocks entered into the script must have either l a forward slash / l or a period mark .
SQL Navigator 7.2
User Guide
62
Features Description
Code Description
following the last line of the block.
This is necessary because the PL/SQL blocks can themselves contain blank lines and semicolons.
When you create or execute a PL/SQL anonymous block, the semicolons are required in the SQL statement. For example
BEGIN
Test_procedure;
END;
Execute the SQL query or
Compile the PL/SQL code
Execute the SQL query
See: The toolbar: Code Editor SQL
.
Compile the PL/SQL code
See:
.
You can compile a program that is stored in the database. While the program is being edited, use the Save command to compile and store it. Once the program has been modified, you will need to save the program prior to any further usage of the Compile/Rebuild functionality - This is to ensure that the changes in the program have been applied to the database.
SQL Navigator displays all syntax and compiler errors in a separate scrollable pane. Click on the error text to show the source code at the source of the error. Double click on the error text to show the error message description, cause and actions as per the Oracle documentation.
Also watch for feedback in the
.
Auto Reparse
Many features of the Code Editor, including the Code Explorer window, code completion, tool tip display of program arguments, bracket matching, collapse loops/blocks, and others, rely on automatic parsing of the PL/SQL code and internally generating a symbol table. This parsing occurs when the editor first loads the objects, and it also occurs in the background in order to maintain the symbol table as the user edits the code.
You can also manually trigger a full reparsing (updating of the internal symbol table) at any time by right-click and select Auto Reparse from the shortcut menu. However, when loading a really large script having this option on will slow down SQL Navigator. Hence, to avoid wasting
CPU resources, you should turn this option off when editing large scripts.
Symbols in the gutter margin
Symbols in the gutter margin provide a visual indication of the statement’s status.
SQL Navigator 7.2
User Guide
63
Features
Look and
Feel
Description
Icon Description
Enabled breakpoint. For more on debug see
Disabled breakpoint. For more on debug see
Current execution line
Invalid breakpoint. For more on debug see
This statement executed with errors.
Information about the error is displayed. Double click on this information to open the
Oracle Error Information dialog.
This SELECT statement produced results.
TIP:
l
Double click on the icon to jump to the associated results tab (Press
CTRL+F11).
l
There can be multiple results displays, one per statement executed.
Each result set is displayed in a separate tab.
l
See
l
When a result tab is selected, the corresponding statement will be focused.
This non-select statement executed successfully.
This statement was executed with warnings.
Feature
Collapse /
Expand
Statements
Description
You can collapse/expand a block, procedure, loop or IF statement by clicking on the - or + symbols to hide/show codes.
TIP:
When the script is exceptionally long the collapse/expand codes may slow down the application. You can choose to disable this feature in View | Preferences |
| Enable Code
Collapsing.
Syntax highlighting
Bookmarks
The Code Editor uses colors to highlight PL/SQL and SQL keywords, text and comments.
When you set the cursor at a bracket within an expression, the matching bracket is automatically highlighted.
Lines of code can be bookmarked so you can return to them easily.
l
To add / list / go to bookmarks see the
l
(0-9) in the gutter margin indicate Bookedmarked lines.
SQL Navigator 7.2
User Guide
64
Features Description
Feature Description
Variable declarations
To move the cursor to the declaration of a variable (or Auto Describe it if it’s the name of an external database)
Press CTRL and point to the variable with the mouse.
To return to the former position in the text, press ALT+Left Arrow.
Switch between specification and body
Press CTRL+SHIFT plus the down or up arrow to move the cursor between the specification and the body.
Formatter
Tools
Automatic
Indentation
SQL Navigator's Formatter Tools is a unique utility for reformatting existing
PL/SQL, SQL*Forms, Oracle Forms, and SQL*Plus source code. See the Code
Editor toolbar:
or
.
When you insert multi-line text into the editor, the text is placed at the same indentation level as the current cursor position. For best results, before inserting text, place the cursor at the location and indentation level where you want the inserted text to appear.
Manipulate rectangular blocks of code
Right click on the code and select Edit | Selection Mode | Block or press
ALT+F7.
The block selection is limited to the length of the last line. To overcome this limitation select View | Preferences |
| Allow Caret
after EOL.
Right click on the code and select Edit | Show Tabs/Eol/Eof Show/hide invisible characters
Switch between tabs and spaces
Right click on the code and select Edit | Tabs/Spaces and select from the available options.
Requires View | Preferences | selected.
| Use Tab Characters
SQL*Plus command support
The Code Editor supports the following SQL*Plus commands: l
Comment Delimiters (/*...*/) l
Double Hyphen (- -) l
At Sign (@) l
Double At Sign (@@) l
Forward Slash (/) l
CONNECT
SQL Navigator 7.2
User Guide
65
l
DESCRIBE l
DISCONNECT l
EXECUTE l
REMARK
NOTE:
Consult Oracle documentation for details about Oracle's SQL*Plus utility.
SQL Navigator also allows large scripts or SQL statements to be executed in the background, allowing you to perform other functions on your PC simultaneously.
Executing Scripts Invoked By At Sign (@) or Double At Sign
(@@) SQL*Plus Commands
Ensure that all the required scripts are in the same directory and in the correct SQL format.
In the Code Editor, invoke the master script using the @ command.
The output of the executed scripts will be displayed in the appropriate window of SQL Navigator, for example
CREATE statement will appear under the appropriate node in
.
Connect To A Database Via The Code Editor
To execute a SQL statement or script within the Code Editor, you must first be connected to the relevant database.
It is possible to connect and disconnect databases from within the Code Editor using SQL*Plus commands.
Connect Open a new Code Editor tab, and then type and execute a connect statement using the following SQL*Plus format
Connect name/password@database
Disconnect Open a new Code Editor tab, and then type and execute a disconnect statement using the following SQL*Plus format
Disconnect name/password@database
NOTE:
If you type and execute the disconnect statement without specifying any database details, the current session you are using will be disconnected.
Bind Variables
A bind variable is a variable in a SQL statement that must be replaced with a valid value or address of a value in order for the statement to successfully execute.
SQL Navigator 7.2
User Guide
66
Bind variables enable you to use PL/SQL in a SQL*Plus script. They provide a mechanism for returning data from a PL/SQL block so that it can be used in subsequent queries.
The Code Editor supports bind variables; use them the same way as you would use them in SQL*Plus.
Here is an example of how to declare a bind variable:
VARIABLE s_table_name varchar2(30)
To reference a bind variable in a PL/SQL block, preface it with a colon ( : )
BEGIN
:s_table_name := ‘EMPLOYEE’;
END;
/
Auto Code Completion
Scenario: Use Point-And-Click to insert column names for a database object into your code.
1. Ensure Auto Code Completion is turned on.
2. Place the cursor in the editor window where you want the column names to be inserted.
3. Type the name of the object followed by a period mark (.).
4. Select the name of the column you want to insert from the drop-down list.
5. Press Enter.
Scenario: Show a parameters list for a procedure or function.
1. Ensure Auto Code Completion is turned on.
2. Type in the name of the procedure or function followed by an open bracket '('.
3. Automatic code completion brings up a list of parameters (including alternative lists for overloaded procs/funcs).
Scenario: Dot lookup for record members.
1. Ensure Auto Code Completion is turned on.
2. Type in the name of the variable followed by a full stop.
3. SQL Navigator displays a list of matching members. Dot-lookup automatically displays a ‘pick’ list of members of a PL/SQL record, cursor, package or %ROWTYPE record.
Scan Defines/Substitutions
SQL Navigator 7.2
User Guide
67
The Code Editor lets you use substitution variables in SQL statements—similar to the way SQL*Plus handles them.
NOTE:
Turn on Scan Defines/Substitutions when using variables or text that contain the characters &,
&&, or = :[bind variable]. Otherwise, the statements containing the variables will generate an error.
Specifying substitution variables in SQL statements
Use substitution variables for flexible SQL statements. Flexible SQL statements are a powerful way to improve productivity.
Feature Example
CREATE
USER
&&UNAME
IDENTIFIED
BY &PASS;
GRANT ALL
ON EMP TO
&&UNAME;
&&UNAME
Description
Use the & symbol followed by a variable name to specify a substitution variable.
&EMPNUM
An example of a SQL statement demonstrating the use of a substitution variable
SELECT *
FROM EMP
WHERE
EMPNUM =
‘&EMPNUM’;
When you execute this SQL statement, the
Code Editor prompts you to enter the value for the employee name. This allows you to create generic SQL statements that can be reused.
You can use substitution variables in any part of the SQL statement.
SELECT
&COL1,
&COL2
FROM &TAB;
You can use &EMPNUM as a valid substitution variable name.
When you execute this SQL statement, the
Code Editor prompts you to enter the column names, as well as the table name.
You can use this concept to create other types of generic SQL statements or scripts.
One practical application of this concept is creating a generic script for creating user codes at your site.
You can use the double ampersand the same way as the single ampersand with some differences.
When you execute this SQL statement l
The first time the Code Editor encounters the && variable, it looks up the variable to determine whether it has already been defined in either a
DEFINE statement or in a previous && variable.
l
If the variable is defined, Code Editor substitutes the value in the SQL statement.
l
If the variable is undefined, the Code
SQL Navigator 7.2
User Guide
68
Feature Example Description
Editor prompts you to enter the value of the variable, defines the variable for future look-ups, and substitutes the value in the SQL statement.
l
Once a && variable is defined, you are no longer prompted to enter its value in the same session until you UNDEFINE the variable.
DEFINE and UNDEFINE
You can use the terms DEFINE and UNDEFINE to define and undefine numeric and character variables in
SQL scripts.
Statement Example
DEFINE DEFINE EMP_
NAME=‘SCOTT’
DEFINE EMP_NUM=4467
UNDEFINE UNDEFINE EMP_NAME
Description
Define a substitution variable.
A character/varchar substitution variable definition uses single quotes.
Undefine a previously defined substitution variable.
TIP:
Alternatively, right click in the editing pane and select SQL Script Options | Substitutions to open the Substitutions dialog.
New Stored Object Dialog
Select the object type:
Procedure A procedure is a sequence of executable statements that performs a particular action.
Procedures can be stored in the database (where they are also executed) and reused; they are then referred to as stored procedures. Stored procedures cannot be embedded in a SQL statement.
Function A function is a block that returns a value. Functions can be stored in the database and reused. Stored functions can be called from within a SQL statement.
Package+Body A package is an encapsulated collection of related schema objects, including modules and other constructs, such as cursors, variables, exceptions, and records. Packages allow procedures, functions, variables, and cursors that share common or related functions to be compiled and stored as a single schema object.
l
Packages allow encapsulation of internal subroutines and variables.
SQL Navigator 7.2
User Guide
69
Type+Body
Trigger l
With packages, you can specify which code is publicly available to programmers and which data should be hidden. In addition, you can implement global variables, data structures, and values; these persist for the duration of a user session.
l
Packages have both a specification and a body. The package specification declares procedures, functions, cursors, and variables.
l
The package body contains the implementation of the public procedures and functions, together with internal and private programs and variables.
Object types are user-defined data types, equivalent to "classes" in object-oriented languages, that may consist of composite data types or collections such as repeating groups or complex record types. Object types may be associated with member functions and procedures that are implemented in PL/SQL. These modules implement the methods of the object type.
Like packages, object types have both a specification and a body.
l
The specification lists the object's attributes and member functions.
l
The body contains the actual code for the methods.
A trigger is a named PL/SQL unit that is stored in the database and executed in response to a specified event that occurs in the database.
TIP:
For each object type, SQL Navigator provides a ready made template or "shell" to make coding easier. You can modify these templates. The template name and location is defined in the opening comments when the new object is created.
SQL Statement CRUD Matrix Dialog
Insert a CRUD (Create/Update/Delete) worksheet into the code editor.
The CRUD matrix is inserted as commented text at the current cursor position. This can be a convenient way of documenting and analyzing your procedures.
SQL Query Results
SQL Query Results Data Grid
Browse the results of an executed SQL query in a dynamic grid with options for viewing, sorting and navigating.
There can be multiple results displayed, one per statement executed. Each result set is displayed in a separate tab.
NOTE:
l
When a result tab is selected, the SQL query statement that generated the result is focused.
l
SQL Navigator 7.2
User Guide
70
l
The Data Grid supports National Language Support (NLS). Display and edit multi byte data.
l
To display the results of a SQL query as text see
SQL Query Log (The Spool Tab) .
Rows Retrieved
Icon Tool Tip
Count Dataset
Rows
Fetch More
Fetch All
Stop Fetching
Refresh Data
Description
The value appears in bold in the Status bar at the bottom of the Code Editor window.
Retrieve more rows.
Retrieve all rows.
Use when it takes too long to fetch more/all rows.
Populate the grid with the latest data.
Export / Print
Icon Tool Tip
Print Data Grid
Description
Print the SQL query results.
TIP:
l
Format the data grid as required for the printed page before you print.
l
To print preview, click the cursor in the data grid and click File | Print Preview.
l
Set printing preferences at View |
Open the
.
Export Data
TIP:
Right click on the data grid to select a row or column or the entire data grid. You can copy selected data to the clipboard. There is an option to include the row number or column heading with the copied data.
SQL Navigator 7.2
User Guide
71
Browse
Icon Tool Tip
Top
Prior Row
Next Row
Bottom
Description
Display the first, previous, next or last record.
Edit (Updateable Queries)
Turn ON Updateable in the SQL Editor Toolbar ( Code Editor SQL
) before you execute the SQL query. The status panel at the bottom of the Code Editor window says "Updateable" if the results can be edited. It says "Read
Only" if the results cannot be edited.
TIP:
l
Press F2, Space or Enter to edit straight from the cell.
l
A calendar opens for a date field (on pressing F2 or Space). Press Space to switch between the
Date field and Time field.
l
Double click on the cell if a wider editing space is required.
l
Right click on the data grid for more options.
Requirements
l
The SELECT statement must be a simple SELECT statement (no joins, subqueries in select clause, calculated fields, group by, having, count(), substr or DISTINCT). If you get an error message such as
TOKEN:.(12121,2) then your query does not conform to the restrictions for updateable queries.
l
You must have the appropriate privileges to update the table or view.
Icon Tool Tip
Add Row
Duplicate Selected Rows
Delete Selected Rows
Commit Transaction
Rollback Transaction
Description
Insert a new row before the selected row.
Duplicate the selected row(s).
The duplicated data is highlighted in the grid until it is committed.
Put the cursor on the row you want to delete and click .
Save new or modified data to the database.
Undo changes made to grid.
SQL Navigator 7.2
User Guide
72
Group Display
To create a group display, right click the data grid and select Group by this column.
Icon Tool Tip
Cancel Grouping
Description
Cancel the group display.
Format
Icon Tool Tip
Default/User Defined
Column Formatting
Format Columns By Data
Width
Description
User-defined column width. Overrides automatic column width setting.
Drag the separators to set column width.
Set the column widths to show the widest cell data.
Column names may appear truncated.
Format Columns By Name
Width
Set the column widths to show the widest column name.
Table data may appear truncated.
Format Columns By Names
And Data
Set the column widths to show the widest column data or column name
(whichever is greater).
TIP:
The formatted widths are based on the results currently visible. The column widths may change as you scroll down, retrieving new rows. To prevent the column widths from changing when scrolling,
Fetch All rows before scrolling.
Sort & Display
Icon Tool Tip
Grid View
Description
Display multiple rows in a data sheet format
TIP:
Click any column header to sort and change the sort options.
Single Row View Display details of the selected record.
Expand Data Grid Maximize screen real estate of the data grid.
Auto Refresh Select to refresh the SQL Results Data Grid every (number specified) seconds.
SQL Navigator 7.2
User Guide
73
SQL Query Log (The Spool Tab)
View a log of executed SQL statements. Retrieve executed SQL statements.
1. Enable Spool to Screen. For more information, see Code Editor SQL on page 52 .
2. Execute the SQL query. For more information, see Code Editor SQL on page 52 .
3. Click the Spool tab to view the log.
TIP:
Right click on the log to Select / Copy / Save / Print / Clear the log.
Export Data Dialog
Export the SQL query results
Options
Export to:
Columns
Rows
Description
l
Format l
HTML l
Excel® l
XML l
Spool Text l
Table INSERTs l
Delimited Text l
Unicode -Select to export the data in unicode format.
l
Open exported file - Select to open the file after it is exported.
l
Clipboard - Select to copy the data to the clipboard for subsequent pasting.
Select the columns to export.
Export all records or a specific range. The records can be sorted.
Viewers: LOB, XML, Array
View the contents of a large object (LOB, XML, Array) that is a cell in a table or result of a SQL query. Click on the cell containing the large object.
LOB Editor
You can work with the following Oracle8i LOB datatypes.
SQL Navigator 7.2
User Guide
74
Datatype
BLOB (binary)
CLOB (character)
BFILE (external)
NCLOB (multibyte character)
View
Y
Y
Y
Y
Edit
N
N
N
Y
You can use toolbar buttons to perform actions on LOBs. The actions available depend on the LOB and include: l
Copy to clipboard l
Save to disk file l
Save, then view in external application l
View in preview window l
Mask or show ASCII values between 128 and 255 l
View BFILE as image or HEX
NOTE:
SQL Navigator does not support working with LOB or Object table columns when using an Oracle 7 client connected to Oracle 8 database. For full functionality, use an Oracle 8 client to connect to an
Oracle 8 database.
ARRAY Editor
l
Click on +/- to add/remove items in the array.
l
Select any item and click the arrow buttons to reorder the list.
PL/SQL Execution Console
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
.
SQL Navigator 7.2
User Guide
75
Run Time Parameters
Option
Parameter
Input
Load/Save
Save
Reset
Description
Name and type of each input parameter.
Define input values for each parameter.
Field Description
Def
Null
Select to use the default input value.
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.
Click to load the input parameter values from an external file.
Click to save the input parameter values to an external file.
Click to Reset changes to the parameter values.
Run Options
Command Description
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 on page 148 .
Use Profiler Select to use the
.
Analyze the execution time and efficiency of your stored programs.
Click (...) to open the Profiler Options dialog.
Option
Collect Session
Statistics when
Creating the Profiling
Run
Before Creating the
Profiling Run …
Description
Select to store session statistics in a table.
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.
SQL Navigator 7.2
User Guide
76
Command
Direct results to
Output
Include exception block
Description
For more information, see PL/SQL Profiler on page 184 .
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 on page 78 .
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
Preview
Once the procedure has finished executing, do you want to COMMIT / ROLLBACK changes made by the procedure?
Show the code to be executed.
Execute
NOTE:
screen.
Execute the PL/SQL code.
If Use Profiler is selected, opens
Code Test
The Code Test panel automates the process of testing PL/SQL programs. See also the module:
.
Command Description
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
Edit
Create a test case. Open
Edit the selected test case. Open
Delete
Test >
Param
Param >
Test
Manage
Delete the selected test case.
Upload the selected test case into the parameters.
Update the selected test case with the current parameters.
Run Test
Clone and edit existing test cases, create new test cases and run multiple test cases at once.
Open
Run the selected test case. The result of the test is displayed in the Test case status pane.
SQL Navigator 7.2
User Guide
77
Command Description
Run All
Tests
Run all code tests available for the current object.
PL/SQL Stub
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
1. Enter the run time parameters.
2. Select Include exception block to populate the exception block when the stub is generated.
3. Click Preview.
NOTE:
Different stubs are generated depending on the selected options.
DBMS_OUTPUT
The DBMS_OUTPUT package is a standard package provided by Oracle specifically for the purpose of debugging stored programs.
Feature Description
Insert a DBMS_OUTPUT.PUT_LINE statement in the code
| Insert | DBMS_OUTPUT.PUT_LINE ('')
Create a DBMS_OUTPUT.PUT_LINE statement for the selected variable in the editor.
In the
1. Place the cursor on the variable.
2. Click Edit |Insert | Debug Variable. The debug statement is generated and copied to the clipboard.
3. 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
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.
SQL Navigator 7.2
User Guide
78
Code Editor Keyboard Shortcuts
Right Click Over The Editing Pane
Icon Right Click
Cut
Copy
Paste
Nil Select All
Auto Code
Completion
Go to
Definition
Keyboard Shortcut
CTRL+X
CTRL+C
CTRL+V
CTRL+A
CTRL+ALT+A
CTRL+Enter
Describe
Object at
Cursor
CTRL+F3
Nil Toolbox |
Next Page
CTRL+ALT+N
Nil Toolbox |
Previous Page
CTRL+ALT+P
File | New SQL
Tab
CTRL+T
CTRL+O File | Open
File
File | Save to
File
CTRL+S
Description
Remove the selected text from the editing pane. Place on the Clipboard ready to Paste elsewhere.
Alternative shortcut: CTRL+Insert
Alternative shortcut: SHIFT+Insert
Select all the text in the editing pane. This is usually followed by Cut or Copy.
Turn on/off Auto Code Completion. ( Auto Code
)
Use SHIFT+Spacebar to force code completion.
Open the selected object in an appropriate editor: Visual
Errors are sent to the
Open
.
As per Object | Describe.
Scroll through the pages of the Code Editor toolbox.
Toolbox:
|
|
|
|
|
|
Open a new tab for a SQL script in the Code Editor.
Open a file from Windows Explorer.
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.
Create a stored object.
Object | New
Stored Object
Object |
Open/Create
Package Body
Object |
CTRL+N
ALT+N
F9
Create a body for an existing package or (object) type
Opens
.
SQL Navigator 7.2
User Guide
79
Icon Right Click Keyboard Shortcut Description
Execute
Object |
Generate
Execution
Stub
Object | Save to Database
Edit |
Duplicate Line
Edit | Format
Text
Edit |
Comment
Selection
Edit |
Uncomment
Selection
Edit | Jump to
Matching
Bracket
Bookmarks |
Toggle
Bookmark
Bookmarks |
Go To
Bookmark
SHIFT+F9
CTRL+S
ALT+Y
CTRL+R
ALT+F7
CTRL+ALT+F7
CTRL+]
Ctrl+Shift+0...Ctrl+Shift+9 Set a bookmark. The gutter margin in the Code Editor marks the bookmark.
Ctrl+0...Ctrl+9
Generate
Save the object to the database.
As per
| Formatter Tools | Format Code
Enclose the selected text in comments.
Remove comment markers from the selected text.
Jump to matching Bracket.
Go to the set bookmark.
See also Edit | List Bookmarks ALT+B.
Split/Compare
| Vertical
Split
SHIFT+ALT+F11
Split/Compare
| Horizontal
Split
SHIFT+F11
Split/Compare
| No Split
SHIFT+CTRL+F11
Execute | Skip to Top
SHIFT+F7
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.
Execute SQL statement in Code Editor.
As per
Execute | Skip to Previous
Execute
| Execute to
End
Execute
| Execute
SHIFT+F8
F9
F8
SQL Navigator 7.2
User Guide
80
Icon Right Click Keyboard Shortcut
Step
Execute | Skip to Next
Execute | Skip to Bottom
F10
F11
Description
PL/SQL Debugger Keyboard Shortcuts
For more information, see PL/SQL Debugger on page 83 .
Icon Right Click
PL/SQL Debugger
Toggle Breakpoint
Abort Debug Session
Trace Into
Step Over
Add Watch
Trace Out
Run to Cursor
Stop on Exception
Auto Step Over
Auto Trace Into
Pause Auto Stepping
Keyboard Shortcut
CTRL+ALT+S
F5
SHIFT+CTRL+F9
F7
F8
CTRL+F5
SHIFT+F8
F4
CTRL+ALT+X
SHIFT+CTRL+F8
SHIFT+CTRL+F7
ALT+P
Further Shortcuts In The Code Editor Editing Pane
Keyboard Shortcut
CTRL+Home
CTRL+End
Home
End
CTRL+Right Arrow
CTRL+Left Arrow
Description
Go to the top of the file
Go to the bottom of the file
Go to the beginning of the line
Go to the end of the line
Go to the next word
Go to the previous word
SQL Navigator 7.2
User Guide
81
Keyboard Shortcut
CTRL+I
CTRL+U
F6
SHIFT+F6
Description
Indent current line/selection
Unindent current line/Selection
Go to the next tab
Go to the previous tab
Further Shortcuts Viewing SQL Code Execution Results
Keyboard Shortcut
ALT+n
CTRL+F11
ALT+Enter
Description
Following a SQL query with many result tabs, go to the result tab numbered n.
Switch between the Query and Results page.
Edit Cell Data.
Shortcuts In The Code Editor Toolbar
Icon Tool Tip Keyboard
Shortcut
New SQL Tab CTRL+T
New Stored
Object
File | Open
File
File | Save to
File
CTRL+N
CTRL+O
CTRL+S
Description
Open a new tab for a SQL script in the Code Editor.
Create a stored object.
Open a file from Windows Explorer.
Auto Code
Completion
CTRL+ALT+A
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.
Turn on/off Auto Code Completion. ( Auto Code Completion
)
Use SHIFT+Spacebar to force code completion.
Split/Compare
| Vertical
Split
Split/Compare
| Horizontal
Split
SHIFT+ALT+F11 Adjust the layout of the editing pane.
SHIFT+F11
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
| No Split
SQL History
SHIFT+CTRL+F11
CTRL+ALT+R Recall SQL statement.
Open in the Toolbox:
SQL Navigator 7.2
User Guide
82
Icon Tool Tip Keyboard
Shortcut
Description
PL/SQL
Debugger
Execute | Skip to Top
CTRL+ALT+S
SHIFT+F7
Open in the Toolbox:
Execute SQL statement in Code Editor.
As per
Execute | Skip to Previous
Execute
| Execute to
End
Execute
| Execute
Step
Execute | Skip to Next
Execute | Skip to Bottom
Object |
Open/Create
Package Body
Save to
Database
Execute
Procedure /
Function
Toggle
Breakpoint
PL/SQL
Debugger
Abort Debug
Session
SHIFT+F8
F9
F8
F10
F11
ALT+N
CTRL+S
F9
F5
CTRL+ALT+S
Create a body for an existing package or (object) type
Save the object to the database.
Opens
Add / Remove breakpoint on the selected line of code.
Open in the Toolbox:
SHIFT+CTRL+F9 For more information see
Toolbox
PL/SQL Debugger
NOTE:
Show/Hide PL/SQL Debugger in the Toolbox from the Code Editor toolbar.
All the tools and features for debugging stored programs can be found inside the PL/SQL Debugger window.
SQL Navigator 7.2
User Guide
83
Use the debugger to perform the following functions: l
Run to the end or to the next breakpoint.
l
Step over code.
l
Step into code, when other procedures are called from the current line.
l
Display the execution stack.
l
View and modify any variable value.
l
Set watch variables.
l
Set and remove breakpoint on the fly as the code is executing, except in an anonymous block.
l
Stop a running procedure.
l
Set an option to either stop execution if an exception occurs, or ignore exceptions.
Requirements
Area
Oracle server connection
Requirement
Debugging is functional only when you are connected to an Oracle server via a SQL*Net connection. If you are using a local database, such as Personal Oracle, use the loopback
SQL*Net connection to perform interactive debugging.
Oracle
Permissions create session alter session
Debug on/off
Successful compile
To watch, evaluate, or modify variables of a stored program:
Compile the program with debug information:
| Include Debug Info.
If the procedure fails to compile, it is displayed in red in
DB Navigator . It cannot be debugged.
Debug
r e t u
F Description e a l a
L
Use the Locals tab to test the effect of different variable values in your procedure.
o c
Example Scenario: Your procedure performs a computation. Start the procedure, enter a starting value and watch how the procedure handles the result. If you want to see a "what if" computation, enter a new value for the variable in the Locals tab and repeat the procedure.
SQL Navigator 7.2
User Guide
84
l e a b s i r v a t a b
r e t u
F Description e a s
NOTE:
l
If you see an error such as "Not compiled with debug info" instead of the variable value, you need to recompile the procedure with the Debug information and re-execute it in the debugger to see the value of variables. See
| Include Debug Info for more information.
l
The values in the Locals tab are only populated when the code is running.
l
The values of the input parameters cannot be modified in the Locals tab.
l
When you evaluate a variable in a current breakpoint, remember that the current breakpoint has not yet been executed.
R When evaluating/watching a variable of REF CURSOR type, its value is displayed in the following format:
E
F flags:FFF, rowcount:RRR.
RRR determines the number of records fetched so far by the examined cursor.
C
U
FFF is a combination of cursor status flags:
R
%ISOPEN
S
%FOUND
O
R
%NOTFOUND p e t y
If the user enters the watched variable names as C1%NOTFOUND, C1%FOUND, C1%ISOPEN, C1%ROWCOUNT, the displayed value is the same as would result from watching the cursor itself. (C1 is the name of the cursor) a t
Add/remove breakpoints by clicking in the gutter margin left of the code.
s
For more information, see Code Editor PL/SQL
c
When execution of a procedure is paused at a breakpoint, you can evaluate or modify any scalar variable within procedure code. If you change the value of a variable, you can confirm the new value of the scalar variable by evaluating the variable again.
h e
NOTE:
l
You can open multiple editors and set breakpoints in several stored programs simultaneously.
SQL Navigator 7.2
User Guide
85
i o k p e a
B r n t s a n d
r e t u
F Description e a
l
When you evaluate a variable in a current breakpoint, remember that the current breakpoint has not yet been executed.
l
Variable values in the "watch" window are updated only at the breakpoint, so strategically place breakpoints after the watch variable.
l
Increasing the number of variables in the watch list may result in slower debugger performance.
Code Explorer
Make your work with packages, procedures, and functions more efficient and error-free.
Features
Code Explorer: l
Is based on an advanced parsing technique that understands PL/SQL syntax.
l
Displays detailed information about a package’s components, such as variables and parameters, their types, structure and cursors.
l
Highlights the packaged procedure you are currently in.
l
Supports drag-and-drop into the editor.
l
Combines information from the specification and body.
l
Distinguishes non-published procedures and functions (by icon).
Working with packages
Work with packages is fast and easy in the Code Editor with the integrated Code Explorer.
The Code Explorer graphically displays a tree-structure view of the package currently in the editor. It shows variables, parameters, record structures, types, cursors, and so on.
SQL Navigator 7.2
User Guide
86
The tree-view is synchronized with the editing cursor in the code-editing window, so when you click any package component in the tree-view, you can see the corresponding PL/SQL code in the editing window.
Likewise, as you move the cursor in the editing window, the tree-view changes to show the object corresponding to the PL/SQL code at the cursor location.
Auto Reparse
PL/SQL parsing occurs when the editor first loads objects, and in the background as the user edits the code.
You can also manually trigger a full reparsing (updating of the internal symbol table) at any time by right-click and select Auto Reparse from the shortcut menu. However, when loading a really large script having this option on will slow down SQL Navigator. Hence, to avoid wasting CPU resources, you should turn this option off when editing large scripts.
Outline
A graphic representation of the syntax tree of the current source.
DB Explorer
Find and open objects.
Icon Tool Tip Description
Refresh Refresh the tree data.
Use if you have created new objects that are not visible in the tree yet.
Type in a filter phrase (for example c% to filter all objects with names starting with c).
Name
Filter
Upper case filter
Click to toggle between Upper case filter and Mixed case filter.
The upper case filter is selected by default. Use the mixed case filter to find objects with names that are mixed case, lower case or have special characters.
Filter Open the Filter Properties dialog.
DB Explorer is similar appearance to DB Navigator. DB Explorer is a light version of DB Navigator, integrated into the Code Editor for extra convenience.
TIP:
l
Expand the tree nodes to display the filtered objects.
l
Drag and drop objects from DB Explorer into the Code Editor.
l
Set the behavior of dragging and dropping table names from View | Preferences |
| Drag & Drop.
SQL Navigator 7.2
User Guide
87
Describe
Show the data structure for tables, indexes, views and synonyms.
NOTE:
To increase response time, the drop down list is not populated with objects when the tool is first activated.
Icon Tool
Tip
Description
Filter To show the complete list, leave the Filter blank and press Enter.
You can use wildcards to filter the objects. For example, type t% and press Enter to display only objects with names starting with "t". Select an object from the list to show its column names and types.
Quick
Browse
View the chained rows information as per
| Quick Browse.
Select the object to Describe.
The results show in
Edit
Data
Edit data in a table object as per
| Edit Data.
Select the object to Describe.
The results show in
The Edit Data command executes an Updateable query.
History
The History tool lists successfully executed SELECT, UPDATE, DELETE commands and PL/SQL blocks up to 1000 of the most recent ones in the current session. In the History window, each SQL statement is accompanied with the date, time and the schema that they were executed on.
You can easily recall the most recent SQL statements that have been executed in the current session.
1. Select the statement you want to recall.
TIP:
You can press Ctrl+up arrow to move back in the sequence, and Ctrl + down arrow to move forward.
2. Take action.
Button
New Tab
Insert
Description
Open a new Code Editor tab and paste the statement into it.
Add the recalled statement to the current contents.
SQL Navigator 7.2
User Guide
88
Button Description
Replace Replace the current contents of the editing window with the selected SQL statement.
Clipboard Copy the statement to the clipboard, ready to paste the statement into another location.
Delete Drop the statement from the SQL History list.
Double
Click...
Select an action (New Tab, Insert, Replace or Clipboard) that will be executed on double-clicking an entry in History.
TIP:
You can also insert the statements by dragging and dropping them into the Code Editor.
Dependencies
Lists the Dependants and Depends On objects of the current script.
NOTE:
Objects with a large amount of dependant and depends on objects will take more time to load.
To improve the performance, hide this pane when opening those objects.
TIP:
Right click over the Dependents or Depends On lists to view available commands to manipulate objects in the lists.
Columns
The Columns window provides an easy-to-use tool to arrange and hide/show columns of the retrieved table in the data grid.
TIP:
Run a valid query statement to populate the window.
Action
Show/Hide columns
Select column
Arrange columns
Description
Show selected columns. Hide deselected columns.
Click on the column's name.
Click Move Up or Move Down.
NOTE:
The settings will be saved and taken into account when you refresh or rollback the query.
However if you rerun the query, the settings will be set back to default.
SQL Navigator 7.2
User Guide
89
Download
Advertisement
Key features
Integrated environment for developing and testing Oracle stored programs and procedures
Easy-to-use graphical user interface
Team coding controls, including integration with third-party version control systems
Useful tools for tuning and database management
Frequently asked questions
SQL Navigator is intended for use by qualified Oracle developers and DBAs.
SQL Navigator provides an integrated environment for developing and testing Oracle stored programs and procedures, schemas, objects, SQL scripts, and more—all from an easy-to-use graphical user interface.
SQL Navigator provides a complete development environment for Oracle server-side development and management, including tools for team coding, version control, analysis, and tuning.