Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert command into sql query
Message
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 SP2
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01281878
Message ID:
01281964
Vues:
8
>>thank Naomi and serg(now i am shacking my head to understand you codes.
>
>Glancing through your original code it seems to be that you wanted to insert new records from students into ExamTran if the code was not found and update ExamTran records certain fields with the information from other fields of the same table.
>
>If this is so, I first selected records matching your original criteria (SET FILTER command).
>
>
>Basically your code may be also re-written this way:
>
>update ExamTran set onefield = '', another field = combination of fields where exists (select * from Student where your filter criteria)
>
>select code,"StaticInfo" as OneExtraField from students where code not in (select code from ExamTran) into cursor curToInsert && or LEFT JOIN equavalent which is usually faster
>
>insert into ExamTran (code, OneField) select * from curToInsert
Or even easier
insert into ExamTran (code, OneField);
select code,"StaticInfo" as OneExtraField from students where code not in (select code from ExamTran)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform