Simple query max record is not working

Simple query max record is not working

  
Hi
i am using simple query in my application. Query fetches nealy a lot of data. But i want to restrict it to 2000. I am giving value to max record parameter to simple query. But it is fetching the same records only. Can you please tell me how can i restrict no of data in simple query?

Thanks
Harsha
Hi Harsha,

I'm not entirely sure what you mean, due to your somewhat broken English. What do you mean by "nealy a lot of data"? What "same records only" are fetched?

That said, the Max. Records should indeed limit the number of records to the number specified.
i am having 2 lacs records in my table but i want only 2000 records. For that i am using simple query and in simple query i am giving max records=2000. But it is not working. It is fetching all the records.
Harsha,

How did you establish that it is actually fetching more?
i am displaying these records in grid on the page.if it is working fine it should display only 2000 records. But it is showing 2lacs records on the page. Because of that page is very slow.
That's not what I would expect. As far as I've encountered, Simple Queries actually abide by the specified Max. Records.

So you have a Table Records (you say "grid", but I assume it's a Table Records), that has it's Line Count set to a very large number, so the 200.000 records are actually all displayed? I would expect the page to be already very slow with 2000 records. You'd typically implement paging, and set the Max. Records much lower.

Btw, for the average non-Indian, "lac" is not something they'd understand :).
ok i will try thanks.