Skip to content
The latest version of DbVisualizer was released 2024-07-04DOWNLOAD HERE ->

Editing a Code Object

Only in DbVisualizer Pro

This feature is only available in the DbVisualizer Pro edition.

To edit the code for an object, such as a function, stored procedure or database-dependent code object:

  1. Expand nodes in the tree under the connection node in the Databases tab tree until you reach the node for the object you want to edit,
  2. Double-click the node to open an Object View tab for it, and select the editor sub tab (e.g., the Procedure Editor tab).

The editor has a toolbar with various actions to save/compile the procedure, save and load the source to/from file and perform common editing operations. The Status indicator shows whether the procedure is valid or invalid based on last compilation (not available for all databases).

Edit the source code and save/compile the procedure when you are happy with the code, using the Save toolbar button.

Screenshot of the procedure editor interface

If errors occur, the corresponding text is underlined with a red wavy line. Hovering the mouse over the error indication shows the corresponding error message. The right margin contains markers for each error as well, and clicking on a marker scrolls the editor to the corresponding error. Alternatively, you can click the FAILED link in the Log tab grid to move the caret to the error location.

If you prefer to navigate between errors using the keyboard, you can use the defined key bindings for the Insertion Point to Next Marker and Insertion Point to Previous Marker actions in the Tool Properties dialog, in the Key Bindings category, in the Editor Commands group. Alternative is to use the Goto Next Failed and Goto Previous Failed in the right click menu of Log tab grid, and then click the link for the FAILED entries.

Error location information is not available for some databases. In that case the complete statement is underlined in the editor.

Disable Error Markers in the SQL Editor

From DbVisualizer 10.0.5 it is possible to disable error markers in the SQL Commander->SQL Commander Options menus. With Show Error Position Markers turned on it shows markers only for databases that specifically report positions of errors in a statement. With Show Error Statement Markers turned on the complete statement is highlighted if it fails during execution, but only if either the Show Error Position Markers is turned off or if the driver/database doesn't report positions of errors.

If you re looking to minimize the amount of error markers when executing scripts, turn off Show Error Statement Markers and keep the Show Error Position Markers checked (turned on). DbVisualizer will then report errors reported by the JDBC driver only.

To set default values for these settings visit Tools->Tool Properties and the General / SQL Commander category.

In addition to the Status indicator in the editor, the object icon in the tree shows a little red cross for invalid procedures, for databases that provide this information. You can see this for the UPDATE_STATUS procedure node in the screenshot above.

The figure below shows the result after correcting the errors and recompiling the procedure:

Screenshot of the procedure editor interface showing successful correction

The status indicator now shows that the procedure is VALID.