Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert missing records
Message
De
25/12/2006 23:25:28
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
25/12/2006 21:22:58
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 SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01180147
Message ID:
01180150
Vues:
17
>Dear Experts
>
>Table1 has only one numeric field as sno n(4)
>
>It has records as
>
>1
>25
>1500
>1800
>
>In sno field, I want to insert missing records between 1 to 2500.
>
>Please help

Something like
create cursor temp (sno n(4))
for i=1 to 2500
   insert into temp (sno) value (i)
endfor
insert into yourtable select sno from temp;
   where sno not in (select sno from yourtable)
The code doesn't need to know which records already exist in your table.

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
Répondre
Fil
Voir

Click here to load this message in the networking platform