Page 1 of 1

Limit returned rows for TOraQuery

Posted: Wed 31 Mar 2010 09:02
by plobry
I want to limit the result of my Query. Actually, the query looks like

'SELECT Name
FROM Clients'

and I limit the quantity of returned row, for example by this :

'SELECT Name
FROM clients
WHERE rowNum = 5'

How can I do this with the component ?

I searched on this forum, and saw that the propertie 'fetchrows' cannot do this.

thanks a lot

Posted: Thu 01 Apr 2010 06:36
by jfudickar
Your query is wrong.

Use the condition "WHERE ROWNUM <= 5".

Then everything should work.

Kind regards
Jens

Posted: Thu 01 Apr 2010 07:20
by plobry
yes, this is an error, I use really 'where rownum <=5'

But, there is a propertie of the component which can return the 25 first lines for example ?

thanks

Posted: Thu 01 Apr 2010 08:54
by bork
Unfortunately, our components don't allow limiting record count. So you should set this limitation in the query. If you want to use component TOraTable then you can set condition for records count limitation by method AddWhere.