· May 17

Identity property - CacheSQLStorage


We have recently encountered an issue which requires us to define a new identity field (named xMDA in the attached example), instead of using the default ID field.

We need to run an SQL query which unfortunately overrides the ID field (see attached image) but we still need to be able to access the ID field in said query.

We are however unable to get the attached solution to work. Is there a way to get around this issue?



Class TafnitCore.System.MDA.USER.caghoNybdWE1x0wt0DpyXVMhA5Yx2x2 Extends %Persistent [ ProcedureBlock, StorageStrategy = MainStorage ]

Property xMDA As %Integer [ Identity ];

Property Subscript1 As %String;

Property Subscript2 As %String;

Property Data As %String(MAXLEN = 32000);

Property ZREF As %String [ Calculated, SqlComputeCode = { {*} = ##class(TafnitCore.System.Utils.CacheUtils).getZREF("^[""USER""]ASORT",{ID})}, SqlComputed, Transient ];

Index PMKey On (Subscript1, Subscript2) [ IdKey, PrimaryKey, Unique ];

Storage MainStorage
<SQLMap name="MainMap">
<Data name="Data">
<Subscript name="1">
<Subscript name="2">
} }

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