Re: Select count(*) problem
Posted in 2000
David Williams wrote: > > In article <8geqpa$f2p$1@news.xmission.com>, Mark D. Stock <mdstock@myda > s.freeserve.co.uk> writes > > > >So I am afraid using sqlca.sqlerrd2 is not an option unless it is in a > >subsequent SELECT, but then you might as well use COUNT(*). ;-) > > > > At least under 4gl sqlca.sqlerrd[2] (or whichever one has the count of > in rows processed it) is NOT defined to work for select statements! In 4GL it is SQLCA.SQLERRD[3], but we are looking at the DBINFO function. The manual explicitly includes SELECT statements: " Using the 'sqlca.sqlerrd2' Option The 'sqlca.sqlerrd2' option returns a single integer that provides the number of rows that SELECT, INSERT, DELETE, UPDATE, and EXECUTE PROCEDURE statements processed. To ensure valid results, use this option after SELECT and EXECUTE PROCEDURE statements have completed executing. In addition, to ensure valid results when you use this option within cursors, make sure that all rows are fetched before the cursors are closed. " Cheers, -- Mark. +----------------------------------------------------------+-----------+ | Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /| | http://www.informix.com http://www.informixhandbook.com |///// / //| | http://www.iiug.org +-----------------------------------+//// / ///| | |This email will self-destruct in |/// / ////| | |10 sec. If you received this email |// / /////| | |in error, sorry about the mess. |/ ////////| +----------------------+-----------------------------------+-----------+