Re: Query Hits Question

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 1997/04/16
Message-ID: <5j2sch$hjp_at_info.csufresno.edu>#1/1


In article <01bc4a84$b72dc5a0$50386883_at_wayne.uoguelph.ca>, Wayne Marsh <wayne_at_ornet.or.uoguelph.ca> wrote:
>Perhaps someone can help me on this one. I am setting a query
>programmatically in a Form45 application. I have no problem setting the
>DEFAULT_WHERE property in a Pre-Query trigger. I would like to display the
>number of records returned by the query with the current record number as
>the user scrolls through the block populated by the query (ie record x of
>y). I have tried to use the QUERY_HITS block property but with no success.
>My solution has been to enter the block, go to the last record to get the
>record number for the total and then back to the first record but this
>seems rather cludgy. Does anyone know if the QUERY_HITS property can be
>used instead and how?
>--
>Wayne Marsh
>University of Guelph

Before you do an Execute_Query, do a Count_Query and trap the FRM-40355 message in an on-message trigger and extract the count from the message.

  • or --- Before you do an Execute_Query, execute your own Select count(*) from table where..., using the default_where clause.

Either of the above will slow down your query of the first rows into the block, especially if it is a potentially large table and the where clause causes a full-table scan, so be prepared for a wait. This method will not however take as long as your "cludgy" method above.

HTH,
Steve Cosner
http://members.aol.com/stevec5088 Received on Wed Apr 16 1997 - 00:00:00 CEST

Original text of this message