Re: Updating Prices in Online Database
This WebDNA talk-list message is from 1999
It keeps the original formatting.
numero = 23403
interpreted = N
texte = >I did a test to update my database by using the following code:>>[showif [dbpassword]=abcd]>[search db=newcatalog.db&neskudatarq=[blank]&max=8000]> [FoundItems]>[Replace db=catalogtest.db]price=[price]] [/Replace]>[/FoundItems]>[numFound] - records have been updated[/search]>[/showif]>[showif [dbpassword]!abcd]>Sorry, that password is not valid>[/showif]>>>This did not replace the database with the new prices, like I had hoped>it would. I received no syntax error messages and 30 items were found,>yet the prices were not updated. Is there something I am missing in the>code? or am I doing something incorrectly?Yes, you are doing two thing incorrectly that I can see offhand. (1) The replace context has an extra ending brackets and an extraneous space after the word price, both of these characters should be removed. (2) The replace context fails to identify which record you want replaced, because you have not defined which record it should replace. Try writing your [replace] tag like this:[Replace db=catalogtest.db&sku=[sku]]price=[newPrice][/Replace]This assumes your catalogtest.db has a sku field as a unique record identifier.Sincerely,Ken Grome
Associated Messages, from the most recent to the oldest:
>I did a test to update my database by using the following code:>>[showif [dbpassword]=abcd]>[search db=newcatalog.db&neskudatarq=[blank]&max=8000]>
[founditems]>[Replace db=catalogtest.db]price=[price]] [/Replace]>[/FoundItems]>[numFound] - records have been updated[/search]>[/showif]>[showif [dbpassword]!abcd]>Sorry, that password is not valid>[/showif]>>>This did not replace the database with the new prices, like I had hoped>it would. I received no syntax error messages and 30 items were found,>yet the prices were not updated. Is there something I am missing in the>code? or am I doing something incorrectly?Yes, you are doing two thing incorrectly that I can see offhand. (1) The replace context has an extra ending brackets and an extraneous space after the word price, both of these characters should be removed. (2) The replace context fails to identify which record you want replaced, because you have not defined which record it should replace. Try writing your
[replace] tag like this:[Replace db=catalogtest.db&sku=[sku]]price=[newPrice][/Replace]This assumes your catalogtest.db has a sku field as a unique record identifier.Sincerely,Ken Grome
Kenneth Grome
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:
SSL and reg web* (1997)
MacWEEK article help needed (1996)
Upgrade to WebCat2 from Commerce Lite (1997)
Problems with [Search] param - Mac Plugin b15 (1997)
Frames (1997)
[WebDNA] trouble with [url] encoding??? (2014)
Date problems-more (1997)
OFF TOPIC: help wanted (1997)
WebDNA tags in WebMerchant email templates ... (1997)
Speed Test (2007)
Encyption mail was Suggestions for Topics ... (1998)
Been meaning to ask... (1997)
Help name our technology! I found it (1997)
Search minus first found (1999)
psst (1997)
[CART] (1997)
New commands in Final candidate (1997)
Looking for PHP programmer (2007)
Repeating Fields (1997)
AOL and webcat (1998)