KbmMemTable Unique index

Home Forums kbmMemTable KbmMemTable Unique index

  • This topic has 2 replies, 2 voices, and was last updated 3 months ago by lettumika.
Viewing 2 reply threads
  • 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 months ago by lettumika.
Viewing 2 reply threads
  • You must be logged in to reply to this topic.
Skip to toolbar