Set the Maximum Number of Rows Returned With Fetch-Limit - Aster Client

Teradata Aster® Client Guide

Product
Aster Client
Release Number
7.00
Published
May 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
hki1475000360386.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
B700-2005
lifecycle
previous
Product Category
Software

To limit the total number of rows returned by each query, set the fetch-limit in ACT. fetch-limit (the total number of rows fetched for a query) can be set to any value. A value less than 0 implies fetch all rows. A value greater than 0 implies fetch-limit rows in total. The default value is -1 (all rows).

When fetch-limit is used, the total row count returned for the query will be the total row count returned by the query or the row count specified by fetch-limit, whichever is smaller. For example, if a query normally returns 35,453 rows, but you have specified a fetch limit of 1000, the query will return 1000 rows (and it will display “1000 rows returned”). There will be no indication that there were in fact 35,453 rows that would have been returned had you not had a fetch limit set.

In ACT, you set the fetch-limit by typing:

\set fetch-limit  n

where n is the maximum number of rows a single query will be allowed to return.