Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Appending from array
Message
De
07/08/2008 13:30:20
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01337197
Message ID:
01337323
Vues:
12
This message has been marked as the solution to the initial question of the thread.
>I got PT1 with APRINTERS ( )
>
>then I did as below:
>
>DELETE all
>INSERT INTO tablePrinters FROM ARRAY pt1
>
>But:
>
>I dont want to delete all, because I have some fields I have to preserve
>
>I would like to
>
> 1- Append only new printers (not repeated records)
>
> 2- Delete printers that are on the table, but not in the array anymore
>
>TIA

Something like this:
select * from tablePrinters where .f. into cursor tmp readwrite
INSERT INTO tmp FROM ARRAY  pt1

delete from tablePrinters where printerName not in (select printerName from tmp)

insert tablePrinters ;
select * from tmp where printerName not in (select printerName from tablePrinters)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform