Re: how do I delete 1 of 2 identical records?

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 55121
interpreted = N
texte = Have you tried it lately, Grant? In a quick test, the max=1 was ignored - all matching records were deleted. I ran this code under the latest OSX version: ----- [table name=bob&fields=one,two,three][/table] [append table=bob]one=a&two=x&three=red[/append] [append table=bob]one=b&two=x&three=orange[/append] [append table=bob]one=b&two=y&three=yellow[/append] [append table=bob]one=b&two=y&three=green[/append] [append table=bob]one=c&two=z&three=blue[/append] [append table=bob]one=d&two=z&three=indigo[/append] [append table=bob]one=e&two=z&three=violet[/append] Before:
[search table=bob&neonedatarq=bogus&rank=off][founditems][one] - [two] - [three]
[/founditems][/search] [delete table=bob&eqonedatarq=b&max=1&rank=off]
After:
[search table=bob&neonedatarq=bogus&rank=off][founditems][one] - [two] - [three]
[/founditems][/search] ----- And got these results: ----- Before: a - x - red b - x - orange b - y - yellow b - y - green c - z - blue d - z - indigo e - z - violet After: a - x - red c - z - blue d - z - indigo e - z - violet ----- Clearly, the max=1 did not take affect here - all records with field "one" equal to "b" were deleted. I know I've been avoiding the reliance on "max=1" for deletes and replaces for years - probably since version 2.x - because my tests indicated it wasn't effective. Not to argue with a founding author, but it has been my experience that you can't do this, and nobody should try it, since it can wipe out much more than intended, unless they have thoroughly tested it in a safe environment and verified that it will do what they intend. - brian On Dec 29, 2003, at 10:31 AM, Grant Hulbert wrote: >> can you [delete db=/db/products.db&eqSKUdatarq=1234&max=1]? > > Yes, that is the recommended way of doing it. Any valid [Search] > parameters are allowed, which means max=1 will be used appropriately. > -- > _______________________________________________________________________ > ________ > Grant Hulbert | Internet Software Architect | > http://www.hulbertfamily.com/ > -- Brian Fries, BrainScan Software -- http://www.brainscansoftware.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: how do I delete 1 of 2 identical records? ( Kenneth Grome 2003)
  2. Re: how do I delete 1 of 2 identical records? ( Brian Fries 2003)
  3. Re: how do I delete 1 of 2 identical records? ( Grant Hulbert 2003)
  4. Re: how do I delete 1 of 2 identical records? ( "Andrew Simpson" 2003)
  5. Re: how do I delete 1 of 2 identical records? ( Kenneth Grome 2003)
  6. Re: how do I delete 1 of 2 identical records? ( Brian Fries 2003)
  7. Re: how do I delete 1 of 2 identical records? ( "Matthew Bohne" 2003)
  8. Re: how do I delete 1 of 2 identical records? ( Kenneth Grome 2003)
  9. Re: how do I delete 1 of 2 identical records? ( "Andrew Simpson" 2003)
  10. Re: how do I delete 1 of 2 identical records? ( Kenneth Grome 2003)
  11. Re: how do I delete 1 of 2 identical records? ( Gary Krockover 2003)
  12. how do I delete 1 of 2 identical records? ( CN Stuff 2003)
Have you tried it lately, Grant? In a quick test, the max=1 was ignored - all matching records were deleted. I ran this code under the latest OSX version: ----- [table name=bob&fields=one,two,three][/table] [append table=bob]one=a&two=x&three=red[/append] [append table=bob]one=b&two=x&three=orange[/append] [append table=bob]one=b&two=y&three=yellow[/append] [append table=bob]one=b&two=y&three=green[/append] [append table=bob]one=c&two=z&three=blue[/append] [append table=bob]one=d&two=z&three=indigo[/append] [append table=bob]one=e&two=z&three=violet[/append] Before:
[search table=bob&neonedatarq=bogus&rank=off][founditems][one] - [two] - [three]
[/founditems][/search] [delete table=bob&eqonedatarq=b&max=1&rank=off]
After:
[search table=bob&neonedatarq=bogus&rank=off][founditems][one] - [two] - [three]
[/founditems][/search] ----- And got these results: ----- Before: a - x - red b - x - orange b - y - yellow b - y - green c - z - blue d - z - indigo e - z - violet After: a - x - red c - z - blue d - z - indigo e - z - violet ----- Clearly, the max=1 did not take affect here - all records with field "one" equal to "b" were deleted. I know I've been avoiding the reliance on "max=1" for deletes and replaces for years - probably since version 2.x - because my tests indicated it wasn't effective. Not to argue with a founding author, but it has been my experience that you can't do this, and nobody should try it, since it can wipe out much more than intended, unless they have thoroughly tested it in a safe environment and verified that it will do what they intend. - brian On Dec 29, 2003, at 10:31 AM, Grant Hulbert wrote: >> can you [delete db=/db/products.db&eqSKUdatarq=1234&max=1]? > > Yes, that is the recommended way of doing it. Any valid [search] > parameters are allowed, which means max=1 will be used appropriately. > -- > _______________________________________________________________________ > ________ > Grant Hulbert | Internet Software Architect | > http://www.hulbertfamily.com/ > -- Brian Fries, BrainScan Software -- http://www.brainscansoftware.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/ Brian Fries

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:

Append..... doesn't (2000) Secure server question (1997) Some Questions (1997) Help! WebCat2 bug (1997) [defined]ish (1997) WCS Newbie question (1997) WebCat2 - Getting to the browser's username/password data (1997) Sorting LISTFILES (1997) Mauthcapture vs mauthonly (2002) WebCat editing, SiteGuard & SiteEdit (1997) Weird Math and SV (1997) [input] questions (1997) [redirect] not working on NT? (1999) Exclamation point (1997) Redirect (2000) WebCatalog seems to choke on large (2meg) html files. (1998) Locking up with WebCatalog... (1997) WebCatalog [FoundItems] Problem - LONG - (1997) users.db (1999) For those of you not on the WebCatalog Beta... (1997)