Re: [WebDNA] copy some database fields into a new database
This WebDNA talk-list message is from 2016
It keeps the original formatting.
numero = 112685
interpreted = N
texte = 268Rich,=20In your example, you don=E2=80=99t need to use a loop at all. The =[founditems] tag set is doing the looping for you, one iteration per =record retrieved.You do however need to add all the fields you want to append in the =append tag.example:=20[search db=3Dproducts.db&eqVisibledatarq=3DT&asSKUsort=3D1][founditems][append =db=3Dproducts_new.db&autonumber=3DID]sku=3D[sku]&color=3D[color]&size=3D[s=ize]&price=3D[price]&description=3D[url][description][/url][/append][/founditems][/search]-Brian B. Burton> On Mar 24, 2016, at 5:02 PM, Rich Kwas
=wrote:>=20> I'll give your way a try Brian...>=20> I was thinking [Loop] was the way to go.>=20>=20> Tried another simple loop attempt a moment ago.> This caused errors messages and a total of 25,282 blank records to be =created.....> The code I used based on what I thought I should do according to the =docs:>=20> [search db=3Dproducts.db&eqVisibledatarq=3DT&asSKUsort=3D1]> [numfound] Product Listings Found>=20> [founditems]> [loop start=3D1&end=3D[numfound]&advance=3D1]> [append db=3Dproducts_new.db&SKU=3D[SKU]][/append]> [/loop]> [/founditems]>=20> [/search]>=20> Would the above [loop] code work if handled differently?>=20>=20>=20> On Thursday, March 24, 2016 4:18 PM, Brian Burton =wrote:>=20>=20> To clarify, are you trying to copy a few columns of all 3100 records =to a new database, or copy X number of rows from one database to =another?=20>=20> It sounds like you want to do this:>=20> [writefile file=3Dnew.db]IDfield1field2field3> [/writefile]>=20> [search db=3Doriginal.db&neIDfield=3D[blank]]> [founditems]> [appendfile file=3Dnew.db&secure=3DF][index] =[originaldb-field-a][originaldb-field-d] [originaldb-field-f]> [/appendfile]> [/founditems]> [/search]>=20> in this case, the [founditems] is doing the work of a looping type =functionality.=20>=20>=20> -Brian B. Burton>=20>> On Mar 24, 2016, at 3:23 PM, Rich Kwas =wrote:>>=20>> I have a db with 3100+ records>> I need to copy some fields from this db into a brand new db.>>=20>> Would using [Loop] be a good way to do this?>> Another way?>>=20>> I tried to use [loop] but I got into an endless loop where nothing =but blank records was being written into a new db. I was searching for ="all" the records and then appending certain fields into the new db. I =had to pull the plug on the pc after 43,000 records, couldn't figure out =a way to break the loop.>>=20>> [Loop] isn't explained in great detail in the docs and the one sample =is pretty simple...>> I've never needed to use the [loop] context I guess so never utilized =it before.>>=20>>=20>> Rich>> --------------------------------------------------------- This =message is sent to you because you are subscribed to the mailing list . =To unsubscribe, E-mail to: archives: =http://mail.webdna.us/list/talk@webdna.us Bug Reporting: =support@webdna.us>=20> --------------------------------------------------------- This message =is sent to you because you are subscribed to the mailing list . To =unsubscribe, E-mail to: archives: =http://mail.webdna.us/list/talk@webdna.us Bug Reporting: =support@webdna.us>=20>=20> --------------------------------------------------------- This message =is sent to you because you are subscribed to the mailing list . To =unsubscribe, E-mail to: archives: =http://mail.webdna.us/list/talk@webdna.us Bug Reporting: =support@webdna.us---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list .To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us.
Associated Messages, from the most recent to the oldest:
268Rich,=20In your example, you don=E2=80=99t need to use a loop at all. The =[founditems] tag set is doing the looping for you, one iteration per =record retrieved.You do however need to add all the fields you want to append in the =append tag.example:=20[search db=3Dproducts.db&eqVisibledatarq=3DT&asSKUsort=3D1][founditems][append =db=3Dproducts_new.db&autonumber=3DID]sku=3D[sku]&color=3D[color]&size=3D[s=ize]&price=3D[price]&description=3D[url][description][/url][/append][/founditems][/search]-Brian B. Burton> On Mar 24, 2016, at 5:02 PM, Rich Kwas =wrote:>=20> I'll give your way a try Brian...>=20> I was thinking [loop] was the way to go.>=20>=20> Tried another simple loop attempt a moment ago.> This caused errors messages and a total of 25,282 blank records to be =created.....> The code I used based on what I thought I should do according to the =docs:>=20> [search db=3Dproducts.db&eqVisibledatarq=3DT&asSKUsort=3D1]> [numfound] Product Listings Found>=20> [founditems]> [loop start=3D1&end=3D[numfound]&advance=3D1]> [append db=3Dproducts_new.db&SKU=3D[SKU]][/append]> [/loop]> [/founditems]>=20> [/search]>=20> Would the above [loop] code work if handled differently?>=20>=20>=20> On Thursday, March 24, 2016 4:18 PM, Brian Burton =wrote:>=20>=20> To clarify, are you trying to copy a few columns of all 3100 records =to a new database, or copy X number of rows from one database to =another?=20>=20> It sounds like you want to do this:>=20> [writefile file=3Dnew.db]IDfield1field2field3> [/writefile]>=20> [search db=3Doriginal.db&neIDfield=3D[blank]]> [founditems]> [appendfile file=3Dnew.db&secure=3DF][index] =[originaldb-field-a][originaldb-field-d] [originaldb-field-f]> [/appendfile]> [/founditems]> [/search]>=20> in this case, the [founditems] is doing the work of a looping type =functionality.=20>=20>=20> -Brian B. Burton>=20>> On Mar 24, 2016, at 3:23 PM, Rich Kwas =wrote:>>=20>> I have a db with 3100+ records>> I need to copy some fields from this db into a brand new db.>>=20>> Would using [loop] be a good way to do this?>> Another way?>>=20>> I tried to use [loop] but I got into an endless loop where nothing =but blank records was being written into a new db. I was searching for ="all" the records and then appending certain fields into the new db. I =had to pull the plug on the pc after 43,000 records, couldn't figure out =a way to break the loop.>>=20>> [loop] isn't explained in great detail in the docs and the one sample =is pretty simple...>> I've never needed to use the [loop] context I guess so never utilized =it before.>>=20>>=20>> Rich>> --------------------------------------------------------- This =message is sent to you because you are subscribed to the mailing list . =To unsubscribe, E-mail to: archives: =http://mail.webdna.us/list/talk@webdna.us Bug Reporting: =support@webdna.us>=20> --------------------------------------------------------- This message =is sent to you because you are subscribed to the mailing list . To =unsubscribe, E-mail to: archives: =http://mail.webdna.us/list/talk@webdna.us Bug Reporting: =support@webdna.us>=20>=20> --------------------------------------------------------- This message =is sent to you because you are subscribed to the mailing list . To =unsubscribe, E-mail to: archives: =http://mail.webdna.us/list/talk@webdna.us Bug Reporting: =support@webdna.us---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list .To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: support@webdna.us.
Brian Burton
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:
[WebDNA] v7 help (2012)
no global [username] or [password] displayed ... (1997)
Truncated Sendmail (1998)
Any way to retrieve information from clipboard? (1999)
target=_blank and form variables (1997)
Error Lob.db records error message not name (1997)
What am I missing (1997)
WebCat2b13MacPlugIn - More limits on [include] (1997)
AppleScript: Tell application:app location? (1998)
any limitations on # of users.db entries (1999)
WebCat for mass emailings (1997)
Re[2]: WebCatalog on Linux (2000)
Using WC for Bulk Emailings (1997)
Feature Request -COPYRECORD (2005)
Concerning Emailer under Linux... does it exist? (2000)
Smart caching problems with 2.1b3? (1997)
Sorting (2005)
ListFiles and NT Email Sender 2nd Answer (2000)
Setting up shop (1997)
Opinion: [input] should be called [output] ... (1997)