Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why in Earth this doesn't work?
Message
From
12/06/2001 02:36:34
 
 
To
11/06/2001 23:29:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00518203
Message ID:
00518220
Views:
9
>A command as simple as:
>
>Select TABLE_A
>Append from TABLE_B FOR FIELDX=.T.
>
>it appends all records, not only FIELDX=.T.
>FIELDX in TABLE_B is a logical field.
>
>I tried also
>
>Append from TABLE_B FOR TABLE_B.FIELDX=.T.
>
>Same result.
>
>Why things apparently so simple are sometimes so complicated?

According to the Hacker's Guide, in APPEND FROM the FOR clause examines each source record as if it had already been added to the target table. This can cause unexpected results if you're trying to use DELETED(), for example.

I just tried what you're doing with 2 cursors, and it worked as you wanted:
crea cursor test1 (lLog L)
appe && added 4 records, 2 .T., 2 .F.
crea cursor test2 (lLog L)
appe from dbf("test1") for lLog
* Result: 2 records added to Test2, as expected
Do you have any triggers etc. on your target table?
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform