No announcement yet.

Removing a Table Item when its Index Number is unknown

  • Filter
  • Time
  • Show
Clear All
new posts

  • Removing a Table Item when its Index Number is unknown

    The thread originally started for this topic, here (thanks to my retarded posting without the benefit of an Edit button) became very cluttered and messy. And I wanted to include an important addition to it, without thoroughly confusing everyone with an 'unreadable' mess. So, sorry for the 'double-up' - but hence this new 'old' thread.

    As the thread title (above) suggests, the following example is about removing table items (values) when the index number assigned to it is unknown. But with one important difference. This one is a variation on the previous examples because it demonstrates removal of the table item WITHOUT causing the indices of the remaining table items to shift. It's a subtle difference but an important one, if requiring table items (in regards their index-numbers and associated values) to remain consistent.

    For convenience, have also attached is a zipped-file containing examples from the original (aforementioned) thread. It's just to save people the hassle of 'thread-jumping' back to the original and trying to sort thru the abysmal mess there. (LOL - no EDIT button, IR. Hint!). In fact, just consider that particular thread as now 'defunct'.
    Attached Files

  • #2
    In sqlite long time ago, im still figuring or imagining (thanks by the way for the explanation and lua database functions thanks nice guy! Im put. i left as pending to read all the tuts you suggested, some of them I used so, are familiar to me, as you are talking -dunno if reader in there forum could give an though-) about hole tables when deletes a record in a sqlite table. You mentioned a observation's Rizlauk in the another thread you linked in zip file, the pragma option could not be a solution, then im blank in my mind about how to solve this "issue"....maybe creating a virtual table and insert all records into that just created virtual table and then delete that record and not leaving any hole and finally delete all old data from the db file and reinsert newly....the only problem could be the size, the time to reinserting, and amount of records available originally in that db file they could crash.