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 - redb - x - orangeb - y - yellowb - y - greenc - z - blued - z - indigoe - z - violetAfter:a - x - redc - z - blued - z - indigoe - 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.- brianOn 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:
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 - redb - x - orangeb - y - yellowb - y - greenc - z - blued - z - indigoe - z - violetAfter:a - x - redc - z - blued - z - indigoe - 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.- brianOn 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:
Problem with webcat install (1998)
Cut off from the list and can't get an answer to the confused re:QTY price updating question (1998)
WC1.6 to WC2 date formatting -FIXED! (1997)
setting taxable to true (1997)
OK, here goes... (1997)
Max Record length restated as maybe bug (1997)
F*** you (1998)
Dummy Credit Card Number for debug? (1997)
[newcart] (1998)
View order not right (1997)
Writing to PDF (2003)
WebCat editing, SiteGuard & SiteEdit (1997)
HELP! Search finding too much! (1998)
Permissions Ignored - PLEASE HELP (2003)
Questions To Answer (1997)
WebCatalog and WebMerchant reviewed by InfoWorld (1997)
$Replace with [founditems] (1997)
Latest Version of WebDNA store (2002)
[movefile] create stationery files (1998)
[WriteFile] problems (1997)