Correct - Brain not engaged here Paul .... but it was Friday!! Dave
-----Original Message----- From: ProFox [mailto:profox-boun...@leafe.com] On Behalf Of Paul Newton Sent: 11 July 2016 09:05 To: profox@leafe.com Subject: RE: xBASE Appending from a Cursor I would have suggested INSERT INTO <<tablename>> FROM NAME <<oObject>> rather than APPEND BLANK and GATHER NAME -----Original Message----- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Dave Crozier Sent: 08 July 2016 11:07 To: profoxt...@leafe.com Subject: RE: xBASE Appending from a Cursor Another way is to use a scan/endscan loop with scatter name <<oObject>> memo and then an associated gather name <<oObject>> memo after an append blank. That way only fields which exist in the gather table will be transferred and you can also modify the oObject properties (fields) if required before the gather. Dave -----Original Message----- From: ProFox [mailto:profox-boun...@leafe.com] On Behalf Of Gene Wirchenko Sent: 07 July 2016 19:16 To: ProFox Email List <profox@leafe.com> Subject: Re: xBASE Appending from a Cursor At 16:37 2016-07-06, Gianni Turri <gianni...@gmail.com> wrote: >On Wed, 06 Jul 2016 15:57:20 -0700, Gene Wirchenko <ge...@telus.net> wrote: > > >Hello: > > > > I ran into some trouble writing an update program for my app. > >Having not done it for quite a while, I forgot how to xBASE append > >from a cursor. A simple > > append from thecursorname > >does not work. Instead, I finally remembered the, rather less-than-obvious > > append from (dbf("thecursorname")) > > > > Is there a better way? >your way in correct! > >And then there is the SQL way: > >insert into YourCursor ; > (Field1, Field2, Field3, FieldX) ; > select Field1, Field2, Field3, FieldX ; > from thecursorname > >or > >insert into YourCursor ; > select * ; > from thecursorname > >Make sure that the implicit and / or explicit fields lists do match. That is why I use the xBASE append: I do not have to bother with a column list. That is just duplicating table/cursor definitions and is prone to error (as you allude to). Sincerely, Gene Wirchenko [excessive quoting removed by server] _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/18725b8cd2d5d247873a2baf401d4ab2901fd...@ex2010-a-fpl.fpl.LOCAL ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.