Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...

Deleting an Event definition

9min

Use Cases

Litmus Production Record Database is capable of monitoring tag data for production events and then record these events.

This does require to setup and manage these event definitions, which does include the deletion of entire event definitions, or parts of an event definition.

User can do this either by using applications such as:

  • Microsoft SQL Server Management Studio
  • MSSQL CLI

This can also be used for building custom solutions based on applications which allow for an ODBC connection such as:

  • Excel
  • C#
  • .Net
  • Python

Method

Execute Stored Procedure PROREC_Event_ManageEventConfiguration

Note

Do learn more about the event monitoring concept and how to define it, please read the document

Input Variables

Variable name

Datatype

Description

Example

@Action

INTEGER

A numeric representation of a specific action which can be performed.



Possible Values:

  • 1 = Show all Event Configurations to know their ID
  • 2 = Delete a specific event by its ID (this will delete all related triggers and items)
  • 3 = Delete a specific trigger by its ID (this will also all items related to the trigger)
  • 4 = Delete a specific Item by ID

Mandatory!

Can not be NULL or Empty

1





@Identifier

BIGINT

The ID of an event, trigger or item.



Can not be null for the actions 2,3 or 4

NULL

How to use

To Delete an event definition, trigger or item, call the stored procedure PROREC_Event_ManageEventConfiguration using the T-SQL EXEC or EXECUTE keyword and provide the Input variables. Below is an example using T-SQL in SQL Server Management Studio:

Read out all events and their ID

EXECUTE [LE_ProductionRecord].[dbo].[PROREC_Event_ManageEventConfiguration] @Action = 1, @Identifier = NULL;

Delete an entire event definiton.

EXECUTE [LE_ProductionRecord].[dbo].[PROREC_Event_ManageEventConfiguration] @Action = 2, @Identifier = 3;

Delete a trigger.

EXECUTE [LE_ProductionRecord].[dbo].[PROREC_Event_ManageEventConfiguration] @Action = 3, @Identifier = 2;

Delete an item.

EXECUTE [LE_ProductionRecord].[dbo].[PROREC_Event_ManageEventConfiguration] @Action = 4, @Identifier = 2;

Result

The function returns for Action 1 a table as result. The first three columns provide the ID's which are to be used with the other actions.

  • For Action = 2, use the values from column "Event Identifier".
  • For Action = 3, use the values from column "Trigger Identifier".
  • For Action = 4, use the values from column "Item Identifier".
read out event ids
read out event ids


The function will write for the Action 2, 3 and 4 the result can be read back from the log table PROREC_Misc_Log.

Below is an example using T-SQL in SQL Server Management Studio:

SELECT TOP (100) [LogID] ,[LogType] ,[LogProcedure] ,[LogEntry] ,[LogTime] FROM [LE_ProductionRecord].[dbo].[PROREC_Misc_Log] WHERE [LogProcedure] = 'PROREC_Event_ManageEventConfiguration' Order by LogID Desc

With the result returned

delete event
delete event