Re: Updating Integer value in DB
This WebDNA talk-list message is from 2007
It keeps the original formatting.
numero = 68678
interpreted = N
texte = I used to run into a lot of problems with database fields with spaces in them. i.e. "ON HAND" instead of the more reliable "ON_HAND". I've gotten them to work, but not without [url]ing everything.That said, I see 2 errors in your code so try this:You have a typo of "wqSKUdatarq" instead of "eqSKUdatarq"And the variable ON_HAND needs to be stated as a variable in [] inside the [math] context.[replace db=^inventory.db&eqSKUdatarq=[SKU]]ON_HAND=[MATH][ON_HAND]+[updatevalue][/MATH][/replace]Matt-- Matthew A PerosiPsi Prime, Inc.http://www.psiprime.com323 Union Blvd.Totowa, NJ 07512P: 973.225.9870F: 973.413.8217Ki Song wrote:>Really quick question. I am trying to create a call to a products.db to>update a quantity on an inventory item so that, for example, if the value>that is in the db currently is 2, and I wanted to add 1 to the quantity, how>would I accomplish this?>>I wrote the following replace command, but it doesn't seem to work:>>[replace db=^inventory.db&wqSKUdatarq=[SKU]]ON HAND=[MATH]ON>HAND+[updatevalue][/MATH][/replace]>>updatevalue = an integer, positive or negative, that is used to change the>ON HAND.>>For example:>SKU= test>ON HAND= 3>updatevalue= 45>>After this replace is done, ON HAND should = 48.>>>------------------------------------------------------------->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/>>> >-------------------------------------------------------------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:
I used to run into a lot of problems with database fields with spaces in them. i.e. "ON HAND" instead of the more reliable "ON_HAND". I've gotten them to work, but not without [url]ing everything.That said, I see 2 errors in your code so try this:You have a typo of "wqSKUdatarq" instead of "eqSKUdatarq"And the variable ON_HAND needs to be stated as a variable in [] inside the [math] context.[replace db=^inventory.db&eqSKUdatarq=[SKU]]ON_HAND=[math][ON_HAND]+[updatevalue][/MATH][/replace]Matt-- Matthew A PerosiPsi Prime, Inc.http://www.psiprime.com323 Union Blvd.Totowa, NJ 07512P: 973.225.9870F: 973.413.8217Ki Song wrote:>Really quick question. I am trying to create a call to a products.db to>update a quantity on an inventory item so that, for example, if the value>that is in the db currently is 2, and I wanted to add 1 to the quantity, how>would I accomplish this?>>I wrote the following replace command, but it doesn't seem to work:>>[replace db=^inventory.db&wqSKUdatarq=[SKU]]ON HAND=[math]ON>HAND+[updatevalue][/MATH][/replace]>>updatevalue = an integer, positive or negative, that is used to change the>ON HAND.>>For example:>SKU= test>ON HAND= 3>updatevalue= 45>>After this replace is done, ON HAND should = 48.>>>------------------------------------------------------------->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/>>> >-------------------------------------------------------------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/
Matthew A Perosi
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:
Date sorting (1997)
[WebDNA] [OT] the "Work in progress" thread. (2009)
[CART] as [Cart] (2006)
Problems with cybercash (2000)
Re:listfiles-looking for slick solution (1997)
WebCat2b13MacPlugIn - [showif][search][/showif] (1997)
Adding headers to email (1997)
Help name our technology! (1997)
Re:Navigator 4.01 (1997)
Using [Include] Context (1999)
Error Lob.db records error message not name (1997)
multiple databases (1997)
Unceremonious Unwanted Unsubscription (1999)
Test (2006)
[AppendFile] problem (WebCat2b13 Mac .acgi) (1997)
_ in front of field name (1998)
[numfound] within summ=t ??? (2000)
How to Sort Summ data ? (1997)
New install permissions (2003)
FWD: Autoproxy Bug with WebCatalog and FireSite (1997)