KbmMemTable Unique index

Home Forums kbmMemTable KbmMemTable Unique index

This topic contains 2 replies, has 2 voices, and was last updated by  lettumika 3 weeks, 3 days ago.

  • Author
    Posts
  • #54188

    lettumika
    Participant

    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

  • #54192

    kimbomadsen
    Keymaster

    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?

  • #54233

    lettumika
    Participant

    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)

     

    • This reply was modified 3 weeks, 3 days ago by  lettumika.

You must be logged in to reply to this topic.