Limit the size of the data returned by the query

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
flyfire
Posts: 4
Joined: Sat 15 Dec 2018 01:14

Limit the size of the data returned by the query

Post by flyfire » Sat 15 Dec 2018 01:21

Hi,
Excuse me, there is method or attribute for the unidac component, which can limit the size of UniQuery receiving data, such as 20MB.
Sometimes executed SQL statement, the returned data is too large.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Limit the size of the data returned by the query

Post by azyk » Tue 18 Dec 2018 11:33

You can fetch a dataset by pieces. For this, set TUniQuery.FetchAll to False. You can set a limit of fetched data in the TUniQuery.FetchRows property.

FetchAll: https://www.devart.com/unidac/docs/deva ... tchall.htm
FetchRows: https://www.devart.com/unidac/docs/deva ... chrows.htm

flyfire
Posts: 4
Joined: Sat 15 Dec 2018 01:14

Re: Limit the size of the data returned by the query

Post by flyfire » Wed 19 Dec 2018 06:43

This is also a method, but sometimes it is not convenient.
For example, when a user queries data for several months, I want to limit the size of the data.
When the size exceeds the set value, an exception is reported.

Use this method before there is no better way.

Thank you

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Limit the size of the data returned by the query

Post by azyk » Wed 19 Dec 2018 12:30

Please specify the DBMS you are using.

flyfire
Posts: 4
Joined: Sat 15 Dec 2018 01:14

Re: Limit the size of the data returned by the query

Post by flyfire » Wed 19 Dec 2018 13:36

MS SQL Server 2005

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Limit the size of the data returned by the query

Post by azyk » Thu 20 Dec 2018 11:26

TSQLServerUniProvider does not have a separate feature to limit data size fetching. Try searching for a ready-made solution at specialized forums.

flyfire
Posts: 4
Joined: Sat 15 Dec 2018 01:14

Re: Limit the size of the data returned by the query

Post by flyfire » Fri 21 Dec 2018 00:24

Thank you .

Post Reply