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:
REPOST: Large founditems loops (2000)
WebSTAR 2.1 freezes my Mac (1997)
[WebDNA] WebDNA app (2013)
where's Formulas.db? (2001)
New syntax feedback for 4.0 (2000)
Image maps/Webcat (1997)
carriage returns in data (1997)
Generating Report Totals (1997)
SetHeader (1997)
How did *you* learn Web Catalog? (2000)
Re1000001: Setting up shop (1997)
problems with 2 tags shakur (1997)
[WriteFile] problems (1997)
quantity minimum problem (1997)
OT - royalty free images (2002)
RE: WebCatalog2 for NT Beta Request (1997)
Re(2): SSL, WebSTAR, WebCatalog (1998)
webcat NT (1998)
StoreBuilder Shopping Cart (2000)
WebCat2b15MacPlugin - showing [math] (1997)