Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Not replace the record if?
Message
From
06/09/2004 09:34:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00939588
Message ID:
00939714
Views:
14
You should use seek or seek() for faster access (using an index).


use MyTable order "Some_Order"
if not seek(Seek_Value)
append blank
replace;
Field1 with Value1,;
Field2 with Value2, ...
endif


INSERT INTO is often recommended, instead of APPEND BLANK / REPALCE:


use MyTable order "Some_Order"
if not seek(Seek_Value)
insert into MyTable (Field1, Field2, ...);
values (Value1, Value2, ...)
endif



>if already exist records in table should not replace again.
>
>I am using these codes.
> SELECT ex
> SET ORDER TO all
> APPEND BLANK
> replace code WITH thisform.code.value
> replace descr WITH thisform.descr.value
> replace scode WITH thisform.scode.value
> replace lcode WITH thisform.lcode.value
> replace sec WITH thisform.sec.value
> replace cperc with tcperc
> replace cfail WITH fail
> REPLACE cpass WITH pass
> SELECT ex
> SET ORDER TO all
> Locate For code==thisform.code.value.and.thisform.descr.value.and.thisform.scode.value.and.thisform.lcode.value.and.thisform.sec.value
>
> replace code WITH thisform.code.value
> replace descr WITH thisform.descr.value
> replace scode WITH thisform.scode.value
> replace lcode WITH thisform.lcode.value
> replace sec WITH thisform.sec.value
> replace cperc with tcperc
> replace cfail WITH fail
> REPLACE cpass WITH pass
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform