Written by

Question Glenda Anaya · Dec 19, 2019

Insert KeyName, DataValue in existing Lookup.Table via DTL transformation

Hi,

Is there a way to insert new Key/Value in an existing  lookup Table via a DTL code?  The only thing I found in the documentation is that we could use the following command SELECT KeyName,DataValue FROM Ens_Util.LookupTable WHERE TableName = 'myTab'. In the meantime I just created a table and  used it in my DTL to insert new values and validate if the Key exist.

Regards

Comments

Andrew Thompson · Dec 20, 2019

You can use ClassMethod ##class(Ens.Util.Lookup).UpdateValue(pTableName As %String = "", pKeyName As %String = "", pNewValue As %String = "", pCreate As %Boolean = 1)

This will 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

0
Patty Aguirre-Romero · Jan 11, 2023

Hi Glenda,

How do you set up a table in a DTL to insert new values? I created a table but, haven't been able to call it in the DTL to replace values coming from the source. 

Thank you!

0