Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace record from other dbf
Message
From
11/03/2005 09:58:07
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00994807
Message ID:
00994817
Views:
15
Khubaib

You were only getting one record because you only created ONE.
First may I suggest that you don't use numbered work area; it's dangerous (cos you have to remember which
table is in which WA) and confusing (for the same reasons). Rather Use a table in 0 (the highest WA available) and then on refer to the table by its alias. e.g. in your case, where yopu opened the tables in 6 and 38:

Use Table 1 in 0
Use Table 2 in 0

Not sure of your requirements but to get only one of each duplicated record you could get them into a cursor with SQL:
Select Table1 && what you called 38
Zap

Select distinct * from Table2 into cursor csrTemp

Select csrTemp
Scan
  Scatter MEMVAR
  Insert into Table1 from MEMVAR  && Table2 was your table(6) - 1 rec created for each distinct original 
EndScan

Select Table1
Browse
Terry

>my table(6) have field name scode, lcode, sec, code
>i am replacing these fields records in other table(38) filed name are same.
>"scode" fields have many records more than 400, also lcode and sec and code
>i want replace only one record from(6) field
>if scode has H M I M H I i want only H M I in table(38).
>i am using these codes but replace only one recode
>
>SELECT 38
>DELETE ALL
>pack
>sele 6
>
>SET ORDER TO sls
>tscode=scode
>tlcode=lcode
>tsec=sec
>
>*set filter to lcode=tlcode.and.admtd=1.and. scode=tscode.and.sec=tsec
>
>sele 38
>
>APPEND blank
>repl all scode with tscode
>repl all lcode with tlcode
>repl all sec with tsec
>
>LOCATE
>brows
>

- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform