OT: this should be on dbi-users, but ...

1.  Try to fetch the first row.
2.  SELECT COUNT(*) before issuing the real SELECT.
3.  If your DBD driver support the $sth->rows method (unlikely after a 
select) you could use that.

Basically, DBI doesn't know until it tries to retrieve the first record, 
so it can't tell you until you make an attempt to read.

Dittmar, Daniel wrote:

> Is there some standard way for DBD modules to signal that a SELECT returned
> no rows? I have a customer who would like to know this before the first
> fetch. Before I invent some attribute name, I might as well ask whether
> someone else has implemented this already.
> 
> In the first version of my driver, this situation raised an error, but this
> behaviour was met with aversion.
> 
> Daniel Dittmar


-- 
   Simon Oliver

Reply via email to