|Table of Contents|
Opening the Data tab
To open the Data tab for a table:
Editing Data in the Grid
To edit a column value:
- Select the column cell,
- Type the new value, or double click to edit the current value,
- Click the Save toolbar button to update the database.
Reverting all cells in a row that are marked as Insert or Duplicate removes the complete row from the grid while a Delete marked row is cleared from its delete state. Undoing updated cells simply reverts the changes to the original values.
You can copy selected cell values with the Copy Selection right-click menu choice or the corresponding key binding (Ctrl-C or Command-C by default). The data on the clipboard may then be pasted either into DbVisualizer or any external application. The column and newline delimiter used for copy and paste operations in the grid editor are defined by the Copy Grid Cells in CSV Format settings in the Grid category in the Tool Properties dialog, under the General tab. The default setting are sufficient for most uses.
|Copy from spreadsheet||Paste into DbVisualizer grid|
A single cell is copied
Paste into selected target cell
A single cell is copied
Paste and fill the single column target selection
Multiple cells in a single row is copied
Paste and fill the target selection
A block of cells is copied
The block is pasted into the selected region
A block of cells is copied
The block is pasted into a non equal number of target cells
Updates and Deletes Must Match Only One Table Row
When you update or delete rows, DbVisualizer ensures that only one row in the table will be affected. This is to prevent changes in one row to silently affect data in other rows. DbVisualizer uses the following strategies to determine the uniqueness of the edited row:
The Primary Key concept is widely used in databases to uniquely identify the key columns in tables. If the table has a primary key, DbVisualizer uses it. There are situations when primary keys are not supported by a database or when primary keys are supported but not used. If no primary key is defined, DbVisualizer checks if there is a unique index. If there are several unique indexes, DbVisualizer picks one of them. If there is no primary key or any unique indexes defined for the table, you need to manually choose what columns to use. The Key Column Chooser is automatically displayed if the key columns can't be determined automatically.
Key Column(s) Chooser
Normally database tables have a primary key or at least one unique index. If this is the case, editing is no problem. If there is no way to uniquely identify rows in the table, you need to manually define what columns DbVisualizer should use. While saving the changes, DbVisualizer checks that there is a way to identify unique rows in the table. If it cannot be accomplished, the following window is displayed.
If the database request to save the edits cannot uniquely identify the single row that should be changed, an error dialog is displayed and the editing state is kept for that row in the grid editor.
The grid editor supports editing multiple rows and saving all changes in one database transaction. Edited rows are indicated with an icon in the row header:
Cell(s) in the row has been edited
Row is new
Row is duplicated from another row
Row is marked for deletion (edit is not allowed)
Data Type checking
When leaving an edited cell, the new value is validated with the data type for the column. If there is an error, the following dialog is displayed.
New Line and Carriage Return
If a cell in the grid editor or form editor contains new line, carriage return or tab characters, these are not visually represented in the grid. Instead a warning will be displayed whenever you try to edit such value:
You may chose to edit the value in the Cell Editor, which we recommend, as the control characters will then be preserved. Alternatively, you can edit the value in the grid anyway but you then risk loosing the control characters.
Using the Cell Editor/Viewer
The Cell Viewer is available in the right-click menu for all grids in DbVisualizer. It presents the data for a single cell (column in a row) in a window. If the data is of a recognized type, it is presented by a corresponding viewer:
The Cell Viewer also allow you to save the data to a file and to print it.
The Cell Editor adds editing capability to the cell viewer. You may import data from a file or manually change the text in a text editor.
Using the Form Editor/Viewer
The Form Viewer is available in the right-click menu (Browse Row in Form) for all grids in DbVisualizer. It is used to browse information and to present binary data in viewers.
The Form Editor adds editing capability to the form viewer. This editor is useful when inserting new rows and when it is important to get a more balanced overview of all the data.
The form editor "rotate" the data in one row and presents it as a vertical form with the column name as a label. All edits made in the form editor are reflected in the grid with the edited state icon being updated along with new values. Saving edits in the database is always done with the Save button in the grid editor toolbar, just as for data edited directly in the grid.
Open the form editor via the Edit Row in Form right-click menu choice, via the corresponding button in the toolbar or by double-clicking the row number header.
If you want numbers to be right-aligned in the Form Viewer, enable Right Aligned Numbers in the Tool Properties dialog, in the Form Viewer category under the General tab.
You may preview the SQL statements that will be executed when choosing to Save the edits via the Edit Table Data->SQL Preview right-click menu choice.
The listed SQL statements may not be 100% identical to what is sent to the database, as the save process uses variable binding to pass values to the database.
Editing Binary/BLOB and CLOB Data