Re: SKU lookup

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 13114
interpreted = N
texte = >Heh Dan: > >I like your post! How about this hack which I think will work. > > > >[search db=yourdatabase.db&grskudata=0&deskusort=1&max=1] > [founditems] > [math]newsku=[sku]+1[/math] > [/founditems] >[/search] > >

Final value=[math]newsku[/math]

> > > >This will sort in decending order, find only 1 (so the highest number) >and then assign it to newsku plus one. Hey Olin,This is exactly what I was going to suggest in the first place! :) ... but then I didn't know if Damien really needed incremented sku values or not, so I thought I would show him the [cart] technique first, since it's the easiest and fastest to code.But hey, if the goal is to append records with each new record's sku value incremented one higher than the highest existing sku in the database, your code above can be modified just a little, and then integrated into an append context as follows:[append db=yourdatabase.db]sku=[search db=yourdatabase.db&grskudata=0&deskusort=1&max=1][founditems][math][sku]+1[/math ][/founditems][/search]Sincerely, Ken Grome WebDNA Solutions http://www.hui.net/dna/webdna.html Associated Messages, from the most recent to the oldest:

    
  1. Re: SKU lookup (Damien Joldersma 1997)
  2. Re: SKU lookup (Kenneth Grome 1997)
  3. Re: SKU lookup (Olin 1997)
  4. Re: SKU lookup (Kenneth Grome 1997)
  5. Re: SKU lookup (Daniel Cameron 1997)
  6. Re: SKU lookup (Damien Joldersma 1997)
  7. Re: SKU lookup (Kenneth Grome 1997)
  8. SKU lookup (Damien Joldersma 1997)
>Heh Dan: > >I like your post! How about this hack which I think will work. > > > >[search db=yourdatabase.db&grskudata=0&deskusort=1&max=1] > [founditems] > [math]newsku=[sku]+1[/math] > [/founditems] >[/search] > >

Final value=[math]newsku[/math]

> > > >This will sort in decending order, find only 1 (so the highest number) >and then assign it to newsku plus one. Hey Olin,This is exactly what I was going to suggest in the first place! :) ... but then I didn't know if Damien really needed incremented sku values or not, so I thought I would show him the [cart] technique first, since it's the easiest and fastest to code.But hey, if the goal is to append records with each new record's sku value incremented one higher than the highest existing sku in the database, your code above can be modified just a little, and then integrated into an append context as follows:[append db=yourdatabase.db]sku=[search db=yourdatabase.db&grskudata=0&deskusort=1&max=1][founditems][math][sku]+1[/math ][/founditems][/search]Sincerely, Ken Grome WebDNA Solutions http://www.hui.net/dna/webdna.html Kenneth Grome

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:

Virtual hosting and webcatNT (1997) Did you hear about this? (1997) [include] affect on filepaths for links? (1997) [WebDNA] Multiple Instances of WebDNA causing multiple copies of emails (2012) Delayed Redirect (2000) Searching multiple databases (1998) Can [writefile] files be served thru webcat? (2000) Dummy Credit Card Number for debug? (1997) How true is this? (1999) BBEdit WedDNA Codeless Language Module (2004) WC2.0 Memory Requirements (1997) [click][/click] (1999) Add a field to the error log? (1997) lookup (1998) Jimmy Houssen (1998) WebDNA and SQL (2003) no global [username] or [password] displayed ... (1997) [OT] FTP client (2003) Searching multiple Databases (1997) Search Via a drop down menu? (2000)