Re: sth->prepare() setting Active?

Tim Bunce <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
Looks good. Thanks David!

Tim.

On Fri, Sep 30, 2016 at 04:03:35PM -0500, David Nicol wrote:
> sorry, this one is better
> 
>        "Active"
> 
>        Type: boolean, read-only
> 
>        The "Active" attribute is true if the handle object is "active". This
>        is rarely used in applications. The exact meaning of active depends on
>        the database driver, but some aspects of the semantics are defined for
>        interoperability. These include:
> 
>        o   For a database handle, active typically means that the handle is
>            connected to a database ("$dbh->disconnect" sets "Active" off).
> 
>        o   For a statement handle it typically means that the handle is a
>            "SELECT" that may have more data to fetch. (Fetching all the data
>            or calling "$sth->finish" sets "Active" off.)
> 
>        o   Prepared statement handles that must have "execute" called on them
>            before they will return data should not be active until that
>            happens.

> --- DBI.pm_orig	2016-09-30 15:28:20.000000000 -0500
> +++ DBI.pm	2016-09-30 15:59:26.000000000 -0500
> @@ -3595,13 +3595,29 @@
>  Type: boolean, read-only
>  
>  The C<Active> attribute is true if the handle object is "active". This is rarely used in
> -applications. The exact meaning of active is somewhat vague at the
> -moment. For a database handle it typically means that the handle is
> -connected to a database (C<$dbh-E<gt>disconnect> sets C<Active> off).  For
> -a statement handle it typically means that the handle is a C<SELECT>
> +applications. The exact meaning of active depends on the database driver, but some aspects
> +of the semantics are defined for interoperability. These include:
> +
> +=over
> +
> +=item
> +
> +For a database handle, active typically means that the handle is
> +connected to a database (C<$dbh-E<gt>disconnect> sets C<Active> off).
> +
> +=item
> +
> +For a statement handle it typically means that the handle is a C<SELECT>
>  that may have more data to fetch. (Fetching all the data or calling C<$sth-E<gt>finish>
>  sets C<Active> off.)
>  
> +=item
> +
> +Prepared statement handles that must have C<execute> called on them before they will return data
> +should not be active until that happens.
> +
> +=back
> +
>  =head3 C<Executed>
>  
>  Type: boolean
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.