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

Home > How to create index inside Array

Question
Ba Moser · Aug 25, 2020

How to create index inside Array

I use these example classes:
Class Sample.Address Extends (%SerialObject, %Populate)
{Property Street As %String;
Property City As %String;
Property State As %String(POPSPEC = "USState()");
Property Zip As %String;}

Class Sample.Person1 Extends (%Persistent, %Populate)
{  Property Name As %String;
Property Home As Sample.Address;
Property AR As array Of Sample.Address; }

In SQL it is Table Sample.Person1

No problem to define INDEX on Home_State

But Table Sample.Person1_AR

HowTo define an INDEX on AR_State ?
Index st On AR.State;

Does not compile!

#ObjectScript #SQL #InterSystems IRIS

Source URL:https://community.intersystems.com/post/how-create-index-inside-array