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:
Large Database Options? (1999)
website pro trouble (1998)
best way to test for the existence of a parameter in a url (2003)
I've been framed by webcatalog! Does anyone know the way out? (2000)
Secure server question (1997)
WebCat2b15MacPlugin - [protect] (1997)
Adding Header Values with [SetHeader] (1998)
OK, here goes... (1997)
OT : OSX file limitations (2001)
Simple way to create unique SKU (1997)
Country & Ship-to address & other fields ? (1997)
help testing quicktime delivery (1997)
Dummy Credit Card Number for debug? (1997)
Looking for host (1999)
[WebDNA] ENCRYPTION problems (2012)
Writing [raw] to a file (2000)
[WebDNA] [BULK] WebDNA 7 & Amazon Cloud (2011)
Banners and sort of random display (1997)
suffix mapping for NT? (1997)
WebCatalog2 Feature Feedback (1996)