Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT SQL ..... how can I break the query after N recor
Message
 
To
23/06/1999 08:01:46
Kenneth Downs
Secure Data Software, Inc.
New York, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00232850
Message ID:
00232896
Views:
16
Ok Kenneth,

this is the problem :
user before to start to click the query button have to insert in some field the data for which create the where expression, if the user specify a very large filter the query will return thousands rows as result and it will take minutes to do this (working with large tables), and often the user don't want this result because is too large, so he refines the query.
What I'm looking for it's to stop query when it's take too much time and notify this to the user.

In Oracle you can do this with the rownum <= 1000 clause, and it stop after to have found 1000 rows of result. I don't know how to do this in foxpro.

The TOP N clause I think it will find ALL the result and then return only the first N, so if the query can return 250000 rows it will take time.
If user make a mistake using the interface I cannot let the app work for minutes without a result.

I hope to have clarify the problem
Thanks for your interest

Renato



>Renato,
>
>Can you clarify why you don't want to use the TOP n clause? I'm not sure I understand your objection.
>
>>hi to all,
>>
>>In a SELECT SQL written in Oracle you can insert in the where expression a clause to stop the query after to have found N records, and you can do this with :
>>
>>SELECT .... WHERE .... AND rownum <= 500
>>
>>Can I do this with FoxPro ?
>>I don't want to use a TOP N because this before return all row and after count the rows.
>>I'm looking for something that force the user to do a query with a normal return or a partial return (if the query return 10000 customer I think that the user will refine the query)
>>
>>TIA
>>Renato
Renato Bertuol (EMail:renato.bertuol@elmec.it
Homepage:www.geocities.com/SiliconValley/Horizon/3216)
Elmec Informatica (URL www.elmec.it)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform