At 16:37 2016-07-06, Gianni Turri giannit62@gmail.com wrote:
On Wed, 06 Jul 2016 15:57:20 -0700, Gene Wirchenko genew@telus.net wrote:
Hello:
I ran into some trouble writing an update program for myapp. 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