Table Utilities

The Table Utilities tab on the Database Explorer looks like this:

All tables contained in the database (even from other projects, if applicable), are shown in the table list to the left. You can filter the tables by "Working and Master Tables", "Support Tables", or "All Tables" using the drop-down list. You can select one or more tables to perform an operation on it by either clicking on the buttons to the right or right-clicking on the table list to see a context menu. Some of the functions available in the Database Explorer are reproduced elsewhere in WRDB (e.g., you can select Edit | Delete Selected Records to delete records in a Working table); they are all assembled here for convenience.

View Contents: this opens a generic table browser and displays all fields in up to 1000 records of the table like this:

 

Note that this table is read-only--you should use the Working and Support table browsers to edit data. Also, this is the default action if you double-click on a table name.

Rename Table...: you are prompted to enter the new name for the table. This button is active only if a single table is selected. Also, be aware that various data providers have unique rules about table naming (some do not allow table names to start with numbers or contain spaces); if you try to create an invalidly named table, you will be warned.

Delete Tables: after confirmation, this will delete all selected tables and update the Tracking table.

Copy Table...: when a single table is selected and you click this button, you will be prompted for a new table name to copy to.

Copy From...: regardless of whether any tables are selected, this button will open another form that lets you copy multiple tables from another WRDB Project and rename them in the process:

This command allows you to select a different WRDB project; then the list of available tables updates. You can then select one or more tables to copy to your current project. You have the option of automatically renaming the tables as they are being copied.

Delete Records: This command allows you to delete selected records from a table. The following form is displayed:

Records in the selected table are deleted based on the selection criteria. In the above example, all records having a Station ID of "03295400" and PCode of "DO" will be deleted (after confirmation of how many records that would be). You can click the Assist buttons to display forms that help you specify the selection criteria.

Change Records: this is similar to the Delete Records feature, however in addition to entering the selection criteria, you also must specify the new values for selected fields. Changing selected records is a two-step process: first you must specify which records are to be changed, then you specify what values selected fields are to be changed to. The form looks like this:

In the above example, after confirmation of the number of affected records, all records having a Station ID of "03295500" and PCode of "FLOWCFS" will have only their Result field changed (the former value will be multiplied by 10). Click the "Hints" button for help on entering information in the New Value column.

Delete Duplicates: this will examine the selected table and determine if any duplicate records exist in a data table. Records are said to be duplicates when all fields except Validated and Track_ID are identical. After confirmation, the duplicate records will be deleted.

Display Duplicates: this is similar to Delete Duplicates except the duplicate records are merely displayed (not deleted). You have the option of selecting which fields to compare when determining duplicates:

Compare Tables: this function is active only if exactly two tables are selected. With it, you will be shown a table identifying all records in either table that do not match.

Search in Tables: this utility will search all Working tables for the specified Station ID and/or PCode and provide a summary list:

Upgrade Tables: This routine will upgrade all selected tables to the latest WRDB schema. This will normally be done automatically for you whenever you open a table, however this may be useful to upgrade multiple tables at a time. We recommend that you backup your data before proceeding.

Import Data: when a single table is selected, you can browse to a tab-delimited text file to be imported; data will be appended to the selected table. This import file must be in the correct format (with appropriate column headings) and is very fast because it does not validation (that is, it is possible to import data at stations that don't exist in your Stations table). If you want to import data from a variety of different formats with Support table validation and manually map import columns to WRDB fields, use Edit | Import File or Table or File | Project Management | Import Support Tables.

Archive Data: this will export data in the selected tables to provider-independent text files and compress them into a Zip file of your choosing.

Export Data: you can export data from one or more tables to a tab-delimited text file using this function. Correct column headings are automatically included. If you export multiple tables, the text files are named after the tables, and existing text files are automatically overwritten.

Compact/Repair: some data providers are able to compact and repair the database. This is useful if the database becomes corrupted or if you want to reclaim disk space used by deleted tables. In general, server-type database do not have this capability--your DBA will take care of keeping the database in good working order.

Manage Indices: the addition of table indices can significantly speed up queries. WRDB lets you easily add and remove table indices using the following form:

All table fields are listed; to add an index for a field, check it; to remove an index, uncheck it. Be aware that index creation and delete can be very time consuming, so patience may be required.

Note: tables that contain indices are very fast for queries, but slower for updates. We recommend that you only apply indices to Master tables whose contents are fairly static (that is, you rarely if ever Transfer data to them from Working tables).

After performing all table operations and closing the Database Explorer form, the database will be checked for missing Support tables; if some are missing, you will be prompted to create new empty Support tables.