Re: Every other record deleted

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 63668
interpreted = N
texte = So the answer is to delete in reverse order.. Works for me after falling into the trap that Brian has just described. Stuart Tremain idfk web developments, sydney, australia On 23 Dec 2005, at 12:38 PM, Brian Fries wrote: > The typical cause of an every-other deletion is doing a deletion > inside a founditems loop. As soon as you delete a record, the > indexes of the founditems set have been changed so the next > iteration of the loop ends up skipping a record. The same thing > occurse with deletefile inside a listfiles loop. > > As an illustration, say you've found 10 records. On the fourth pass > through the loop, you've got index=4. You delete that record. Now > the records that were indexed 5-10 get relabeled (by WebDNA) as > 4-9. On the next pass through the loop, you've got index=5 - but > this is the new index 5, the old index 6. You've skipped the old > 5th record. > > This is considered a "behavior" of WebDNA rather than a "bug". It's > just something you've got to deal with by never deleting within a > [founditems] loop. What I typically do to get around this is to > build a list of records (generally their SKU field or equivalent) > that I need to delete. Then, after exiting the loop, I delete all > the records I need to delete at once. > > Brian Fries > BrainScan Software > > > On Dec 22, 2005, at 7:41 AM, Dan Strong wrote: > >> I have a database that has had every *other* record wiped clean >> (tabs still there, just every field in those records wiped clean). >> This database/system has been chugging along fine for 2+ years... >> anybody ever seen something similar? >> >> -Dan >> > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Every other record deleted ( Donovan Brooke 2005)
  2. Re: Every other record deleted ( Peter Ostry 2005)
  3. Re: Every other record deleted ( Grant Hulbert 2005)
  4. Re: Every other record deleted ( Stuart Tremain 2005)
  5. Re: Every other record deleted ( Brian Fries 2005)
  6. Re: Every other record deleted ( Jesse Proudman 2005)
  7. Re: Every other record deleted ( Jesse Proudman 2005)
  8. Re: Every other record deleted ( "Dan Strong" 2005)
  9. Re: Every other record deleted ( Donovan Brooke 2005)
  10. Re: Every other record deleted ( "Dan Strong" 2005)
  11. Re: Every other record deleted ( Donovan Brooke 2005)
  12. Re: Every other record deleted ( "Dan Strong" 2005)
  13. Re: Every other record deleted ( "Eric Miller" 2005)
  14. Every other record deleted ( "Dan Strong" 2005)
So the answer is to delete in reverse order.. Works for me after falling into the trap that Brian has just described. Stuart Tremain idfk web developments, sydney, australia On 23 Dec 2005, at 12:38 PM, Brian Fries wrote: > The typical cause of an every-other deletion is doing a deletion > inside a founditems loop. As soon as you delete a record, the > indexes of the founditems set have been changed so the next > iteration of the loop ends up skipping a record. The same thing > occurse with deletefile inside a listfiles loop. > > As an illustration, say you've found 10 records. On the fourth pass > through the loop, you've got index=4. You delete that record. Now > the records that were indexed 5-10 get relabeled (by WebDNA) as > 4-9. On the next pass through the loop, you've got index=5 - but > this is the new index 5, the old index 6. You've skipped the old > 5th record. > > This is considered a "behavior" of WebDNA rather than a "bug". It's > just something you've got to deal with by never deleting within a > [founditems] loop. What I typically do to get around this is to > build a list of records (generally their SKU field or equivalent) > that I need to delete. Then, after exiting the loop, I delete all > the records I need to delete at once. > > Brian Fries > BrainScan Software > > > On Dec 22, 2005, at 7:41 AM, Dan Strong wrote: > >> I have a database that has had every *other* record wiped clean >> (tabs still there, just every field in those records wiped clean). >> This database/system has been chugging along fine for 2+ years... >> anybody ever seen something similar? >> >> -Dan >> > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Stuart Tremain

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

2.0 Info (1997) Database Fields (1997) Extra carriage returns (1999) database problems (1999) Help with Repost Data msg from form (1997) Reversing [ipaddress] normalization (1998) OT-JS why it does not run on Mac (2001) WebCat2b15MacPlugIn - [authenticate] not [protect] (1997) Press Release hit the NewsWire!!! (1997) Cookies and WebCat?? (1999) WC2/Mac -- Forms not submitting correctly with Mac browsers (1997) Converting characters to numbers ... (1997) [WebDNA] TCPconnect and Bitcoin rate (2017) [WebDNA] [listwords] and [index] (2009) California Tax Rates (1998) Running _every_ page through WebCat ? (1997) What am I missing (1997) rename a file (1997) comparison looking for unitialized var shows webcat bug? (2000) Frames and WebCat (1997)