Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [Ens] >  [Util] >  [LookupTable]
Private  Storage   

persistent class Ens.Util.LookupTable extends %Persistent, %XML.Adaptor

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.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
2 3 11 1 1 2


Summary

Properties
DataValue KeyName TableName

Methods
%AddToSaveSet %AddToSyncSet %CheckConstraints %CheckConstraintsForExtent
%ClassIsLatestVersion %ClassName %ClearTable %ComposeOid
%ConstructClone %Delete %DeleteExtent %DeleteId
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Exists
%ExistsId %ExistsTable %Export %Extends
%GUID %GUIDSet %GetLock %GetParameter
%GetSwizzleObject %Id %Import %IsA
%IsModified %IsNull %KillExtent %LockExtent
%LockId %New %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDetermineClass
%Open %OpenId %OriginalNamespace %PackageName
%PurgeIndices %Reload %RemoveFromSaveSet %RemoveValue
%ResolveConcurrencyConflict %RollBack %Save %SaveDirect
%SerializeObject %SetModified %SortBegin %SortEnd
%SyncObjectIn %SyncTransport %UnlockExtent %UnlockId
%UpdateValue %ValidateIndices %ValidateObject EnumerateClose
EnumerateExecute EnumerateFetch XMLDTD XMLExport
XMLExportToStream XMLExportToString XMLNew XMLSchema
XMLSchemaNamespace XMLSchemaType


Parameters

• parameter XMLIGNORENULL = 1;
Prevent any differentiation between "" and NULL in XML import and export.
• parameter XMLNAME = "entry";
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 KeyName as %String(MAXLEN=255,XMLNAME="key",XMLPROJECTION="attribute") [ Required ];
Key for entry within the lookup table.
• property TableName as %String(MAXLEN=255,XMLNAME="table",XMLPROJECTION="attribute") [ Required ];
Name of the lookup table.

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

Indices

•index (IDKEY on TableName,KeyName) [IdKey];

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.


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.