Validate that Foreign Keys are Unique

Search Knowledge Base by Keyword

< Back

The VALIDATEFKEYS Action checks that Foreign Keys and “soft” Primary Keys in the Staging Database are valid.  It will check all Foreign Keys where

  1. The Foreign Key is set to “Active” in either the ForeignKeys or SoftKeys Sheet.
  2. The relevant Foreign Key table and Primary key table is set to “Active” in the Tables Sheet.

To be valid, Foreign Key must refer to a column in another table with a valid, corresponding value.

To run VALIDATEFKEYS, first open your re-usable .cmd script in a text editor.

If you have already configured a .cmd script for one Subset Action and wish to edit and re-use that script, you should only need to specify “VALIDATEFKEYS” for  -parAction=””:

Otherwise, configure all mandatory parameters in the .cmd script. You should also specify the location of the Subset Report using -parReportFile.

You can also specify optional parameters for the Action. You should also specify the location of the Subset Report using -parReportFile.

Make sure your Control Spreadsheet, the Subset Report, and any Log Files are closed.

The results are created in the Subset Report:

Data Subsetting

The results can also be analysed in the Log File:

Data Subsetting

In both instances, “All foreign keys satisfied” means that all Foreign Key constraints are met. Otherwise, the number of non-unique keys is reported.