[comp.databases] Informix/ESQL Question

benw@packard.UUCP (B Weber) (08/03/87)

I'm a relative newcomer to Informix, so bear with me...

I'm using ESQL to manage my database.

My question is:  Is there any way to do a select so that Informix
just searches for a specified number of data items?

For instance, suppose we have 100000 records in a table...maybe
8000 are of the kind we are interested in.  However, the user
wants a report that just lists 5 of them (any five).  Right
now we are using a cursor to do a select (of the 8000 records),
and then doing 5 fetches to get five items for the report.

Obviously, it is a tremendous waste of time to search the
whole table, only to actually use a tiny number of the
data items returned.  So, is there any way to get something
equivalent to "Select 5 items from ... where...."?

					Thanks,
					Ben Weber
					AT&T Technologies
					Liberty Corner, NJ
					ficit|packard!benw