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 = 268 Rich,=20 In 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 to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us . Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] copy some database fields into a new database (Rich Kwas 2016)
  2. Re: [WebDNA] copy some database fields into a new database (Brian Burton 2016)
  3. Re: [WebDNA] copy some database fields into a new database (Rich Kwas 2016)
  4. Re: [WebDNA] copy some database fields into a new database (Brian Burton 2016)
  5. [WebDNA] copy some database fields into a new database (Rich Kwas 2016)
268 Rich,=20 In 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 to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug 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:

Test Please ignore (2006) Handy Browser Counter Tip (1997) emailer (1997) Roundup function? (1997) Re:Change WebDNA-Talk Mail due to no digest for 1wk (1997) Bit off subject -- Faxing orders (1997) Quitting WebMerchant ? (1997) jpg and gif format thumbnails (2004) [format 40s]text[/format] doesn't work (1997) suffix mapping for NT? (1997) Separate server for jpg/gif files (1998) Contexts and Ampersands (1997) Line items in table cells (1997) Upload Text File/ Append to DB (2003) [date] formatting bug inside [orderfile]? (1998) Erotic Sites (1997) Converting spaces to + in results list (2000) PCS Frames (1997) OFF TOPIC: Sendmail problem (2003) [authenticate] (1999)