Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Slow replace the record
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 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01194547
Message ID:
01198625
Vues:
10
This message has been marked as the solution to the initial question of the thread.
Khubaib,

To see what's going on, let's divide this task into 2:
1) select * from Student where AdmTd = 1 and ;
Code not in (select code from Dly) ;
into cursor curNewStudents nofilter
2) ** First select may be re-written using LEFT JOIN, usually it's faster

if _tally > 0 && we do have new students to insert
   insert into Dly (code, date, type, dategory, scode, lCode, sec) ;
   select code, m.pDate, 1, "P", scode, lCode, Sec from curNewStudents
endif
>I am replaceing the records wiht these codes. require some advice or sql help.only 900 records, timing is more 80 seconds.
>
>  Select student
>         Set Order To CODE
>         Set Filter To admtd=1
>         Goto Top
>         Do While !Eof()
>             grno = code
>             mscode = scode
>             mlcode = lcode
>             msec = sec
>             Select dly
>             Set Order To CODE
>             Seek grno
>             If Found()
>                 Select student
>                 Skip
>             Else
>                 Select dly
>                 Append Blank
>                 Replace code With grno
>                 Replace date With pdate
>                 Replace type With 1
>                 Replace category With "P"
>                 Replace scode With mscode
>                 Replace lcode With mlcode
>                 Replace sec With msec
>                 Select student
>                 Skip
>             Endif
>         Enddo
>     Endif
> Endif
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform