[dbo].[writeObjectEvent] stored procedure
- Last UpdatedJun 20, 2025
- 4 minute read
The stored procedure, writeObjectEvent, is used to input event or alarm data for an object into the EFM database. Any data that is incomplete or invalid will be moved to the rejected reading tables (sys_EventRejected) for the user to evaluate. It is possible to view the already processed data in the Event Summary or Event Log from within the AVEVA Measurement Advisor client.
|
Internal Field (Parameter) Name |
Field req'd? |
Data Type (alias, SQL data type) |
Description |
|---|---|---|---|
|
@objectId |
N |
T_tagIDType, int |
The ID number associated with the object. Either the @objectId or @objectName parameter must be provided. Use the @objectName when looking up the object by the organization (@orgName) |
|
@time |
Y |
T_GMTtime, int |
The time in seconds from Jan 1, 1970 in Greenwich Mean Time (GMT). |
|
@msec |
Y |
T_intType, int |
Milliseconds (@msec) associated with @time. Can be used to order events that have the same @time value. |
|
@deviceOffset |
Y |
T_GMToffset, smallint |
The device 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 device. This must be specified if the @time value is passed in. |
|
@hostOffset |
Y |
T_GMToffset, smallint |
Note: This parameter is no longer used. |
|
@eventType |
Y |
T_nameType, nvarchar(32) |
The type of event. The value will be checked against the column eventTypeName in the eventTypeDesc table. If the eventTypeName is not found, the event data will be rejected. |
|
@message |
Y |
T_messageType, nvarchar(255) |
The message describing the event. |
|
@userName |
Y |
T_nameType, nvarchar(32) |
The name of the user or system that is submitting the event data. |
|
@eventSeverityName |
Y |
T_nameType, nvarchar(32) |
The severity of the event. The value will be checked against the column eventSeverityName in the eventSeverityDesc table. If the eventSeverityName is not found, the event data will be rejected. |
|
@datasetId |
N |
T_tagIDType, int |
The @datasetId configured for the object. The @datasetId will get set to the dataset configured for the object. Note: This parameter is no longer used. |
|
@ownSysId |
N |
T_tagIDType, int |
This is set to the CD_OWNSYSID of the system on which the procedure is run. It is recommended that you do not provide a value for this entry, and let the system set the value. Note:This parameter is no longer used. |
|
@localTime |
N |
T_nameType, nvarchar(32) |
Either the @localTime or @time parameters must be provided. In order to use @localTime, @time must be set to null. 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:
|
|
@objectName |
N |
T_nameType, nvarchar(32) |
The @objectName is the name of the object. This value will be checked against the objectName in the objectDefine table. If the system has the CD_CONTACT module enabled and the @orgName is provided, the system will consider the @objectName 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 objectName is 'FHILLS01'. The system will use this to look up that the internal name is '12345-01'. The 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 the type specified by @objectTypeName. If @objectTypeName is not provided, the objectOrgAlias table will be checked for objects of type Meter or Gas Quality. If the @objectName is not found, the event data will be rejected. |
|
@orgName |
N |
T_nameType, nvarchar(32) |
The @orgName will be compared to the column organizationName in the organizationDefine table. The @orgName is used when looking up the object alias. If the object alias is not found, the event data will be rejected. |
|
@objectTypeName |
N |
T_nameType, nvarchar(32) |
Name of the object type. If this is not provided, it is assumed that this object is a meter. |
|
@newValue |
N |
T_doublePrecisionType, float |
Used for alarms and events sent by external systems. The updated numeric value after an event or alarm occurred. |
|
@oldValue |
N |
T_doublePrecisionType, float |
Used for alarms and events sent by external systems. The original numeric value before an event or alarm occurred. |
|
@newValueText |
N |
T_descType, nvarchar(128) |
Used for alarms and events sent by external systems. The updated string value after an event or alarm occurred. |
|
@oldValueText |
N |
T_descType, nvarchar(128) |
Used for alarms and events sent by external systems. The original string value before an event or alarm occurred. |
|
@eventCodeDescription |
N |
T_descType, nvarchar(128) |
Used for alarms and events sent by external systems. A description of what type of alarm or event was triggered. Most are self-explanatory and match whatever problematic data was sent (for example, "Temperature" or "BasePressure"). Some other sample general code descriptions:
|