Tim Bunce <[EMAIL PROTECTED]> writes:
> On Mon, Oct 18, 1999 at 07:08:09AM -0700, Michael Peppler wrote:
> > Tim Bunce writes:
> >  > On Fri, Oct 15, 1999 at 11:42:29AM +0100, Matt Sergeant wrote:
> >  > > Sadly prepare_cached doesn't always work very well - at least not with
> >  > > Sybase (and I assume MSSQL). Just a warning.
> >  > 
> >  > Could you be more specific?

Well I doubt it will be nearly as effective as it is on Oracle since I don't
think Sybase supports placeholders at the database level. I believe the DBD
driver is emulating them.

> Here's the code:
> 
>     sub prepare_cached {
>         my ($dbh, $statement, $attr, $allow_active) = @_;
...
>         if ($sth) {
>             Carp::croak("prepare_cached($statement) statement handle $sth is still 
>active")
>                 if !$allow_active && $sth->FETCH('Active');
>             return $sth;
>         }

"Croak"? That doesn't match the documentation:

 A warning will be generated if the cached $sth being returned is active
 (i.e., is a select that may still have data to be fetched) unless
 $allow_active is true.

It says "a warning" not "a fatal error". That explains my headaches  when I
tried to use prepare_cached a whie back. I never bothered to check the source
about why it was bombing out with errors instead of just warnings.

-- 
greg

Reply via email to