- This topic has 2 replies, 2 voices, and was last updated 4 years, 6 months ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › kbmMemTable › KbmMemTable Unique index
Hi,
I’d like to create unique index for kbmmemtable.
I have tried CustomerMemTable.IndexFieldNames := ‘CustID:U’
or
CustomerMemTable.IndexDefs.Add(CustId’,’CustId’,[ixPrimary,ixUnique]);
It works so that insert fails but there is no error generated . also no error is generated when index is modified to unique (only other non unique record disappears)
What i’m missing here?
Thanks
MIka
kbmMemTable will raise EMemTableDupKey exception in case a unique index violation is about to happen. Are you sure you have not trapped the error, or in your IDE ignored showing the exception?
I have been working with other subjects but returned to this now.
I found the following:
IndexFieldNames := ‘Field:U’ doesn’t work
but IndexDefs.Add(CustId’,’CustId’,[ixPrimary,ixUnique]); works when done if table if opened after that (of course)