Question
· Aug 18, 2017

%Dictionary.StorageSQLMapDefinition

I want to manipulate all the objects whose type is%Dictionary.StorageSQLMapDefinition by %OpenId

However, I don't know the exact id to feed into %OpenId, is there a way to query all the existing ids of %Dictionary.StorageSQLMapDefinition in a namespace?

Thanks.

Discussion (3)0
Log in or sign up to continue

ID value contains all pieces of the primary key separated by ||. In the case of %Dictionary.StorageSQLMapDefinition it's:

Class||Storage||SQLMapName

So to open %Dictionary.StorageSQLMapDefinition you need to either construct an ID like this:

Set Class = "%CSP.Util.Performance"
Set Storage = "CspPerformance"
Set SQLMapName = "Map1"
Set Id = $LTS($LB(Class, Storage, SQLMapName), "||")
Set Obj = ##class(%Dictionary.StorageSQLMapDefinition).%OpenId(Id)

Alternatively you can use Open method for IDKEY index (more on auto-generated methods for indices, properties etc.):

Set Obj = ##class(%Dictionary.StorageSQLMapDefinition).IDKEYOpen(Class, Storage, SQLMapName)