4D v13.4

SET QUERY LIMIT

Home

 
4D v13.4
SET QUERY LIMIT

SET QUERY LIMIT 


 

SET QUERY LIMIT ( limit ) 
Parameter Type   Description
limit  Longint in Number of records, or 0 for no limit

SET QUERY LIMIT allows you to tell 4D to stop any subsequent query for the current process as soon as at least the number of records you pass in limit has been found.

For example, if you pass limit equal to 1, any subsequent query will stop browsing an index or the data file as soon as one record that matches the query conditions has been found.

To restore queries with no limit, call SET QUERY LIMIT again with limit equal to 0.

Warning: SET QUERY LIMIT affects all the subsequent queries made within the current process. REMEMBER to always counterbalance a call to SET QUERY LIMIT(limit) (where limit>0) with a call to SET QUERY LIMIT(0) in order to restore queries with no limit.

SET QUERY LIMIT changes the behavior of the query commands:

On the other hand, SET QUERY LIMIT does not affect the other commands that may change the current selection of a table, such as ALL RECORDS, RELATE MANY, and so on.

To perform a query corresponding to the request “...give me any ten customers whose gross sales are greater than $1 M...”, you would write:

 SET QUERY LIMIT(10)
 QUERY([Customers];[Customers]Gross sales>1000000)
 SET QUERY LIMIT(0)

See the second example for the command SET QUERY DESTINATION.

 
PROPERTIES 

Product: 4D
Theme: Queries
Number: 395

 
INDEX

Alphabetical list of commands

 
HISTORY 

Modified: 4D v11 SQL

 
SEE ALSO 

Get query limit
QUERY
QUERY BY EXAMPLE
QUERY BY FORMULA
QUERY BY SQL
QUERY SELECTION
QUERY SELECTION BY FORMULA
QUERY WITH ARRAY
SET QUERY DESTINATION