Reading out Data Model definitions
Reading out the Data Model definition can be used to verify what data models do exist and what items and levels are defined. This is most useful, when creating a new data model or wanting to modify an existing data model.
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
Litmus does provide such as custom solution which can be downloaded from our Central Portal.
Run SELECT query with Function PROREC_ProRec_GetHierarchy as FROM clause.
Data Models are a hierarchy used to organize and relate Production Record Event data according to ISA-88 rules.
Variable name | Datatype | Description | Example |
---|---|---|---|
@NodeName | VARCHAR(50) | The name of a root Node of a specific data model. If no specific NodeName is to be queried or to get a list of NodeName's, the value can also be DEFAULT which will assume the value %. | DownTime DEFAULT |
To read out all or a specific data model definition, execute a SELECT statement from the function PROREC_ProRec_GetHierarchy providing all the required inputs. Below is an example using T-SQL in SQL Server Management Studio:
The function returns a table as result.
It is possible to reduce the number of columns returned by the SELECT statement. Below is an example using T-SQL in SQL Server Management Studio:
This will reduce the number of columns returned to only the four selected.
It is possible to sort data based on users requirements returned by the SELECT statement. Below is an example using T-SQL in SQL Server Management Studio:
The result will be a table, where all rows are sorted by their Item Name in ascending order.