Published on InterSystems Developer Community (https://community.intersystems.com)

Home > %ClearTable of Ens.Util.LookupTable class is deleting the entire table

Question
Ravi Akkiraju · May 9, 2021

%ClearTable of Ens.Util.LookupTable class is deleting the entire table

As per the documentation, this is supposed to delete the contents of the lookup table, but it is deleting the table as well.

https://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?...

Delete the contents of the lookup table pTable.

Purpose: I need to use a temporary Data lookup table within a DTL for repetition count of a key field. 

Steps:

Initialize - s tmpTable = ##class(Ens.Util.LookupTable).%New()

Lookup & add new entries - 

..Lookup("myTempTable",sThisPhone)

s % = tmpTable.%UpdateValue("myTempTable",sThisPhone,(iCount+1),1)

ClearTable:

d tmpTable.%ClearTable("myTempTable")

Either i need a method to create a temp table on the fly so that it can be deleted or just clear the entires. 

really appreciate your help and input in steering me in the right direction.

Thank you,

Ravi
 

#InterSystems IRIS
Product version: IRIS 2019.1
$ZV: IRIS 2019.1

Source URL:https://community.intersystems.com/post/cleartable-ensutillookuptable-class-deleting-entire-table