PL/SQL Developer 7.0 New Features: December 2005
PL/SQL Developer 7.0 New Features: December 2005
0
New Features
December 2005
L/SQL Developer 7.0 New Features 3
Contents
CONTENTS .............................................................................................................................................................. 3
1. INTRODUCTION...................................................................................................................................... 5
2. DIAGRAM WINDOW.............................................................................................................................. 6
2.1 CREATING A DIAGRAM .......................................................................................................................6
2.2 SAVING AND OPENING A DIAGRAM FILE ..........................................................................................8
2.3 UPDATING A DIAGRAM.......................................................................................................................8
3. GRAPH WINDOW.................................................................................................................................... 9
4. ODBC IMPORTER.................................................................................................................................11
5. COMPARE TABLE DATA...................................................................................................................13
6. TEST MANAGER....................................................................................................................................15
6.1 CREATING A TEST SET .....................................................................................................................16
6.2 RUNNING A TEST SET .......................................................................................................................17
7. DOCKABLE & FLOATING TOOLS................................................................................................18
8. SEARCH BAR..........................................................................................................................................19
9. PROGRAM WINDOW ENHANCEMENTS ...................................................................................20
9.1 NAMING CONVENTIONS....................................................................................................................20
9.2 HIGHLIGHT VARIABLES....................................................................................................................21
9.3 SAVE WINDOW STATE PREFERENCE ...............................................................................................21
9.4 SUBSTITUTION VARIABLES ..............................................................................................................21
9.5 REFACTORING....................................................................................................................................21
9.6 CODE CONTENTS LAYOUT ...............................................................................................................22
10. SQL WINDOW ENHANCEMENTS..................................................................................................23
10.1 M ULTIPLE STATEMENTS...................................................................................................................23
10.2 GRAPH WINDOW ...............................................................................................................................23
10.3 A LTERNATE GRID ROW COLORS......................................................................................................24
10.4 GRID COLUMN TOTALS.....................................................................................................................24
10.5 GRID SELECTION INDICATOR...........................................................................................................25
10.6 EXCEL EXPORT ..................................................................................................................................25
11. COMMAND WINDOW ENHANCEMENTS ..................................................................................26
12. SESSION WINDOW ENHANCEMENTS........................................................................................27
12.1 SESSION FILTERS...............................................................................................................................27
12.2 CONCATENATE HINT ........................................................................................................................28
12.3 CLOB AND LONG COLUMNS.........................................................................................................28
13. EDITOR ENHANCEMENTS...............................................................................................................29
13.1 GLOBAL NAVIGATION ......................................................................................................................29
13.2 GLOBAL BOOKMARK LIST ................................................................................................................29
13.3 COLOR MARKS ...................................................................................................................................29
13.4 SELECTION SUBMENU.......................................................................................................................30
13.5 PREFERENCES.....................................................................................................................................30
14. GRID ENHANCEMENTS.....................................................................................................................31
14.1 OBJECT GRID FILTERS......................................................................................................................31
14.2 FIND FUNCTION .................................................................................................................................31
4 PL/SQL Developer 7.0 New Features
1. Introduction
This document describes the most important new features in PL/SQL Developer 7.0. For a detailed
description of previous features, see the PL/SQL Developer 6.0 User’s Guide.
6 PL/SQL Developer 7.0 New Features
2. Diagram Window
The Diagram Window allows you to create a graphical representation of a selection of objects. This way
you can easily visualize (a part of) the database objects of your application or project and their relations:
You can add all relevant object types to a diagram, and include the relations between them. Foreign key
relations between tables are automatically included. For large diagrams you can add additional structure
by including object groups.
A diagram can be used for documentation purposes, but can also serve as a workspace. Right-clicking
on an object provides access to all object functions, and double-clicking on an object will invoke the
default action for the object type.
Adding relations
To add a relation between 2 objects, click on the icon of an element of the source object, and drag it to
the element of the target object. A line will be drawn between the 2 elements of the objects. You can
move the line to another element by selecting the line and moving the selection point up or down. To
remove a line, select it and press the Delete key.
If you add a table to a diagram, foreign key relations with other tables on the diagram will automatically
be included. These relations can be deleted if necessary.
By default relations will be drawn as straight lines. You can add additional bends by right-clicking on a
line and selecting Insert bend from the popup menu. You can also hold down the Ctrl key while
clicking on a line to insert a bend. A new selection point is added to the line as a result.
To create a one-to-many relation, right-click on the end of the line and select Change line end from the
popup menu.
Adding groups
To add additional structure to a large diagram, you can create object groups. Groups can have
distinctive colors, and can have a title at the upper or lower left or right:
To add a group, right click at an empty position on the diagram and select Add group from the popup
menu. A new group will appear at this location, which you can resize to appropriate dimensions. All
objects that are completely covered by the group will implicitly be part of that group, and moving the
group will also move these enclosed objects. If you hold down the Ctrl key while moving a group, the
enclosed objects will not be moved.
8 PL/SQL Developer 7.0 New Features
To change the appearance of a group, right-click on it and select the Properties item from the popup
menu. You can also double-click on the group. The following screen will appear:
You can change the font, fill color, line color and line size of the group, and make the group transparent.
You can optionally enter the title of the group, and specify the location of the title.
To create a default group appearance, right-click on it and select Set as default. This will apply to all
groups added to a diagram in the future.
To delete a group from the diagram, select it and press the Delete key. This will only delete the group,
and not the enclosed objects.
3. Graph Window
The Graph Window can be used to quickly visualize column data of a SQL Window or Report Window.
Consider the following query:
To see a graph of the salaries of the department you can press the Graph button:
This will start the Graph Wizard, which will first allow you to select the data for the X-axis:
This shows all columns and an [Index] item, which is useful if you don’t have an X-axis value but want
to display data on the Y-axis in order of occurrence. In this case we want to display the salary by
department number, so we select DEPTNO and press the Next button to select the data for the Y-axis:
After selecting SALARY for the Y-axis, you can press Next to select the graph type:
10 PL/SQL Developer 7.0 New Features
4. ODBC Importer
The ODBC Importer tool allows you to import data from any ODBC data source into an Oracle table:
On the first page of the ODBC Importer you need to select the ODBC data source, and optionally
provide a user name and password for this data source. You can subsequently connect, after which the
table list will be populated with all tables from the data source. Selecting a table will populate the Result
Preview pane. Instead of selecting a table, you can also provide a query by selecting the Import Query
Result option and entering a query text. This can be useful if you want to limit the rows or columns, or
if the results come from more than one table.
12 PL/SQL Developer 7.0 New Features
After entering the source specifications, you can switch to the Data to Oracle tab page to select the
destination table and to specify the column mapping:
In the General section you can select an owner and a table into which the records should be imported.
You can also select if you want to clear the table before the import, select a commit interval (0 =
commit at end) and to ignore duplicate rows or to overwrite them.
In the Fields section you can map fields from the ODBC data source (left) to columns in the Oracle
table (right). For each column you can additionally supply a SQL function. For example, if you want to
convert a string field to uppercase, enter upper(#). The hash sign will be replaced by the field data for
each record, and the resulting expression will be supplied in the insert statement.
After completing the field mapping, you can press the Import button to import the data into the Oracle
table. If you hold down the Ctrl key while pressing this button, an example insert statement will be
displayed so that you can verify the field mapping and SQL functions you specified.
To reuse this import definition later, you can press the Save Definition button on the toolbar. This
definition can be opened later by pressing the Open Definition button.
L/SQL Developer 7.0 New Features 13
On the Selection tab page you can select the table(s) you want to compare. After making this selection,
you can press the Target Session button, to select the user and database that you want to compare. This
will enable the Compare button, which you can press to start the compare operation, but you can also go
to the Options tab page first:
On this page you specify various options for the compare process.
• Actions – You can select the various actions you want to be performed in the target session. If, for
example, you omit the Delete action, only inserts and updates will be performed.
14 PL/SQL Developer 7.0 New Features
• Commit every N records – Controls after how many records a commit will occur. If you specify
0, only one commit will occur at the end of the process.
• Mode – Select Generate script to generate a SQL script with inserts, updates, deletes and commits.
You can save this script later and run it in the Command Window or in SQL*Plus. Select Update
database to immediately apply the changes in the target session.
• Target schema – If the tables are located in a different schema than the user of the target session,
you can specify this schema here. The target user will need the necessary privileges on the
selected tables in the target schema.
• Include owner in SQL – This option us only useful in script mode, and will prefix the table
names in the generated SQL with the owner. Doing so will allow you to connect as a different user
later when you run the script, and still apply the changes in the correct schema.
After selecting the appropriate options, you can press the Compare button to start the compare process.
After completion, the Differences will be displayed:
In update mode, this tab page will merely display the total number of inserted, updated, and deleted
records for each table.
In script mode, you can review all differences and save the resulting script by pressing the Save SQL to
file button to the right. Note that you can limit the script to specific tables by making a table selection in
the upper pane. You can also copy the SQL to the clipboard or apply the selected changes in the target
session by pressing the corresponding buttons to the right.
L/SQL Developer 7.0 New Features 15
6. Test Manager
To perform regression testing for your Oracle stored program units you can use the Test Manager. It
allows you to define a Test Set, which is a collection of Test Scripts with input variable values and
required output. It additionally allows you to specify required performance:
For this example the Test Set consists of 3 Test Scripts. For the selected DeptName.tst script the
p_empno variable will get the value 7499 on input, and after execution the result variable value must be
SALES.
Running a Test Set will quickly reveal if the tested program units still function correctly and/or with the
required performance:
All failed Test Scripts will have a red indicator and will be placed at the top. In this case the
DeptName(7499) script failed, because the specification required that the result is “SALES” instead of
the actual “Sales” value.
16 PL/SQL Developer 7.0 New Features
Click Yes to create a new, empty Test Script. You will need to manually program the Test Script
and save it before it can be used in the Test Set.
Click No if you want to add an existing Test Script to the Test Set.
After the Test Script is saved, you can specify the definition in the Test Set:
• Test script – The filename of the Test Script. This will already by filled in if you have created and
saved a new Test Script. If you want to add an existing Test Script, press the Browse button to the
right of this field.
• Description – A functional description of the script. If you run a single script multiple times with
different input variable values, you should include this in the description as well so that it can
quickly be recognized in the list.
• Enabled – Use this option to enable or disable the script for the Test Set. Only enabled scripts will
be included in the test run, and disabled scripts will be skipped.
• Performance – The required performance can be specified as the maximum number of seconds
(fractions allowed). If you leave this field empty, the performance will not be tested.
• Variables – For each variable in the Test Script, enter the name, input value, and required output
value. The input value will be passed to the Test Script before execution. The required output
value will be tested after execution. If you leave the output value empty, it will not be tested. To
test for null values, enter the word “null”.
To test for dbms_output, enter “dbms_output” for the variable name, and enter the required text
for the output value.
At the lower left you see 2 buttons that allow you to quickly run and check the selected Test Script, or
to open it in a Test Window for editing.
L/SQL Developer 7.0 New Features 17
To dock a tool, simply drag it to the left, right, top or bottom of the work area. As soon as you come
close to the side of the work area, a frame will be displayed, indicating the docking position. If another
tool is already docked at this location, you can drag the new tool above, below, to the left, to the right,
or within the other tool. If you drag one tool within the other, they will become available at the same
position on different tab pages (see the Window List and Template List in the screenshot above).
To make a tool float, simply drag it from its docking position to a floating position.
L/SQL Developer 7.0 New Features 19
8. Search Bar
The Search Bar is available from the Edit menu and can be displayed as a floating tool, or docked at the
top or bottom of the work area. In its docked position, it can be permanently available to perform
searches across multiple editors and multiple windows:
After entering a search word, you can press the Search button or press Enter. The search results will be
highlighted in the editor(s), and you can press the Go to next/previous occurrence buttons to navigate
the search results. You can press Esc to move the focus from the search bar to the editor.
The Search list button will bring up an hierarchical display of the search results:
In this tree view you can see the windows, editors, and lines where the search results are found.
Clicking on a search result will bring the window and editor to the front, will navigate to the search
result, and will select it. You can dock the search list to make it accessible at all times without blocking
any other windows.
On the search bar you can additionally enable options to search all editors or just the current editor, to
search case sensitive, to search for whole words only, and to use regular expressions.
20 PL/SQL Developer 7.0 New Features
For each naming convention you can define the element type (parameter, variable, and so on), the
required prefix for the element type, the possible values for the first and subsequent characters (after the
prefix), the required suffix, and a description for the hint that should be displayed when the naming
convention is not met.
The description should be in the form as displayed in the example above. The actual hint message will
be <Element> <Name> <Description>. For example: Parameter ‘StartDate’ must start with ‘p_’.
If an element must meet one of multiple naming conventions, then you can simply add multiple lines for
the same element type. The descriptions of all lines will be displayed, separated with ‘or’. For the
example above the parameter hint message will be:
Parameter 'StartDate' must start with 'p_' or must be 'Self'
L/SQL Developer 7.0 New Features 21
If the preference is disabled, you need to explicitly use the Find Matches function of the Edit menu.
9.5 Refactoring
The refactoring function allows you to quickly reorganize your PL/SQL code. It works on the selected
code, or – if no selection is made – on the current statement. Right-clicking on a statement or selection
provides the following refactoring functions in the corresponding submenu:
22 PL/SQL Developer 7.0 New Features
• Rename item
Renames the current variable, parameter, constant or program unit. Both the declaration and usage
will be renamed.
• Convert selection to procedure
If a program unit has become too large or too complex, you can make a selection and convert it to
a separate procedure. All variables used within and outside of the selection will be converted to
parameters. All variables used only within the selection will be moved from the current program
unit to the new program unit. The selection will be replaced by a call to the new program unit.
• Convert selection to local constant
If a certain expression should be converted to a local constant, you can select it and provide the
constant name. A local constant will be created within the current subprogram, of a type that is
determined from the expression. All occurrences of the expression in the current subprogram will
be replaced by the constant name.
• Convert selection to global constant
If a certain expression should be converted to a global constant, you can select it and provide the
constant name. A global constant will be created within the current package, of a type that is
determined from the expression. All occurrences of the expression in the current package will be
replaced by the constant name.
• Replace assignment with initialization
If a local variable assignment is purely for initialization, you can move it to the declaration of the
variable. You can right-click on a statement or select multiple statements.
If the results of a refactoring action are not satisfactory, you can simply undo it.
When switching between result tabs, the corresponding statement or PL/SQL Block will be highlighted
in the SQL Editor. Statements that raised an error are marked with a red X on the corresponding tab.
The error positions are marked with a red underscore in the SQL Editor.
The alternate color can be enabled or disabled through a preference, and you can also set the actual
color. The null value cell color preference will take precedence over the alternate row color to indicate
null values.
When editing the result set, the totals will dynamically be updated.
To clear a total, right-click on the column and select None from the Column Totals submenu.
In this case the All sessions filter is used. To view or edit the filters, press the Define Session Queries
button on the toolbar:
Here you can define the Session Filters on the first tab page. The Caption will be displayed in the filter
selection list. The Query will be executed to populate the session list.
28 PL/SQL Developer 7.0 New Features
The sql_text column of all rows returned by this query will be concatenated, and displayed as one value
in the session detail grid.
Whenever you move to an absolute location within the same editor or in a different editor, a navigation
bookmark is added to which you can return later. This way you can quickly find your way back if a
function takes you to a different location, such as a find, hyperlink navigation, opening a new window,
and so on.
In this tree view you can see the windows, editors, and lines where a bookmark is located. Clicking on a
bookmark will bring the window and editor to the front, will navigate to that bookmark. You can dock
the bookmark list to make it accessible at all times without blocking any other windows.
The background color of the selected text will change to the current marker color:
To change the marker color, press the arrow next to the button and select a new color. To clear a color
mark, place the cursor within the marked text without making a selection, and press the Color marker
button.
30 PL/SQL Developer 7.0 New Features
13.5 Preferences
The Highlight color determines the color of all highlights such as parentheses, variables, and so on.
The Search hit color determines the color of the search hits found by the search bar.
L/SQL Developer 7.0 New Features 31
The Linebreaks option controls how lines are terminated in text files. The can either be terminated in
Windows style by CR/LF character pairs, or in Unix/Linux style by a single LF character. You can
additionally specify that files are in Unix format on specific locations, and in Windows format
otherwise. You can specify multiple directories on separate lines, and select a directory by pressing the
Add location button (...). Note that not only files saved in this directory are formatted in Unix style, but
also all files saved in subdirectories below this directory.
The Export with smart quotes controls how values are exported in CSV format. When disabled, all
values are enclosed in quotes. When enabled, only those values that require them are enclosed in quotes.
This are values that contain comma’s or quotes.
L/SQL Developer 7.0 New Features 33
If a Query Builder Plug-In is installed, then the standard Query Builder function will invoke the Plug-
In. Right-clicking on the Query Builder button allows you to select a query builder from a list of all
installed query builders. The most recently used query builder will be invoked by default when you
subsequently use the Query Builder function again.
34 PL/SQL Developer 7.0 New Features
This is an empty OFS Location Directory, for which you can add locations, and which you can save in
an OFS Location Directory file (.ldf). This file is used from within PL/SQL Developer to browse the
directory and to connect to locations and browse the files.
L/SQL Developer 7.0 New Features 35
You first need to open a location, after which you can save the file or create a directory:
To open a file from the OFS, you can user the OFS Open item from the File menu, or use the Reopen
menu. OFS files have the path name OFS:\Location\Path (e.g. OFS:\Chicago\Programs\Employee.bdy).
A previously opened OFS file can be saved by using the standard Save function. You can use the Save
As function to save an OFS file to the standard file system. The OFS Save As function can be used to
save it in the OFS under a different name or in a different directory.
When saving or opening a file, you can select the Keep locked option to lock it. Other users cannot lock
or overwrite a file that is locked by you.
L/SQL Developer 7.0 New Features 37
Right-clicking on a file in the file selector gives you the option to Cut, Copy, Paste, Delete or Rename
the file. You can also view and change object properties from this popup menu. Properties you can
change include the Read-only status, the Locked status, and the Compressed status. Files can only be
compressed on Oracle10g and later, since it uses the utl_compress package which is only available
since 10g.
38 PL/SQL Developer 7.0 New Features