Re: Renumbering Database Records
This WebDNA talk-list message is from 1999
It keeps the original formatting.
numero = 23722
interpreted = N
texte = > How can I renumber the records in a database? I have a database with a>field ID. I want to go throught the database, possibly sorting on some>other field, and number the records 1,2,3,4,... etc so I can have a>unique ID for each record. After that, for example, I can use this ID to>delete a record.It almost sounds like your field ID is *already* the unique ID you'relooking for. Is it not?You're adding numbers to something that doesn't already have uniqueidentifiers in it? The tough part there is going to be figuring out how touniquely determine which record you want to modify. For instance, the[Replace] context which you'll be using for your renumbering task needs tobe given a set of search criteria that uniquely identify the record. Ifyou give it something non-unique to search for, then it will end uprenumbering all found records with the *same* number.So your task is to come up with a search that will always find just onerecord. Once you can do that, you can use a little [math] to increment anumber once for each found record, then [replace] the sku with that number.Technical Support | ==== eCommerce and Beyond ====Pacific Coast Software | WebCatalog, WebMerchant,11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster,San Diego, CA 92128 | Typhoon619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/
Associated Messages, from the most recent to the oldest:
> How can I renumber the records in a database? I have a database with a>field ID. I want to go throught the database, possibly sorting on some>other field, and number the records 1,2,3,4,... etc so I can have a>unique ID for each record. After that, for example, I can use this ID to>delete a record.It almost sounds like your field ID is *already* the unique ID you'relooking for. Is it not?You're adding numbers to something that doesn't already have uniqueidentifiers in it? The tough part there is going to be figuring out how touniquely determine which record you want to modify. For instance, the
[replace] context which you'll be using for your renumbering task needs tobe given a set of search criteria that uniquely identify the record. Ifyou give it something non-unique to search for, then it will end uprenumbering all found records with the *same* number.So your task is to come up with a search that will always find just onerecord. Once you can do that, you can use a little
[math] to increment anumber once for each found record, then
[replace] the sku with that number.Technical Support | ==== eCommerce and Beyond ====Pacific Coast Software | WebCatalog, WebMerchant,11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster,San Diego, CA 92128 | Typhoon619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/
PCS Technical Support
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:
can WC render sites out? (1997)
DATES (2004)
Highlighting words found in a keyword search (2003)
Three new problems ... (1997)
Date Formats (1997)
[WebDNA] Comparing fields in a search (2010)
2.01 upgrade problems (1997)
Obscure Question of the day (1997)
Help name our technology! (1997)
Balancing randomness (2000)
WebCatalog Plug-in for Webstar. (1997)
Separate SSL Server (1997)
logout after authenticated (2002)
Thanks Grant (1997)
WebCat2: Master Counter snippet (1997)
creator code (1997)
New WebCatalog Version !!! (1997)
SiteEdit NewFile.html ? (1997)
Createfolder / writefile problem (2004)
Re:quit command on NT (1997)