Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert missing records
Message
From
25/12/2006 23:25:28
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
25/12/2006 21:22:58
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01180147
Message ID:
01180150
Views:
16
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform