Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!ukc!reading!riddle!john From: john@riddle.UUCP (Jonathan Leffler) Newsgroups: comp.databases Subject: Re: Number of Rows from an Informix ESQL statement. Message-ID: <1055@riddle.UUCP> Date: 18 Dec 89 10:17:10 GMT References: <590@aut.UUCP> Reply-To: john@sphinx.co.uk (Jonathan Leffler) Organization: Sphinx Ltd., Maidenhead, England Lines: 28 In article bochner@lange.harvard.edu (Harry Bochner) writes: >I don't know about ESQL, but from Informix 4gl there really doesn't seem >to be a way to get at the number of rows found. >What really irks me about this is that you can tell that the internals >do return the answer: the preprogrammed Query-By-Example processor (perform) >always informs you of the number of rows, and clearly doesn't spend any >extra time on it. They've got the information, but didn't provide a 4gl >interface to it. In article <590@aut.UUCP> lincoln@aut.UUCP (Philip Lincoln) writes: > How can (if it's possible) you tell the number of rows > returned by an Informix-ESQL "open" statement that runs a > declared select query?? i.e. the number of rows in the > active set. The manual has been no help. First, even though OPEN executes the query, it does not return any rows at all. You cannot tell how many rows will be returned by the select until you have fetched all the rows. I think you will find that Perform essentially fetches the rowids of the rows it will display, and counts them while doing it, and then fetches the first row of data using the rowid. Perform may not actually use rowid -- it should use a set of columns with a unique index on if possible -- but that is about the gist of what it does. Jonathan Leffler (john@sphinx.co.uk) #include