Add Primary Keys
Search Knowledge Base by Keyword
The ADDPKEYS Action adds Primary Key Constraints to the Data Subset. It will add all Primary Keys specified where
- The Primary Key is set to “Active” in Tables Sheet of the Control Spreadsheet.
- The relevant Foreign Key table and Primary key table is set to “Active” in the Tables Sheet.
The PREPENV action creates Indices in the Target Data, but does not create the Primary Key constraints. The SUBSET action will not create them either.
If you have run SUBSET and are happy with the results, you can then add your Primary Keys using the ADDPKEYS Action.
This adds the Primary Keys that are set to “Active” in the Tables sheet of the Control Spreadsheet. Instructions for editing the Tables sheet are available here.
To run ADDPKEYS, open The VIP Server Controller from your desktop or start menu. You must open it as an administrator. If The VIP Server Controller is already running, make sure the relevant .vip workflows are Put in Memory. See this article for instructions.
Next, complete the mandatory parameters in the “Run Flow” tab. If working from a Config file created for the current Subset, you should only need to update the parAction argument and enter any additional optional parameters. You will need to update the location of the Subset Report and SQLActionsPath if these have changed. See this article for instructions on working with a Config file.
Specify “ADDPKEYS” for parACTION:
parAction=ADDPKEYS
Complete any optional parameters. See this Knowledge Base article for a full list of Arguments and example parameters.
Once you have parameterized the ADDPKEYS Action, make sure your Configuration Spreadsheet, Subset Report and Log file are all shut. Next, click “Create File” and then click “Start” to run the action.
In the output dialogue, you will see “Flow execution completed on remote server. Please check logs for details.” once the ADDPKEYS Action is complete”:
If you receive an error message in your output dialogue or log, please refer to this article to troubleshoot common issues. You can also run your Action on debug mode for a more detailed log. You can also check the Log File and Subset Report at this stage, to check that the Actions have performed correctly.
Next, check your Database to make sure the Primary Keys constraints have been added. You can additionally run the VALIDATEPKEYS Action to make sure all Primary Keys are unique.
If the Primary Keys are incorrect, you can perform the DROPPKEYS Action to remove them and add a new set.
Note: You can only add Primary Keys that are not already present in the target database. Otherwise the action will fail. If you need to first remove certain Primary Keys, you can use the DROPPKEYS action or the composite DROPKEYS action.
Run ADDPKEYS form the Command Line
To run ADDPKEYS from the Command Line, 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 set “ADDPKEYS” for “Action”.
Otherwise, configure all mandatory parameters in the .cmd script.
You can also specify optional parameters at this stage.
Make sure your Control Spreadsheet, the Subset Report, and any Log Files are closed.
Run the script to add the Primary Keys.
Check the Log File and Subset Report at this stage, to check that the Actions have performed correctly.
Next, check your Database to make sure the Primary Keys constraints have been added. You can additionally run the VALIDATEPKEYS Action to make sure all Primary Keys are unique.
If the Primary Keys are incorrect, you can perform the DROPPKEYS Action to remove them and add a new set.
Note: You can only add Primary Keys that are not already present in the target database. Otherwise the action will fail. If you need to first remove certain Primary Keys, you can use the DROPPKEYS action or the composite DROPKEYS action.
-
-
-
- IEnumerable to Data Reader
- Data Table to List
- Nested String List to Data Table
- List to Data Table
- IEnumerable to List
- List to IEnumerable
- Remove from List
- Exists in List
- Value Exists in Dictionary
- Key Exists in Dictionary
- Remove from Dictionary
- Get from Dictionary
- Clear Dictionary
- Add to Dictionary
- Clear List
- Add to List
- Show all articles ( 1 ) Collapse Articles
-
-
-
-
- Explanation of Remaining Sheets in the Control Spreadsheet (for reference only)
- The ForeignKeys Sheet - Specifying which Foreign Keys to read from the Source Database
- The Tables Sheet: Defining Metadata that will be read from the Source Database
- The ProcessModel sheet – Toggling Subset Rules
- Refining the Control Spreadsheet
- Overview of the Advanced Control Spreadsheet
- Introduction
-
- Drop both Primary and Foreign Keys (The composite DROPKEYS Action)
- Validate Both Primary and Foreign Keys (The composite ValidateKeys Action)
- Add Both Primary and Foreign Keys (The Composite ADDKEYS action)
- Drop Tables
- Truncate Data
- Delete Orphans
- Drop Primary Keys
- Drop Foreign Keys
- Validate that Foreign Keys are Unique
- Validate that Primary Keys are Unique
- Add Foreign Keys
- Add Primary Keys
- Overview of Post-Subset Actions
-
-
- Use Event Hooks to call VIP Flows
- Different Methods for Connecting to Source Databases
- PreProcess Variables and Parameters
- Using SQL Functions to query Databases and Using the Queries in Data Generation Functions
- Summary of the Process to Configure the Test Data Configuration sheet
- How the PreProcessVariables Table is used in the Configuration sheet
- Sample Commerce Configuration Sheet Examples
- Adding Event Hooks in Configuration sheet for custom functionality
- How to Configure the Synthetic Test Data Configuration Control Sheet
-
-
-
-
-
- The UI Recorder
- Test Modeller – Maintenance
- Test Modeller Core (Linux) Optional – Postgres LDAP
- Test Modeller Core (Linux) Optional – SSL Certificate Installation
- Test Modeller Core (Linux) Optional – Active Directory
- Test Modeller Core (Linux) Installation
- Test Modeller: Software Pre-requisites
- Test Modeller : Installation components
- Test Modeller : System requirements (Windows, Linux)
-
-
-
- Articles coming soon
-
- Articles coming soon
-
-
-
- Common Problems
- Extend Test Modeller (Advanced)
- Edit Code Templates (Advanced)
- Import existing framework / custom page objects (Advanced)
- Execute Tests (Java)
- Generate Automation Code
- Build a Model (Java)
- Scan an Existing Web App
- Configuration (Java)
- Prerequisites (Selenium Java)
- Welcome Selenium (Java)
-
-
-
-