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:
Using [sendmail] for mass mailings (2001)
[WebDNA] WebDNA 4.5.1 process DBServer.exe memory (2008)
ImageMap (1997)
[ShowIf] and empty fields (1997)
TCPConnect Help (2003)
[PROTECT] Problem (2003)
[WebDNA] TextExpander snippets (2013)
[shownext] and descending order (1997)
[Sum] function? (1997)
[/application] error? (1997)
[Sum] function? (1997)
Status of variable hierarchy changes? (2000)
[WebDNA] List Archives? (2009)
WebCommerce: Folder organization ? (1997)
Re:Emailer tracking (1997)
Max Record length restated as maybe bug (1997)
Help! WebCat2 bug (Ben's input) (1997)
form data submission gets truncated (1997)
PCS Frames (1997)
WebCat2 Append problem (B14Macacgi) (1997)