O'Reilly logo

MySQL in a Nutshell by Russell J.T. Dyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Attributes for Handles

This section lists the values that can be added to the optional %attributes hash that appears in many Perl DBI methods. The basic syntax to set an attribute is $handle->{attribute} = 'setting'; to retrieve a setting use $handle->{attribute}.

Attributes for All Handles

You can use the following attributes with both database handles and statement handles.

Active

Instructs the server that the handle should remain open until terminated explicitly by finish() or disconnect( ) depending on the handle type.

ActiveKids

Provides the number of active handles under the handle that employed the attribute. If it’s set by a database handle, then the number of active statement handles will be returned. If it’s called by a database handle, the number of active statement handles will be returned. If set by a driver handle, the number of database handles will be returned.

CacheKids

Returns a reference to a hash containing child handles for a driver or a database handle that was created by the connect_cached( ) or prepare_cached( ) methods, respectively.

ChopBlanks

Trims trailing spaces from fixed-width character columns.

CompatMode

Makes emulation layers compatible with a driver handle.

ErrCount

Counts the number of errors logged by set_err( ).

Executed

Determines whether a handle or one of its children has been executed.

FetchHashKeyName

Instructs fetchrow_hashref() calls to convert column names to either all lowercase (NAME_lc) or all uppercase (NAME_uc) letters.

HandleError ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required