Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT SQL ..... how can I break the query after N recor
Message
From
23/06/1999 10:34:37
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00232850
Message ID:
00232987
Views:
18
I have found that adding a count to find the number of records that would be selected and display it to the user saying what would be selected, along with a retry or continue buttons. Of course the user is selecting options on a screen, and the program is building the query. But, if the count says 10000 matches and they want much less, they know to change options and count again. Once they are "ok" with the count, the press a continue button.

Norm


>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
____________________________________________

Norm Peterson

It's a dog eat dog world out there,
and I'm wear'n milk bone underware!
Previous
Reply
Map
View

Click here to load this message in the networking platform