Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LIMIT in FoxPro

Tags:

sql

limit

foxpro

I am attempting to pull ALOT of data from a fox pro database, work with it and insert it into a mysql db. It is too much to do all at once so want to do it in batches of say 10 000 records. What is the equivalent to LIMIT 5, 10 in Fox Pro SQL, would like a select statement like

select name, address from people limit 5, 10;

ie only get 10 results back, starting at the 5th. Have looked around online and they only make mention of top which is obviously not of much use.

like image 923
Matthew Hood Avatar asked Mar 23 '09 10:03

Matthew Hood


People also ask

What is the maximum width Foxpro provide in a field?

The maximum combined width of all fields in one record is 4000 bytes, excluding Memo fields.


2 Answers

Take a look at the RecNo() function.

like image 159
Eyvind Avatar answered Sep 20 '22 12:09

Eyvind


FoxPro does not have direct support for a LIMIT clause. It does have "TOP nn" but that only provides the "top-most records" within a given percentage, and even that has a limitation of 32k records returned (maximum).

You might be better off dumping the data as a CSV, or if that isn't practical (due to size issues), writing a small FoxPro script that auto-generates a series of BEGIN-INSERT(x10000)-COMMIT statements that dump to a series of text files. Of course, you would need a FoxPro development environment for this, so this may not apply to your situation...

like image 21
Avery Payne Avatar answered Sep 20 '22 12:09

Avery Payne