Copy/paste between different applications are probably the most frequently used actions without necessarily being aware of it. DbVisualizer offers some useful copy/paste features that are outlined in this tips and tricks session. 

Copying Selection

The standard Copy Selection command (Ctrl+C, CMD+C) copies the selected cells in CSV text format based on the settings in Tool Properties / General / Grid. The default column delimiter is a tab (\t) and the row delimiter is a line feed (LF). These are the delimiters used by most external spreadsheet applications such as MS Excel.

This is the result when pasting in a text editor:

000030  SALLY  A  KWAN  C01 

000050  JOHN  B  GEYER  E01

000060  IRVING  F  STERN  D11

000070  EVA D  PULASKI D21

000090  EILEEN  W  HENDERSON  E11

000100  THEODORE  Q  SPENSER E21


As you can see the data is not aligned in fixed columns. The reason for this is that a tab (\t) is used as a delimiter between the columns. This format is suitable for pasting in the table data editor in DbVisualizer or external applications such as MS Excel.


This is the copy command you should use when later pasting a block of cells in the table data editor. Copy/paste of BLOB/Binary and CLOB data types is also supported.


Copying Selection with Column Header 

The Copy Selection with Column Header (Ctrl+H, CMD+H) is exactly the same as Copy Selection with the addition that grid column labels are the first row in the output.


EMPNO  FIRSTNME  MIDINIT LASTNAME  WORKDEPT

000030  SALLY  A  KWAN  C01

000050  JOHN  B  GEYER  E01

000060  IRVING  F  STERN  D11

000070  EVA D  PULASKI D21

000090  EILEEN  W  HENDERSON  E11

000100  THEODORE  Q  SPENSER E21


Copying Selection as Formatted Text

The Copy Selection as Formatted Text (Ctrl+Alt+H, CMD+Alt+H) formats the columns as fixed width columns. This is format is suitable for reading using a monospaced font.

EMPNO  FIRSTNME MIDINIT LASTNAME  WORKDEPT  

------ -------- ------- --------- -------- 

000030 SALLY    A       KWAN      C01 

000050 JOHN     B       GEYER     E01 

000060 IRVING   F       STERN     D11 

000070 EVA      D       PULASKI   D21 

000090 EILEEN   W       HENDERSON E11 

000100 THEODORE Q       SPENSER   E21


Drag BLOB/Binary and CLOB data to external applications

Copying BLOB/Binary and CLOB data is easy using drag and drop. Just select the cell(s) in DbVisualizer, drag, and then drop in the target application.

Copy external files to BLOB/Binary and CLOB data types in DbVisualizer

If an external application supports copying files, images, PDFs and other formats these can be pasted in the table data editor in DbVisualizer.

Next screenshot is the Image Viewer in Windows with 8 image files selected for copy.

To paste in DbVisualizer open a table with a binary column and paste in the binary cell (or multiple selected cells). New rows are created if needed.

Copy Selection as Comma List 

FROM 9.2

This function copies the selected cells as a list to the system clipboard.


EMPLOYEE_ID

FIRST_NAME

106Valli
107Diana

Example when all values are selected in the above example and then the right-click menu command Copy Selection as Comma list, the following is inserted in the system clipboard:

106,107 

Valli,Diana


Copy Selection as IN clause 

FROM 9.2

This function copies the selected cells as a SQL In clause to the system clipboard.


EMPLOYEE_ID

FIRST_NAME

106Valli
107Diana

Example when all values are selected in the above example and then the right-click menu command Copy Selection as In clause, the following is copied to the system clipboard:

emp.EMPLOYEE_ID IN (107,106) AND 

emp.FIRST_NAME IN ('Diana','Valli')