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:
how to use WebCat w. SSL & CyberCash (1998)
Showif Error Generated... (2003)
Updating a database once per day - An example (1998)
Opinion: [input] should be called [output] ... (1997)
SV: Send massmail (2000)
PSC recommends what date format yr 2000??? (1997)
PCS Frames (1997)
about this server and links to who (1997)
Sku numbers (1997)
Location of Webcat site in folder hierarchy (1997)
WebCatalog can't find database (1997)
WebCat & Backoffice Solution? (2000)
WebCat2b12plugin - [search] is broken ... not! (1997)
WebCat2 several catalogs? (1997)
Cart creation techniques (was Problems with Price field) (1997)
[AppendFile] problem (WebCat2b13 Mac .acgi) (1997)
Re:Copyright ? (1997)
Test (2003)
Moment of Thanks (1997)
instant cookies? (1999)