Hi.
I understand that DBI::err is very transient. My question is, is it going to
get overwritten in between the different calls in selectcol_array?
That is, I'm doing:
my $arrayref = $dbh->selectcol_arrayref($statement, undef, @bind)
or die($dbh->errstr());
my @arr = @$arrayref;
I realized that this won't check for all possible errors, because if there's
an error during selectcol's first fetch, it will just return [] (as far as I
can tell, from the docs saying it returns "all the information it has so
far").
I could add:
die $dbh->errstr() if !@arr && $DBI::err;
Or, I could do just one test by changing the code to:
my $arrayref = $dbh->selectcol_arrayref($statement, undef, @bind);
die($dbh->errstr()) if $DBI::err;
my @arr = @$arrayref;
However, both these methods require that DBI::err will still be set at the
right time. So, will either these work, or is there a different way to do
it?
Amir Karger
Curagen Corporation
LEGAL NOTICE - Unless expressly stated otherwise, this message is
confidential and may be privileged. It is intended for the addressee(s)
only. Access to this e-mail by anyone else is unauthorized. If you are not
an addressee, any disclosure or copying of the contents or any action taken
(or not taken) in reliance on it is unauthorized and may be unlawful. If you
are not an addressee, please inform the sender immediately.