Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not replace the record if?
Message
De
06/09/2004 09:34:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00939588
Message ID:
00939714
Vues:
13
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform