in reply to DBI (Prepare once execute many fails)
I can't tell you for sure the cause of this strange behavior, but there are a couple of things that are worth saying about your problem.
HTH
Update
Just to explain better my story. The call to finish is always necessary. There are times when the DBI calls finish implicitly, for example, when you use a call to fetchall_* or selectall_* functions. The finish is also implicit when the fetch function is inside a loop. In all the other cases, you should call it. And, just to be paranoid, if you call it even after a loop, you don't do any damage. :)
A driver can be implemented in such a way that a call to finish is not necessary. For example, if the driver uses some sort of "fetch-at-once" mechanism, then the finish is not needed, because the driver itself, internally, has already retrieved ALL the records.
Update (2)
The DBI docs say that the driver should call finish "when all the data has been fetched." The driver has two ways of know that *ALL* the data is fetched: either you call a "fetch-all-at-once" routine or you call a "fetchrow_*" in a loop until it returns undef. When one of these cases happen, the driver calls finish.
If you call a fetchrow_* function only once, the driver does not know if there is more data to fetch or not.
_ _ _ _ (_|| | |(_|>< _|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: DBI (Prepare once execute many fails)
by dws (Chancellor) on Jun 06, 2003 at 09:06 UTC |