[dbo].[writeCombinedMtrGQRawXX] stored procedures
- Last UpdatedJul 24, 2025
- 17 minute read
These stored procedures accept both gas quality (GQ) data from a meter and meter/GQ data combined from a meter.
Combined meter and GQ data is separated for processing. The GQ data is written to the GQ raw data queue for the associated granularity. The meter data is written to the meter raw data queue for the associated granularity. There are two granularities -- hourly and daily.
-
For hourly data, the writeCombinedMtrGQRawHy stored procedure is used.
-
For daily data, the writeCombinedMtrGQRawDy stored procedure is used.
When GQ data is sent from a meter, only meter object information is available at that time. The AVEVA Measurement Advisor GQ object that the data is for is determined using the meter name (objName) and the organization name (orgName, if applicable). The GQ will be located based on the connectivity configured in AVEVA Measurement Advisor, using these rules:
-
If the meter is connected to a measured quality (MQ), the data is written to that MQ.
-
If the meter is connected to both a MQ and a zone quality (ZQ), the data is written to the MQ.
-
If the meter is connected to a ZQ only, the data is written to the ZQ (unless the ZQ is connected to other meters which are not also connected to an MQ in which case the data is rejected.)
-
If the GQ object can’t be found based on the meter information, the GQ data will be rejected.
-
If the meter object can’t be found, both the meter and the GQ data will be rejected.
If there are issues identifying the associated meter object for meter data, the data will be moved to the rejected reading tables for you to evaluate. Likewise, if there are issues determining the GQ object associated with a meter, the GQ data will be moved to the rejected reading tables for you to evaluate. To distinguish them from other processing issues, rejected readings are assigned one of the following reasons:
-
"Invalid GQ w.r.t. Meter/Org.": This error indicates that the system was unable to find the GQ point from the supplied meter (Name) and organization (Organization Name).
Note: The meter name and organization name (if specified) are included in the rejected data. You must supply the actual GQ name and delete the orgName before accepting the data for processing.
-
"Potential ZQ Misconfiguration": This error indicates that the meter the GQ data is associated with is connected to only a ZQ and that ZQ is also connected to other meters as the only connected GQ. This a potential misconfiguration as it could result in static GQ data overwriting data from a live chromatograph.
Note: For this error message, the GQ name is placed in the rejected row.
|
Internal Field (Parameter) Name |
Field req'd? |
Data Type (alias, SQL data type) |
Description |
|---|---|---|---|
|
@objName |
Y |
T_nameType, nvarchar(32) |
@objName is the name of the meter. This value will be checked against the meterName in the meterDefine table. If the system has the CD_CONTACT module enabled and the @orgName is provided, the system will consider the @objName to be the externally known name and lookup the name internal to AVEVA Measurement Advisor. For example, the organization 'Big Corp' calls our meter '12345-01' by the name 'FHILLS01'. In this case, the orgName is 'Big Corp' and the objName is 'FHILLS01'. The system will use this to look up that the internal name is '12345-01'. orgName will be compared to the column organizationName in the organizationDefine table. The objName will be checked against the aliasName column in the objectOrgAlias table for objects of type Meter. If the @objName is not found, the meter data will be rejected. |
|
@orgName |
N |
T_nameType, nvarchar(32) |
@orgName will be compared to the column organizationName in the organizationDefine table. The @orgName is used when looking up the meter alias. If the meter alias is not found, the meter data will be rejected. |
|
@localTime |
N |
T_nameType, nvarchar(32) |
Either the @localTime or @time parameters must be provided. If both parameters are provided, the system will use the value of @time. This value should be consistent with the @timeFormat that is used. |
|
@timeFormat |
N |
T_nameType, nvarchar(32) |
A string to let the system know how to interpret the @localTime string. The @timeFormat is the format you have used for the @localTime string. The default is '%m/%d/%Y %T'. Additionally, the following timeFormats are also considered valid:
|
|
@userName |
Y |
T_nameType, nvarchar(32) |
The name of the user or system that is submitting the meter reading. |
|
@editStateName |
N |
T_nameType, nvarchar(32) |
Default is Observed. Options are:
The provided value will be checked against the column editStateName in the editStateDesc table. If the edit state is not found, the meter data will be rejected. |
|
@unitProfileName |
N |
T_nameType, nvarchar(32) |
Default is NULL. If a value is not provided, the system will retrieve the configured Input Unit Profile for the meter (inputProfileId from the meterDefine table). If a value is provided, the value will be checked against the unitProfileName column in the unitProfileDefine table. If the unitProfileName is not found, the meter data will be rejected. |
|
@dqInfoName |
N |
T_nameType, nvarchar(32) |
The value will be checked against the column dqInfoName in the dqInfoDesc table. Options are as follows:
|
|
@validate |
N |
T_booleanType, char(1) |
Default is NULL (gets turned into a Y if NULL). Options are:
|
|
@isSummer |
N |
T_booleanType, char(1) |
This is used when the system is interpreting the localTime when Daylight Saving Time ends and the datetimes during that transition are unclear. For example, during the fall DST change in North America, the 1-2AM time is repeated, this is used to specify which 1AM record it is. Options are:
|
|
@time |
N |
T_GMTtime, int |
The time in seconds from Jan 1, 1970 in Greenwich Mean Time (GMT). If this is configured, localTime, timeFormat and isSummer will be ignored. |
|
@offset |
N |
T_GMToffset, smallint |
The timezone represented in minutes from GMT. For example, Mountain Standard timezone is -420. Mountain Daylight timezone is -360. It is calculated based on the time of the data and the timezone of the meter. |
|
@adjustmentCodeName |
N |
T_nameType, nvarchar(32) |
If an adjustment is made to a previously submitted reading, the source system may choose to include a reason for the adjustment. This value maps to the column adjustmentCodeName in the table adjustmentCodes. If the code doesn't exist in the system, the reading will be sent to the Rejected Readings table with a reason of Invalid Adjustment Code Name. |
|
@volume |
N |
T_doublePrecisionType, float |
The volume of the fluid corrected to standard conditions. The units are defined by the configured Input Unit Profile of the meter if a unit profile is not included as part of the meter reading. |
|
@energy |
N |
T_doublePrecisionType, float |
The amount of energy released if the volume was part of an ideal combustion reaction. The units are defined by the configured Input Unit Profile of the meter if a unit profile is not included as part of the meter reading. |
|
@flowTime |
N |
T_flowTimeType, real |
The amount of time that the commodity (usually gas) was flowing. For an hourly record, the max would be between 0 and 1 hour inclusively. The units are defined by the configured Input Unit Profile of the meter if a unit profile is not included as part of the meter reading. The flowTime will be less than or equal to the runTime. |
|
@pressure |
N |
T_singlePrecisionType, real |
The recorded static or gauge pressure, depending on the Unit Profile. The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading. |
|
@temperature |
N |
T_singlePrecisionType, real |
The recorded temperature. The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading. |
|
@rawValue |
N |
T_doublePrecisionType, float |
The data provided for this value will depend on the type of meter the data is for:
|
|
@intermediateValue |
N |
T_doublePrecisionType, float |
The data provided for this value will depend on the type of meter the data is for:
The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading. |
|
@primaryFactor |
N |
T_doublePrecisionType, float |
The data provided for this value will depend on the type of meter the data is for:
The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading. |
|
@waterVaporFactor |
N |
T_doublePrecisionType, float |
A correction factor to account for gas that is carrying water over a contractually defined limit [usually 7 lbs/MMCF, for wet gas]. How the factor is applied is dependent upon the delivery condition defined in the unit profile and whether the factor has been configured to be applied to the volume or heating value. If this is not specified, it will be calculated according to the Meter Properties. |
|
@volumeAccum |
N |
T_doublePrecisionType, float |
The data provided for this value will depend on the type of meter the data is for:
The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading. |
|
@energyAccum |
N |
T_doublePrecisionType, float |
The data provided for this value will depend on the type of meter the data is for:
The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading. |
|
@miscValue |
N |
T_doublePrecisionType, float |
Miscellaneous value. The data provided for this value will depend on the type of meter the data is for.
The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading. |
|
@runTime |
N |
T_flowTimeType, real |
The total time between the start of the reading and the end of the reading. If the record is a split record, then the runtime is a portion of the period. The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading. |
|
@mass |
N |
T_singlePrecisionType, real |
The mass of the fluid. The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading. If mass is not provided, it will be calculated from the volume and the specific gravity or density of the associated gas quality for gas or liquid respectively. |
|
@hydrocarbonDewpoint |
N |
T_singlePrecisionType, real |
For the static pressure of the meter reading, this is the temperature where hydrocarbon liquids begin to form. The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading. If this is not specified, it will be calculated according to the Telemetry Calculation Policy. |
|
@uncorrVolAccum |
N |
T_singlePrecisionType, real |
The total flowing volume (not corrected to standard conditions) accumulated. This value keeps increasing until the rollover value of the device has been reached. The units are defined by the configured Input Unit Profile of the meter if a unit profile is not included as part of the meter reading. |
|
@rawValueAccum |
N |
T_singlePrecisionType, real |
For a pulse meter, this is the total accumulated pulse counts over time. The value would reset at the meter rollover value. |
|
@heatingValue |
N |
T_singlePrecisionType, real |
The amount of energy released in an ideal combustion reaction per unit of real gas volume. The units are defined by the Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. This is the ideal heating value corrected by the compressibility. |
|
@specificGravity |
N |
T_singlePrecisionType, real |
The ratio of the mass density of the gas to the mass density of dry air calculated on a real basis. Also known as relative density. This is the ideal specific gravity corrected by the compressibility. |
|
@CO2 |
N |
T_singlePrecisionType, real |
The amount of carbon dioxide in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@N2 |
N |
T_singlePrecisionType, real |
The amount of nitrogen in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@H2 |
N |
T_singlePrecisionType, real |
The amount of hydrogen in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@S2 |
N |
T_singlePrecisionType, real |
The amount of sulfur in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@O2 |
N |
T_singlePrecisionType, real |
The amount of oxygen in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@CO |
N |
T_singlePrecisionType, real |
The amount of carbon monoxide in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@Ar |
N |
T_singlePrecisionType, real |
The amount of argon in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@He |
N |
T_singlePrecisionType, real |
The amount of helium in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@H2S |
N |
T_singlePrecisionType, real |
The amount of hydrogen sulfide in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@H2O |
N |
T_singlePrecisionType, real |
The amount of water in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are lbs H2O/MMSCF or kg H2O/E6M3. |
|
@gqWaterVaporFactor |
N |
T_doublePrecisionType, float |
A correction factor to account for gas that is carrying water over a contractually defined limit [usually 7 lbs/MMCF, for wet gas]. How the factor is applied is dependent upon the delivery condition defined in the unit profile and whether the factor has been configured to be applied to the volume or heating value. If this is not specified, it will be calculated according to the Meter Properties. |
|
@C1 |
N |
T_singlePrecisionType, real |
The amount of methane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@C2 |
N |
T_singlePrecisionType, real |
The amount of ethane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@C3 |
N |
T_singlePrecisionType, real |
The amount of propane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@iC4 |
N |
T_singlePrecisionType, real |
The amount of isobutane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are mol fraction or mol %. (this is also known as 2-methylpropane). |
|
@nC4 |
N |
T_singlePrecisionType, real |
The amount of n-butane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@iC5 |
N |
T_singlePrecisionType, real |
The amount of isopentane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are mol fraction or mol %. (This is also known as 2-methylbutane). |
|
@nC5 |
N |
T_singlePrecisionType, real |
The amount of n-pentane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@C6plus |
N |
T_singlePrecisionType, real |
The amount of heavier hydrocarbons in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. The components included in this value depends on the Cx plus Type configured on the gas quality record. For example, C6plus could be C6 and higher, or it could be configured as C7 and higher. If a @C6plus value is not provided with the data, the system will calculate the value from the contributing components based on the Cx Plus Type property setting. See Gas quality tab / Analysis component spreading / Spread Cplus enabled. |
|
@C6 |
N |
T_singlePrecisionType, real |
The amount of hexane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@C7 |
N |
T_singlePrecisionType, real |
The amount of n-heptane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@C8 |
N |
T_singlePrecisionType, real |
The amount of n-octane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@C9 |
N |
T_singlePrecisionType, real |
The amount of n-nonane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@C10 |
N |
T_singlePrecisionType, real |
The amount of n-decane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@dewpoint |
N |
T_singlePrecisionType, real |
The temperature at a given pressure at which the water in the fluid will start to condense into liquid water. |
|
@neoC5 |
N |
T_singlePrecisionType, real |
The amount of neoPentane in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. This is also known as 2,2-dimethylpropane. |
|
@density |
N |
T_singlePrecisionType, real |
This is the density value. |
|
@viscosity |
N |
T_singlePrecisionType, real |
This is the viscosity value. |
|
@BSW |
N |
T_singlePrecisionType, real |
The amount of base sediment and water in the liquid volume. Typically this only applies to crude oil. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typically this is reported as a percentage. |
|
@cricondentherm |
N |
T_singlePrecisionType, real |
The calculated cricondentherm temperature based on the composition of gas. |
|
@totalSulphur |
N |
T_singlePrecisionType, real |
The total amount of sulfur in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@wobbeIndex |
N |
T_singlePrecisionType, real |
The ideal-gas gross Wobbe Index. This is the heating value / sqrt (specificGravity) at internal storage base conditions. Although it has the units of heating value, it is considered unitless. |
|
@ethylene |
N |
T_singlePrecisionType, real |
The amount of ethylene in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the input data. Typical units are mol fraction or mol %. |
|
@propylene |
N |
T_singlePrecisionType, real |
The amount of propylene in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the input data. Typical units are mol fraction or mol %. |
|
@propadiene |
N |
T_singlePrecisionType, real |
The amount of propadiene in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the input data. Typical units are mol fraction or mol %. |
|
@butene |
N |
T_singlePrecisionType, real |
The amount of butene in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile is not included as part of the input data. Typical units are mol fraction or mol %. |
|
@COS |
N |
T_singlePrecisionType, real |
The amount of Carbonyl Sulfide in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@mercaptans |
N |
T_singlePrecisionType, real |
The amount of Mercaptan Sulfur in the fluid. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are ppm. |
|
@superCompressibility |
N |
T_singlePrecisionType, real |
The supercompressibility factor Fpv is used to calculate actual volumes from volumes at standard temperatures and pressures. Supercompressiblity is the square root of the ratio of a base compressibility factor to the operating compressibility factor. |
|
@unnormalizedTotal |
N |
T_doublePrecisionType, float |
The unnormalized total composition from the field. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are mol fraction or mol %. |
|
@moleTotal |
N |
T_singlePrecisionType, real |
The normalized total composition from the field. The units are defined by the configured Input Unit Profile of the gas quality record if a unit profile isn't included as part of the gas analysis. Typical units are mol fraction or mol %. |