Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GO TOP before SEEK?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00471932
Message ID:
00472871
Vues:
44
>The guy I work with prefers that I use SEEK in lieu of LOCATE and SQL. Maybe he thinks it faster. I don't remember his reasoning. I know he hates it when I use cursors, so I try not to use them unless my life depends on it. Just kidding... in case he's listening.

1) Note that when using a LOCATE (where indexes are automatically found) on a heavily tagged table, there can be a slight overhead while the CDX is checked for a valid index. SEEK does not require this, and in fact does not even require table selection or ORDER setting, as Marcia pointed out, when using the SEEK() function.

2) SQL is fast too but has the same valid-index-searching problem as LOCATE, plus it's clunky compared to the SEEK() function, where you can just have a one-liner like

IF SEEK(,,,)

I'd say the guy you work with is way out-of-line about cursors, they are absolutely the perfect medium for lots of data-business. Basically, they replace both arrays and temporary tables for almost all purposes in the DB world (at least when a view is not called for)...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform