Re:SQL Problem
Posted in 1998
I functions but i prefer using the dbinfo function.
Example:
select dbinfo('sqlca.sqlerrd2'), field1,field2
from table1
You just required to aggregated the dbinfo function to get the number
of rows returned by your select statement.
dbinfo:
sqlca.sqlerrd1 returns the number of a serial insert
sqlca.sqlerrd2 returns the number of rows returned by a query
Hope this helps
Regards
Javier
Siebe de Klaver wrote:
>
> Hello All,
>
> I'm using informix-esql/c.
>
> problem : I want to know the number of rows a select statement returns.
[SNIP]
> Any suggestions ?
You are missing the obvious:
SELECT COUNT(*) FROM ...
Using the same FROM and WHERE clauses. For many multi-table joins you
may be able to identify one table and its filter clauses as defining
the number of rows that will be returned and can therefore simplify
the count(*) statements so it runs faster.
Art S. Kagel