Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert missing records
Message
From
26/12/2006 12:35:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
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:
01180227
Views:
27
>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

Here is another alternative:
use MyTable order "Sno"
for i = 1 to 2500
  if not seek(i)
    append blank
    replace Sno with i
  endif
next
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform