Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Measurement Advisor

[dbo]​.[writeObjectEventByName] stored procedure

  • Last UpdatedJun 20, 2025
  • 4 minute read

The stored procedure writeObjectEventByName is used to input event or alarm data for an object into the EFM database. It is a wrapper to the writeObjectEvent stored procedure. As the writeObjectEventByName procedure does not allow specifying the object type, use the writeObjectEvent if your system uses the same name for a meter and a gas quality.

Note: writeObjectEventByName has been deprecated and should not be used.

Internal Field (Parameter) Name

Field req'd?

Data Type (alias, SQL data type)

Description

@objectName

Y

T_nameType, nvarchar(32)

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 objectName will be checked against the aliasName column in the objectOrgAlias table for objects of type Meter or Gas Quality. If the @objectName is not found, the event data will be rejected.

When an @objectName is given without an @objectType (as in how it is used in this stored procedure) it behaves as follows:

  • If the organization name is given, it will try to find either a meter or gas quality record that matches the @objectName that was provided. As there is no ordering done on this, the @objectID that is used could be either the meter or gas quality record, if they have the same name. There is no guarantee which one will be used.

  • If the @organizationName is not given, it will assume it is a meter.

@orgName

Y

T_nameType, nvarchar(32)

The name of the organization. It 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.

@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

The host 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 host.

Note: This has been deprecated.

@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 made the submission.

@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.

@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:

  • '2/22/2021 5AM', '%m/%d/%Y %I'

  • '2/22/21 17:32', '%m/%d/%y %R'

  • '22/2/01 17:00:00', '%d/%m/%y %T'

  • '21/02/22 7:32', '%y/%m/%d %R'

  • '21/02/22 7:32', '%Y/%m/%d %R'

@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 updated string value after 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:

  • "General Event"

  • "Invalid Value"

  • "Unknown Value"

TitleResults for “How to create a CRG?”Also Available in