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

Home > How to add the case insensitive index to a class?

Question
Evgeny Shvarov · Feb 25, 2017

How to add the case insensitive index to a class?

Hi!

Consider I have a class Package.Data with Property UniqueStringValue as %String.

I introduced the Index for this property:

 Index ValueIndex on UniqueStringValue [Unique];

It works well.  But if I try to check if there is an object with the certain value in code like this:

if ##class(Package.Data).ValueIndexExists(value)  

this expression fails, if value="value", even if there is an instance with instance.UniqueStingValue="Value"

How can I set the index to prevent saving case sensitive values in this class?

#Indexing #Object Data Model #ObjectScript #Caché

Source URL:https://community.intersystems.com/post/how-add-case-insensitive-index-class