"Dittmar, Daniel" wrote:
> Is there some standard way for DBD modules to signal that a SELECT returned
> no rows?
Yes; the fetch method indicates that.
> I have a customer who would like to know this before the first fetch.
In the majority of databases, the system won't know whether there is data to
fetch until the fetch is attempted. Or, in other words, the customer can
continue to wish to know about this, but in general will not be able to know
about this until attempting the first fetch.
And why is this an issue?
> Before I invent some attribute name, I might as well ask whether
> someone else has implemented this already.
An attribute for what? The number of rows returned by the SELECT? There
already is one, of course, but it is not reliable until you've fetched all the
rows anyway.
> In the first version of my driver, this situation raised an error, but this
> behaviour was met with aversion.
You need to distinguish between an error and the 'no more data' or 'no data to
fetch' situation.
The reaction was reasonable; it is not an error for a SELECT statement to
return no data. I'd be very cross indeed if "SELECT * FROM SomeTable WHERE 1 =
0" returned any data, but it is a reasonable way to find out the column names
and types for the columns in a table -- as an example.
>
> Daniel Dittmar
>
> --
> Daniel Dittmar
> [EMAIL PROTECTED]
> SAP DB, SAP Labs Berlin
> http://www.sapdb.org/
--
Jonathan Leffler ([EMAIL PROTECTED], [EMAIL PROTECTED])
Guardian of DBD::Informix 1.00.PC1 -- see http://www.cpan.org/
#include <disclaimer.h>