Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is faster: insert from memvar or insert fields?
Message
De
24/07/2006 20:41:50
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01139366
Message ID:
01139529
Vues:
18
>Hi everybody,
>
>I'm wondering what is better and faster:
>
>select Table1
>scatter memvar
>FieldFK = something
>PointerField = something
>release cEntered_User, tEntered_Date
>insert into Table2 from memvar
I've had a few pieces of code where I (the framework I inherited, actually) used scatter/gather memvar a lot. The trouble with that approach is when you don't do all the fields, and there's a variable (from previously executed code) whose name matches a field. It will be GATHERed (or inserted) and you wouldn't notice. The reliability of this approach decreases exponentially with the number of lines between Scatter and Gather/Insert :).

It gets even worse if you're inserting into more than one table. You need to control all the variables, and still there's a chance a new field in one of target tables may pop up, with a name same as one of the variables. So some field may get a value you didn't intend to - and catching this type of error is time consuming.

I'm for the insert ... values or insert ... name simply because you have more control over what's being written.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform