Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Questions
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01052562
Message ID:
01052611
Vues:
7
>I have the following command:
>
>
>UPDATE Invoices;
>  SET InvoiceId = "ABC123";
>  WHERE RecordId IN;
>    (SELECT RecordId
>     FROM Invoices2)
>
>
>
>
>
>1) Does VFP first create a subset of Invoices2.RecordId and then use that
>to drive the update Invoices? Or is each record in Invoices2 evaulated
>for every record in Invoices?

No.
It execute a seek into a Invoices2 temporary alias,
if a index on RecordId don't exists then VFP build a temp index.
This is done for every Invoices record.

>
>2) Is there a more efficient way to do this?
>

Not with UPDATE;
of course you should have a Invoices2's index on RecordId.

With REPLACE perhaps, but it depends from:

SeekSuccessCount('Invoices2')/Count('Invoices')
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform