Re: Constructed Select and Row
Posted in 1993
In-Reply-To: <duhonCAu35B.MFt@netcom.com> duhon@netcom.com (Joey Duhon) TITLE: Constructed Select and Row Count In <duhonCAu35B.MFt@netcom.com> Joey Duhon asks: > I'm doing a select with a "construct" (using a cursor) in 4GL. > I was hoping that after opening (or at least after the 1st fetch) > sqlerrd[3] would have the wor count. I can't seem to get this value > anyway i try. > Is there a trick to getting this value, or should i give up? The only real solution is to: a. Create a SELECT COUNT(*) statement from your CONSTRUCT query and use that result, then SELECT <whatever> as you normally would. b. Create your query, DECLARE a cursor, run a FOREACH loop with that cursor incrementing a counter for each row, then at the end use the value of the counter. You can then do what ever it is you were going to do in the first place. As you can see there is no real way of achieving what you want without effectively doing 2 SELECTs. ***************************************************************************** * Stuart Hemming, Tudor Labels Ltd, Roman Bank, Bourne, Lincs, PE10 9LQ. UK * * shemminga@cix.compulink.co.uk uunet!cix.compulink.co.uk!shemminga * * Tel : (+44) 778 426444 Fax : (+44) 778 421862 * ******************** PGP 2.2 sig available on request ***********************