Re: automatically updating all records, one by one in a db

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 36249
interpreted = N
texte = on 17.08.2000 13:16, Dale at stuff@colony.net wrote:> I have to update some information in each record of a live production > database. There are a couple of different fields that need to be updated and I > want to make sure I do things correctly as to not mess up my db.Make a copy first :) > So how do I do a search, with results for only 1 at a time, make the changes, > then proceed to the next record that needs to be updated? You don't have to search for each record individually. [founditems] is in fact a loop which automatically steps through all found records. Everything between [founditems] and [/founditems] is executed record for record. You can use [showif]'s there to define conditions for various actions. For each run through [founditems] you can use data of the current record if necessary.If you do not need individual data of the current record but rather change all or a selection of records by given criteria, a search is not necessary. Use [replace], which is actually query and replace in one command. -- btw - to change fields within a [founditems] loop you have to use [replace] either. Since [replace] containes a search this is (in my opinion) wasted time - I never understood why I have to do execute a new query for a already loaded record... Peter ------------------------------------------------------------- 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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: automatically updating all records, one by one in a db (Dale 2000)
  2. Re: automatically updating all records, one by one in a db (Dale 2000)
  3. Re: automatically updating all records, one by one in a db (Peter Ostry 2000)
  4. Re: automatically updating all records, one by one in a db (WebDNA Support 2000)
  5. Re: automatically updating all records, one by one in a db (Peter Ostry 2000)
  6. automatically updating all records, one by one in a db (Dale 2000)
on 17.08.2000 13:16, Dale at stuff@colony.net wrote:> I have to update some information in each record of a live production > database. There are a couple of different fields that need to be updated and I > want to make sure I do things correctly as to not mess up my db.Make a copy first :) > So how do I do a search, with results for only 1 at a time, make the changes, > then proceed to the next record that needs to be updated? You don't have to search for each record individually. [founditems] is in fact a loop which automatically steps through all found records. Everything between [founditems] and [/founditems] is executed record for record. You can use [showif]'s there to define conditions for various actions. For each run through [founditems] you can use data of the current record if necessary.If you do not need individual data of the current record but rather change all or a selection of records by given criteria, a search is not necessary. Use [replace], which is actually query and replace in one command. -- btw - to change fields within a [founditems] loop you have to use [replace] either. Since [replace] containes a search this is (in my opinion) wasted time - I never understood why I have to do execute a new query for a already loaded record... Peter ------------------------------------------------------------- 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://search.smithmicro.com/ Peter Ostry

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:

A quickie question (1997) Converting SQL Microtime to Date and Time (2003) Thanks for Encrypt.tpl - A Question (1999) Math inside [showif] (1998) RE: Custom error files (1998) Talk List Suggestions (1997) Searching for (field1 OR field2) AND field3 (2000) orders being printed (1998) OT: Digger (2007) Show if time tags (1997) Emailer again & again (1997) [WebDNA] linux linux linux (2009) Searching multiple Databases (1997) completed orders database (1997) search/showif issues (2000) stopping/restarting service on NT? (1998) Resetting a Formvariable (2000) [Fwd: can we get string variables?] (1998) Can't load tmpl files (1997) WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997)