Importing Data into the Client Tool, Part 2
Monday, June 30, 2008![Merge Traffic Sign](http://ecmps.camdsupport.com/blog/images/320px-Road_sign_merging.svg.png)
Importing data into the Client Tool is one of the most common and important functions that you will perform. It is important to understand how data are handled during the import. In the first post in this series, key fields were explained. The key fields are important because they identify unique pieces of data for a data type. For example, the key fields of Unit ID and System ID identify a unique system associated with a monitoring plan.
Monitoring plan data which are imported into the Client Tool are merged with the existing monitoring plan data. This is done to insure that the monitoring plan history is maintained.
How the data are merged is determined by a comparison of the data between the data in the XML file and the data in the Client Tool database. The comparison is performed on the key fields for each type of monitoring plan data. The data types and corresponding key fields are listed below in the table. Some data types have more than one set of key fields which are used for comparison. This allows for comparison of records that are active (EndDate is null) and records that are no longer active (EndData is not null).
There are two results that can occur based on the comparison of the key fields.
- If the key fields match between the data in the XML file and the data in the Client Tool, the Client Tool proceeds to update any other data fields associated with that data type. For example, if the MonitoringLoadData key fields match, but the MaximumLoadValue is different, the Client Tool will update the MaximumLoadValue in the Client Tool with the value from the XML file.
- If a match on key fields cannot be made, the Client Tool will insert a new record based on the data in the XML file. For example, if the MonitoringLoadData in the XML does not match any of the MonitoringLoadData in the Client Tool, the Client Tool will add a new record using all of the values from the MonitoringLoadData in the XML file.
Next: How Merging Monitoring Plan Data Affects Correcting Monitoring Plan Data
Monitoring Plan Data Types and Key Fields
Data Type | Key Fields |
---|---|
AnalyzerRangeData | UnitStackPipeID + ComponentID + BeginDate +Begin Hour or UnitStackPipeID + ComponentID + EndDate + EndHour (if EndDate is not null) |
CalibrationStandardData | UnitStackPipeID + ComponentID + BeginDate +Begin Hour or UnitStackPipeID + ComponentID + EndDate + EndHour (if EndDate is not null) |
ComponentData | UnitStackPipeID + ComponentID |
MonitoringDefaultData | UnitStackPipeID + ParameterCode + DefaultPurposeCode + FuelCode + OperatingConditionCode + BeginDate + BeginHour or UnitStackPipeID + ParameterCode + DefaultPurposeCode + FuelCode + OperatingConditionCode + EndDate + EndHour (if EndDate is not null) |
MonitoringFormulaData | UnitStackPipeID + FormulaID |
MonitoringLoadData | UnitStackPipeID + BeginDate + BeginHour or UnitStackPipeID + EndDate + EndHour (if EndDate is not null) |
MonitoringLocationData | UnitStackPipeID |
MonitoringLocationAttribData | UnitStackPipeID + BeginDate or UnitStackPipeID + EndDate (if EndDate is not null) |
MonitoringMethodData | UnitStackPipeID + ParameterCode + BeginDate + BeginHour or UnitStackPipeID + ParameterCode + EndDate + EndHour (if EndDate is not null) |
MonitoringPlanCommentData | MonitoringPlanComment + BeginDate or MonitoringPlanComment + EndDate (if EndDate is not null) |
MonitoringQualificationData | UnitStackPipeID + QualificationTypeCode + BeginDate or UnitStackPipeID + QualificationTypeCode + EndDate (if EndDate is not null) |
MonitoringQualLMEData | UnitStackPipeID + QualificationTypeCode + QualificationDataYear |
MonitoringQualPercentData | UnitStackPipeID + QualificationTypeCode + QualificationYear |
MonitoringSpanData | UnitStackPipeID + ComponentTypeCode + SpanScaleCode + BeginDate + BeginHour or UnitStackPipeID + ComponentTypeCode + SpanScaleCode + EndDate + EndHour (if EndDate is not null) |
MonitoringSystemData | UnitStackPipeID + MonitoringSystemID |
MonitoringSystemComponentData | UnitStackPipeID + MonitoringSystemID + ComponentID |
MonitoringSystemFuelFlowData | UnitStackPipeID + MonitoringSystemID + BeginDate + BeginHour or UnitStackPipeID + MonitoringSystemID + EndDate + EndHour (if EndDate is not null) |
RectangularDuctWAFData | UnitStackPipeID + BeginDate + BeginHour or UnitStackPipeID + EndDate + EndHour (if EndDate is not null) |
StackPipeData | StackPipeID |
UnitData | UnitID |
UnitCapacityData | UnitID + BeginDate or UnitID + EndDate (if EndDate is not null) |
UnitControlData | UnitID + ParameterCode + ControlCode + InstallDate or UnitID + ParameterCode + ControlCode + RetireDate (if RetireDate is not null) |
UnitFuelData | UnitID + FuelCode + BeginDate or UnitID + FuelCode + EndDate (if EndDate is not null) |
UnitStackConfigurationData | StackPipeID + UnitID |
Labels: Importing Data