in reply to Re: sth fetch only grabbing back first result
in thread sth fetch only grabbing back first result

Maybe I'm being dense, but I don't see how this solves the OP's problem. The bind_columns/fetch code looks right to me. I think it's probably an SQL or data problem.

Replies are listed 'Best First'.
Re^3: sth fetch only grabbing back first result
by webfiend (Vicar) on Aug 10, 2006 at 22:30 UTC

    It may not solve Anonymous Monk's problem, but it does remove a specific issue: fetch is not a documented method of statement handles, so its behavior is effectively undefined. Switching to a documented method such as fetchrow_hashref should result in predictable behavior from the statement handle, which lets us focus on whatever may be causing the behavior. And if changing to the defined method results in the problem going away, well that's just groovy.

    Update: Okay, so it is documented after all. Took me a while to scan through DBI, but fetch is an alias for fetchrow_arrayref with the apparent difference that:

    If any method except fetch fails, and "RaiseError" is not set, selectcol_arrayref will return undef. If fetch fails and "RaiseError" is not set, then it will return with whatever data it has fetched thus far. $DBI::err should be checked to catch that.

    So it's there in the docs after all, but it's not nearly as well defined as the others. That's what I get for just scanning through the headers of the POD rather than looking at the examples. Oy.

Re^3: sth fetch only grabbing back first result
by gcalexander (Novice) on Aug 12, 2006 at 03:35 UTC
    Yeah, I'm an idiot. Sorry about the response. Should have picked up the err in the SQL.