A few hints to get things done more quickly.


Right-click stuff

PMF focuses on ease of use. A very central element is the right-click popup-menu that opens whenever you right-click a data cell.
The pop-up menu is designed to make finding and editing data in a table much easier. Use the Filters to quickly narrow down the search, and use the Edit  options to view and edit data.

It looks like this:




(Some options, for example "Edit XML", are only active when the cell has the corresponding data type)


Filter:   Enter a search term ("branch" in the example above) and hit ENTER. PMF will create and run a SELECT statement like "Select * from [table] where [colname] like [search term]"

This works on numerical as well as alpha-numerical columns and even on CHAR FOR BIT columns.
To narrow the search further, right-click again on any cell (in the same or another column) and add another search term with a leading "+" , this will expand the constraint:
"Select * from [table] where [colname1] like [first search term] and [colname2] like [second search term]"
The search is case-insensitive.


Other Filters: Distinct: This cell's column: This will run "select distinct(colName) from table order by colName"

Display LOB: Behind the scenes, PMF will write the LOB's content into a temporary file. Using the file's mime type, PMF will then try to start the system's default application to display the file.
If for example the LOB is an image file, PMF will try to start your system's image viewer. For text files, the default editor will be started and so on.
Whatever you do to the file will not be written back to the database.

Copy rows and Paste rows: You can copy rows from one table into another, even across databases. The target table obviously needs to have the same number and size of columns (the column names may differ). This will also work with LOBs and XMLs.
After pasting rows into the target table, the rows are "insert pending", meaning you have to explicitly click "Save" to commit them.

This is intended for a small number of rows. If you want to move a large amount of data between tables, you are probably better off with database specific export and import tools.


Use Tabs to view multiple tables

You can open/view as many tables as you like (in the same database). Use Menu->New Tab and Menu->Close Tab or STRG+T and STRG+W to open and close tabs.

A few notes on the GUI

The buttons


Field "SQL Cmd"


Enter a SQL statement here (SELECT, INSERT, UPDATE, DELETE but also commands that are not necessarily table-related: CREATE VIEW, DROP, ....) and click 'Run Cmd' or hit F5 to execute.
These commands will be persistently stored in the ComboBox 'Stored Cmds'.


Filters

Use these ComboBoxes to create SQL statements

Stored Cmds

Previously executed statements are stored here.




Importing data

This is available for DB2 only.

To import data from a file into a table, click "Menu->Table->Import and Load". The following dialog will open:

import_main


1. Select the file(s) to import either by Drag&Drop or by clicking "Select File(s)". Note: When importing multiple files, the filenames must correspond to existing tables.
When you export a table using PMF, the suggested export filename will be the tablename (see Exporting data). When you import such a file, PMF will infer the target table from the filename.

2. Chose whether to IMPORT or to LOAD data (see "Options" below).

3.  Format: PMF will try to guess the correct file format (IXF, DEL or WSF), you can override this.

4. Select how data should be inserted (Insert, Replace, Create etc), and select the target table on the right-hand side. To CREATE a table, fill in the appropriate field. The table name is case-sensitive.

Hints for Import and Load:

A note on LOAD: As you probably know, LOAD is a dangerous beast. Especially in HADR environments you can completely destroy a table with unsound LOAD options.
PMF will try its best to assist you, for example, PMF will run "SET INTEGRITY FOR [target table] ALL IMMEDIATE UNCHECKED" after load and PMF will allow you to restart counters on GENERATED ALWAYS columns.


Import and Load Options

Click on "Options" for additional settings. To make your settings permanent, click "Save Settings". You can restore defaults by clicking "Restore default"
All options are DB2 keywords, please refer to IBMs documentation for details.



Exporting data

To export data from a table, click "Menu->Table->Export". The following dialog will open:


export_main

1. Select the export format:
2. Select the output file by clicking "Select File". By default, PMF will suggest the name the name of the currently opened table as filename. The idea behind this is that when you import the file using PMF, the name of the target table can be inferred from the file name. PMF will then suggest the correct table as import target (see Importing data)

3. Select what to export:
4. On tables that contain LOBs (Large Objects), you can chose to export those too; click "Options" for more, well, options.

Export Options

Clicking  "Options" will open this dialog (DB2 only):

export_options

You can set lots of different options for IXF and DEL exports, among other things you can chose to export LOBs into one large file or create a  file for each LOB.
All options are DB2 keywords, please refer to IBMs documentation for details.
Click "Save Settings" to make the settings persistent, click "Restore default"  for the default settings.