Using Delta on Lazarus

Home Forums kbmMemTable Using Delta on Lazarus

Viewing 2 reply threads
  • Author
    Posts
    • #56900
      andersonvieirafiori
      Participant

      Hello.
      I’m doing some tests with kbmmemtable in lazarus and I would like to know how to use Delta.

      Ex:
      KbmMemtable1.UpdateStatus := usIntserted;
      then all items inserted after commit will be listed
      KbmMemtable1.UpdateStatus := usUpdated;
      list updated items
      KbmMemtable1.UpdateStatus := usDeleted;
      List deleted items
      KbmMemtable1.UpdateStatus := usAll;
      Lists all actual items in the table;

      Thank you very much

    • #56929
      kimbomadsen
      Keymaster

      Hi,

       

      Check this whitepaper. It have lots of goodies, including what you are asking for.

      Click to access Tips%20and%20tricks%20with%20kbmMemTable.pdf

      /Kim

    • #56956
      andersonvieirafiori
      Participant

      Hi Kim

      I analyzed the document, I managed to make the partial operation, only the usDeletede that did not work, I could not understand at what moment I should add the index with the UpdateStatus that is mentioned in the excerpt
      “You can check the state of a record by checking the UpdateStatus property. It returns the current records state.
      Was it inserted (usInserted), deleted (usDeleted), modified (usModified) and unchanged (usUnmodified). I’m
      actually see usDeleted marked records, it require adding and switching to a special index that allows for
      showing deleted records… check the overloaded version of AddIndex which accepts providing a set of
      UpdateStatus flags, for which records to include in the index.”

      Where should I insert the index?
      When populating the table, or when creating the table?
      Thanks

      • #56994
        kimbomadsen
        Keymaster

        Hi,

        At any point in time you want to.
        And remember to switch to it, then your deleted records will show up too.

        Example from the Win32 demo:

        // Define special index for deleted records (index must include at least one field name to index on, in this case PERIOD)
        kbmMemTable1.AddIndex2(‘deleted’,’PERIOD’,[],[usDeleted]);
        kbmMemTable1.IndexName:=’deleted’;

        /Kim

Viewing 2 reply threads
  • You must be logged in to reply to this topic.