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:
Time/date formatting %X doesn't work ... (1997)
webdna page not found redirect (2007)
European Convention (2004)
access denied problem (1997)
Check boxes (1997)
Frames and WebCat (1997)
Credit Card Number checking (1997)
WebMerchant & CC Response (2002)
Bug or syntax error on my part? (1997)
MySQL and Decimals (2004)
[WebDNA] Alt Web Servers OS X (2011)
b12 cannot limit records returned and more. (1997)
really wierd browser truncating (1997)
Setting up shop (1997)
WCS Newbie question (1997)
Completed Orders (2006)
New [math] variable not working... (2001)
[WebDNA] Test - no messages since 9th of June 2009. (2009)
[WebDNA] new install - documentation (2017)
WebCat2: Items xx to xx shown, etc. (1997)