LPM: DBI woes

Rich Bowen rbowen at rcbowen.com
Fri Feb 25 08:57:31 CST 2000


Mik Firestone wrote:
> 
> On Fri, 25 Feb 2000, Joe Hourcle wrote:
> 
> >
> > If it's returning an array ref, can't you just do:
> >
> >       ($day) = $sth->fetch;
> >
> > (I'd look up how I normally do things, but I don't have my normal access
> > right now)
> >
> I do not think that will do what you think it will.  $str->fetch returns a
> reference - which is a scalar thingy.  You are trying to coerce a scalar into
> a list context and I believe the perl docs explicitly state the results are
> undefined.  Without a great deal of testing, I think $sth->fetch->[0] would
> work.  Still doesn't solve Rich's problem, though.

I think I'm convinced that this is some sort of bizarre problem with the
MS Access driver. I certainly don't get this every-other behavior with
MySQL. This code was just supposed to work on MS Access, and, of course,
MS has chosen to do some things differently.

Helpful (but completely unrelated) tip: With MS Access, you can't say,
in a SQL statement  ...

	where ID != 1

This causes the ODBC driver to choke. You have to say

	where ID <> 1

Isn't that good to know?

Rich
-- 
http://www.ApacheUnleashed.com/
Lexington Perl Mongers - http://lexington.pm.org/
PGP Key - http://www.rcbowen.com/pgp.txt



More information about the Lexington-pm mailing list