Skip to main content

Ens.Util.LookupTable

persistent class Ens.Util.LookupTable extends %Library.Persistent, %XML.Adaptor [ Final ]

SQL Table Name: Ens_Util.LookupTable

This class wraps the ^Ens.LookupTable class used by the DTL/BusinessRule Lookup function.
This provides a convenient way to import, export or manipulate lookup data.

Property Inventory

Method Inventory

Parameters

parameter XMLIGNORENULL = 1;
Prevent any differentiation between "" and NULL in XML import and export.
parameter XMLNAME = entry;
Inherited description: This parameter provides the default XMLNAME for the class. If it is empty then the class name will be used to construct a default XML name. The default XMLNAME is used as the top level tag when exporting objects and the export context did not provide an XML container name.

Properties

property DataValue as %String (MAXLEN = 32000, XMLPROJECTION = "content");
Value associated with this key in the lookup table.
Property methods: DataValueDisplayToLogical(), DataValueGet(), DataValueIsValid(), DataValueLogicalToDisplay(), DataValueLogicalToOdbc(), DataValueNormalize(), DataValueSet()
property KeyName as %String (MAXLEN = 255, XMLNAME = "key", XMLPROJECTION = "attribute") [ Required ];
Key for entry within the lookup table.
Property methods: KeyNameDisplayToLogical(), KeyNameGet(), KeyNameIsValid(), KeyNameLogicalToDisplay(), KeyNameLogicalToOdbc(), KeyNameNormalize(), KeyNameSet()
property TableName as %String (MAXLEN = 255, XMLNAME = "table", XMLPROJECTION = "attribute") [ Required ];
Name of the lookup table.
Property methods: TableNameDisplayToLogical(), TableNameGet(), TableNameIsValid(), TableNameLogicalToDisplay(), TableNameLogicalToOdbc(), TableNameNormalize(), TableNameSet()

Methods

classmethod %ClearTable(pTable As %String)
Delete the contents of the lookup table pTable.
classmethod %ExistsTable(pTable As %String, pCaseInsensitive As %Boolean = 0, pCurrent As %String = "", Output pMatch As %String = "") as %Boolean
Does table pTable exist? If pCaseInsensitive is 1, this will return true for case-insenstive matches too and pMatch will be the matching value.
classmethod %Export(pFileName As %String = "", pTableName As %String = "") as %Status
Export lookup table data to file pFileName. If pTableName is provided, then only export that table.
Note that the resulting XML file is in legacy format, which is not compatible with Studio.
classmethod %Import(pFileName As %String = "", pForceTableName As %String = "", Output pCount As %Integer) as %Status
Import lookup table data from the xml file pFileName.
Lookup data is in the form:
<lookupTable>
<entry table="TableName" key="KeyName">DataValue</entry>
</lookupTable>
Note that this is legacy format, which is not compatible with Studio.
classmethod %RemoveValue(pTableName As %String = "", pKeyName As %String = "") as %Status
Remove the lookup value for the supplied TableName and KeyName.
classmethod %UpdateValue(pTableName As %String = "", pKeyName As %String = "", pNewValue As %String = "", pCreate As %Boolean = 1) as %Status
Update the value of an existing entry with the supplied TableName and KeyName. If pCreate is true, then the entry will be created if it doesn't already exist.
classmethod EnumerateClose(ByRef qHandle As %Binary) as %Status
classmethod EnumerateExecute(ByRef qHandle As %Binary) as %Status
classmethod EnumerateFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status

Queries

query Enumerate()
Selects Name As %String
List the existing Lookup tables

Indexes

index (IDKEY on TableName,KeyName) [IdKey, Type = key];
Index methods: IDKEYCheck(), IDKEYDelete(), IDKEYExists(), IDKEYOpen(), IDKEYSQLCheckUnique(), IDKEYSQLExists(), IDKEYSQLFindPKeyByConstraint(), IDKEYSQLFindRowIDByConstraint()

Triggers

trigger OnDelete (AFTER event DELETE);
Update the timestamp whenever a row is removed from a table. If there are no entries, then remove the timestamp node.
trigger OnModify (AFTER event INSERT/UPDATE);
Update the timestamp for the table whenever an entry is added or updated.

Inherited Members

Inherited Methods

Storage

Storage Model: SQLStorage

Maps: 1

  • Map number 1 is named Map1

    thismap.Global: ^Ens.LookupTable

  • ^Ens.LookupTable({TableName},{KeyName})
    =
    Node Delimiter Piece Name
    DataValue
FeedbackOpens in a new tab