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

Home > Indexing null value

Question
Alexandr Ladoshkin · Nov 23, 2017

Indexing null value

Dear community!

I have problem with index NULL value.  Unique index doesn't work for this case.  If I use insert and one of parameter is "NULL". Message of constraint doesn't appear and row is inserted into table successfully.  How Can I use index with NULL?

Class TestClassIndx Extends %Persistent
{

Property name As %String [ Private ];

Property age As %String [ Private ];

Property country As %String [ Private ];

Index IndextestUniq On (name, age, country) [ Unique ];

}

INSERT INTO TestClassIndx (name,age,country) VALUES ('1','2',NULL)

Best Regards 

#Caché #Indexing

Source URL:https://community.intersystems.com/post/indexing-null-value