Skip to main content
vempatir680997
May 8, 2025
Question

need help with fetching the data using the entity

  • May 8, 2025
  • 18 replies
  • 0 views

Hi team i am unable to fetching the data using the query entity,
due to some restrictions i have to use the CDT only so i am using query entity for fetching  the data,
(I want this data for displaying into the read-only grid)
i have 2 tables in DB


1st table having the 42 columns and 26191 rows of data so i am using the below code for fetching the hole data 

a!queryEntity(
entity: cons!1stentity,
query: a!query(
pagingInfo: a!defaultValue(
value: ri!pagingInfo(Type:pagingInfo),
default: a!pagingInfo(startIndex: 1, batchSize: 10)
),


),
fetchTotalCount: true(),

),


but using this code i can able to fetch 21568 rows of data only not able to fetch the whole data,


2nd table having the 8 columns and 389434 rows of data so i am using the below code for fetching the whole data.

a!queryEntity(
entity: cons!2ndentity,
query: a!query(
pagingInfo: a!defaultValue(
value: ri!pagingInfo,
default: a!pagingInfo(startIndex: 1, batchSize: 10)
),


),
fetchTotalCount: true(),

),
From this table i can able to fetch the 389434 
rows of data, i mean i can able to fetch whole data,

anyone help me with this how can i achieve to fetch the whole data from 1st table without losing 

18 replies

harshas2775
May 8, 2025

why do you need all these rows at once? 

what does the total count come up in 1st query?

If you get data in batches are you able to get the last rows which are missing? 

vempatir680997
May 8, 2025

To display the data in Read-only grid also need TotalCount,

Total count is 26191,

mikes0011
Brainy
May 8, 2025
To display the data in Read-only grid also need TotalCount

I'm not sure how this is relevant - totalCount is returned even when you take a very small slice of the data in your query, as long as you set the "fetchTotalCount" parameter to TRUE.

dimitriss5700
May 8, 2025

Does the first table have duplicate rows?

sarathkumr268295
May 8, 2025

What do you mean by you can fetch only 21568 rows?
Where did you find this count?

vempatir680997
May 8, 2025

in QUERYENTITY IF I USE TOTALFETCHCOUNT:TRUE i can see only 21568 only.

sarathkumr268295
May 8, 2025

In database, you are able to see 26191 rows?? 

mikes0011
Brainy
May 8, 2025

The simple answer is: a!queryEntity() has a BUILT-IN SIZE LIMIT (i.e. total amount of data returned, unrelated to the overall number of rows).

And also: even if you COULD successfully query 21,568 rows of data successfully into a local variable, if you tried to display that all at once in a read-only grid, the form would either refuse to load or be MISERABLY slow.  And if you're planning to page it anyway, then you should be paging it at query time, not after.

sarathkumr268295
May 8, 2025

[mention:b45a4f6a20b14a008e4e0ec732a8bf98:e9ed411860ed4f2ba0265705b8793d05] , won't the query timeout when its trying to return large data?

mikes0011
Brainy
May 8, 2025

It'll time out if the query is not performant (i.e. slow views, etc).  But the Memory Circuit Breaker is separate from this and will prevent a data set over a certain size from being returned.