Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Equivalent of LIMIT in informix

427 views
Skip to first unread message

Diane

unread,
Jun 21, 2002, 7:40:24 PM6/21/02
to
Hi,
MYSql has a LIMIT keyword which retrieves the record from database as
follows.
select * from MyTable LIMIT 10,20 -> result row 11 to 30

Similarly oracle has rownum feature. My requirement is if I have 50
records in a table, I need to show 10 records at a time and if the
user click next, I should get the next 10 records. Is there a
equivalent in informix?

Thanks

Jonathan Leffler

unread,
Jun 22, 2002, 12:18:12 AM6/22/02
to
Diane wrote:


No, there isn't a direct equivalent. The nearest approximation is
SELECT FIRST n ...

but that only does half the job. Of course, with a scroll cursor, you
could use SELECT FIRST 20 ... followed by do FETCH ABSOLUTE 10 to get
the 10th record and then repeat till you reach the end, but it is
somewhat circuitous...


--
Jonathan Leffler (jlef...@earthlink.net, jlef...@us.ibm.com) #include
<disclaimer.h>
Guardian of DBD::Informix 1.00.PC2 -- http://dbi.perl.org/

Nebojsa Sevo

unread,
Jun 24, 2002, 3:50:26 AM6/24/02
to

That is not question for database - it is question for tool you are using.
In Inormix 4GL and in Panther it is simple.
1. declare cursor for select
2. define array in your application with 10 elements
3. open cursor
4. fetch cursor into array
5. when user click next just continue (down) with cursor

Nebojsa
------------------------------------
Remove spam block (DELETE) to reply

0 new messages