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:
Webstar 1.3.1 PPC (1997)
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
Exclamation point (1997)
WebCat b15 Mac plug-in (1997)
(2000)
Projects & Contractors (1997)
Error handling for accountNum (1997)
Deleting Orders (1997)
How far do [showif]s go? (1997)
Webcatalog and IIS4b2 (1997)
Cannot calculate prices (1997)
Debugging (2005)
WebCatalog can't find database (1997)
Add a field to the error log? (1997)
Round up prices (2000)
WebCat2.0 acgi vs plugin (1997)
WebMerch/Emailer Error (1998)
Server IP address? (1998)
Save Word/Excel Docs to Server (2002)
WebCommerce: Folder organization ? (1997)