DBI Dynamic Attributes

Dynamic attributes are always associated with the last handle used (that handle is represented by $h in the descriptions below).

Where an attribute is equivalent to a method call, refer to the method call for all related documentation.

Warning: these attributes are provided as a convenience, but they do have limitations. Specifically, they have a short lifespan: because they are associated with the last handle used, they should be used only immediately after calling the method that “sets” them. If in any doubt, use the corresponding method call.

$DBI::err

Equivalent to $h->err.

$DBI::errstr

Equivalent to $h->errstr.

$DBI::state

Equivalent to $h->state.

$DBI::rows

Equivalent to $h->rows. Please refer to the documentation for the rows method.

Get Programming the Perl DBI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.