Limit returned rows for TOraQuery

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
plobry
Posts: 6
Joined: Wed 31 Mar 2010 08:17

Limit returned rows for TOraQuery

Post by plobry » Wed 31 Mar 2010 09:02

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

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Post by jfudickar » Thu 01 Apr 2010 06:36

Your query is wrong.

Use the condition "WHERE ROWNUM <= 5".

Then everything should work.

Kind regards
Jens

plobry
Posts: 6
Joined: Wed 31 Mar 2010 08:17

Post by plobry » Thu 01 Apr 2010 07:20

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

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Thu 01 Apr 2010 08:54

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.

Post Reply