How many records from a SELECT statement?

From: Erwin Dondorp <erwin_at_pcssdc.pttnwb.nl>
Date: Thu, 21 Jul 1994 07:45:19 GMT
Message-ID: <1994Jul21.074519.16041_at_pttdis.pttnwb.nl>


Hi,

In several applications I need to draw a percentage bar to monitor the status of large SELECT statements.
One of the applications works with a SELECT statement that is more or less a black box, so I cannot predict acuratelly how many records will be SELECTed.

Does anyone know a way to acuratelly predict the number of records that will be selected when given a SELECT statement? (i.e. instead of all the data I just want COUNT(*) using the same  table(s), conditions, etc)

One way to do it is to create a VIEW:

CREATE VIEW tmp_view AS <select statement>; SELECT COUNT(*) FROM tmp_view;
DROP VIEW tmp_view;

Any one know a better solution?

        (preferably without creating objects in the database)

Thanks

        Erwin

-- 
Erwin Dondorp			Xirion bv, Software and Consultancy
erwin_at_xirion.nl			Burg. Verderlaan 15X
Currently at work at: 		3454 PE  De Meern
  PTT-T-NWB-NWO-PCS-SDC 	the Netherlands
  070-3433613			Phone: +31 (0)3406-61990  Fax: 61981

Een heer van stand is geen nummer! (OBB)
Received on Thu Jul 21 1994 - 09:45:19 CEST

Original text of this message