Hi Curt,
Curt Russell Crandall wrote:
> I ran into a similar problem with Sybase. I had a statement prepared
> using placeholders (a select statement) and I had to loop several times as
> I processed transactions and each time through the loop I had to execute
> the prepared statement. Perl and/or Sybase complained that I needed to
> finish the statement handle.
maybe the reason for that was, that you had several data sets
returned by 1 statement and you had to use this way (described
in "perldoc DBD::Sybase"):
do {
while($d = $sth->fetch) {
... do something with the data
}
} while($sth->{syb_more_results});
Regards
Alex
> Using finish doesn't mean you have to keep repreparing the statement
> handle... according to the Cheetah book, it's a rarely used functions used
> for "internal housekeeping". In my program, I prepare my frequently used
> select statements in an init method and assign the statement handle to an
> object attribute. I have no need to prepare the statement more than once
> and explicitly finish()'ing a handle after a fetch* didn't cause any
> noticable decrease in performance. So I don't think using finish is any
> sort of a "nasty workaround". I would just try to remove the multiple
> prepare()'s and prepare the statement up front, then just finish() after
> each fetch*. Hope it helps.