Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Bernard Bout
  Where is Bernard Bout?
 Brisbane
 Australia
 Bernard Bout
 To: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 Tags
Subject: RE: cursorfill() is closing the cursor
Thread ID: 415827 Message ID: 416007 # Views: 37 # Ratings: 0
Version: Visual FoxPro 8 Category: ODBC, ADO and OLEDB
Date: Thursday, December 18, 2014 4:18:58 PM         
   


> > To overcome the 2gb limit with cursors
>
> Don't tell me that you SELECT more than 2GB from Server?
> You rarely need ALL records from table.
> Use Stored Procedures if you need to do something over all records of the table.
>
> You should work ONLY with these records you need at that moment.
> Use proper WHERE clause with parameters.
> Then change only parameters and use CursorRefresh() instead of CursorFill():
>
>
> ...
> oCa.SelectCmd = "SELECT Field1, Field2, Field 3 FROM Table1 WHERE Invoce = ?m.lnInvoice"
> ...
> 
> lnInvoice = -1 && Some invoice number that does not exists
> 
> IF NOT oCa.CursorFill()
>    *** Handle error
> ENDIF
> 
> lnInvoice = 20433 && We need to work with all records for the Invoice 20433
> IF NOT oCa.CursorRefresh()
>    *** Handle error
> ENDIF
> BROW NORMAL
> 
> lnInvoice = 10454 && We need to work with all records for the Invoice 10454
> IF NOT oCa.CursorRefresh()
>    *** Handle error
> ENDIF
> BROW NORMAL
> 

>
> -----------------
> Borislav Borissov
>
> Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
> The only thing normal about database guys is their tables.

I second this. Client-server is NOT a straight conversion from using VFP tables. Not only is there no need to EVER bring down that much data, but to clog the network makes no sense.

As you say, if much data needs to be manipulated then a Server side Function should be called and only the least amount of data brought down.

Dilip has a design flaw in his application if he needs to bring down 2 gigs of data.

Bernard

** If you see someone without a smile, give em one of yours **
My Blog

ENTIRE THREAD

cursorfill() is closing the cursor Posted by Dilip Kumar @ 12/13/2014 6:06:54 PM
RE: cursorfill() is closing the cursor Posted by Borislav Borissov @ 12/15/2014 11:34:53 PM
RE: cursorfill() is closing the cursor Posted by Dilip Kumar @ 12/16/2014 12:10:06 PM
RE: cursorfill() is closing the cursor Posted by Borislav Borissov @ 12/16/2014 12:44:26 PM
RE: cursorfill() is closing the cursor Posted by Bernard Bout @ 12/18/2014 4:18:58 PM