Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Slow Tableupdate with CursorAdapter on Sql Tables
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00860786
Message ID:
00860804
Views:
18
Have you tried issuing the TABLEUPDATE after the DO WHILE loop?

>I have a Table with 300k records. When I'm performing a Tableupdate on 10 records it takes 4 seconds. If I do the same code in the Sql Query Analyser, I get less than 1 sec. My Cursor Adapter is in Row Buffered mode, max records is -1, Fetch size -1 too. The Sql Server machine is a Pentium II 333, 128meg Ram on a Novell Network. We are using this server with only one connection (we're still in our test mode).
>
>We tried both Tableupdate(1,.T.) and Tableupdate(0,.T.).
>
>We also tried to update the cursor after the Do while clause with a Table buffering mode but it's worse. After almost 1 hour the Tableupdate wasn't finished.
>
>Here's a sample of the code I'm using :
>
>Thisform.DataEnvironment.vResult.SelectCmd = "SELECT SUM(A_RecHisto.Rhpayable) as Somme, "+;
>"A_RecHisto.RhCheque from A_RecHisto "+;
>"WHERE A_RecHisto.RhDateServ >= '01/01/2001' GROUP BY A_RecHisto.RhCheque"
>Thisform.DataEnvironment.vResult.CursorSchema = "Somme N(12,2),RhCheque N(6,0)"
>Thisform.DataEnvironment.vResult.Cursorfill
>REQUERY('vResult')
>INDEX ON RhCheque TAG RhCheque
>SET ORDER TO TAG RhCheque
>
>SELECT vRecHisto
>GO TOP
>DO WHILE !EOF()
> IF !EMPTY(vRecHisto.RhCheque)
> SELECT vResult
> SEEK(vRecHisto.RhCheque)
> IF FOUND()
> SELECT vRecHisto
> Replace RhMntChq WITH vResult.Somme
> TABLEUPDATE(0,.t.,'vRecHisto') <--- Slow
> ENDIF
> ENDIF
> SELECT vRecHisto
> SKIP
>ENDDO
>
>Please I need help !!! TIA
It's "my" world. You're just living in it.
Previous
Reply
Map
View

Click here to load this message in the networking platform