Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Repeated records
Message
From
02/08/2007 09:06:45
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01245292
Message ID:
01245450
Views:
22
>>This is the easiest, and probably the best way to do this.
>>
>>Update yourtable set field1=data1, field2=data2,...;
>>  where uniqfield1=uniqdata1 and uniqfield2=uniqdata2 and uniqfield3=uniqdata3
>>if _tally=0 && No records found, so this is a new record
>>  Insert into yourtable (field1, field2... , uniqfield1, uniqfield2, uniqfield3);
>>    data (data1, data2, ... ,uniqdata1, uniqdata2, uniqdata3)
>>endif
>
>Looks like a good idea.
>
>What if we work with buffered tables? We may still need a candidate index.

Regarding buffered tables, I am not sure, but it has never been an issue for me. Since three fields are involved, you would need a surrugate key as a candidate index, I don't like surrugate keys.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform