Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append blank/replace -> insert into
Message
De
06/05/2003 19:37:10
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
06/05/2003 16:51:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00785595
Message ID:
00785634
Vues:
12
>I found the code combination
>
>APPEND BLANK IN vitems
>REPLACE ...
>
>
>I want to enclose the transaction in Begin Transacation, End Transaction/Rollback constructs so I can back out transactions if the Tableupdate fails.
>
>Can use the above construct or should I change to the Insert into construct?

INSERT INTO should be faster. If that is no concern, you can use both alternatives - APPEND FROM / REPLACE is sometimes easier to manage.

>This is called in from other forms and currently the buffermode is 0. Do I need to change it to 2?

Without buffering, the combination can fail, because of some sort of violation: missing value in field, RI, etc.

Let's see what happens:
* No buffering:
APPEND BLANK && immediately fails! Missing FK, for instance.
REPLACE...

* With buffering:
APPEND BLANK && Triggers are not yet evaluated
REPLACE... && Here, you insert the necessary values
TableUpdate() && Only now are certain rules evaluated.
>Anything else I should do?

Optimistic buffering is the preferred method, for most developers. (Options 3 or 5.)
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