Perl DBI Functions

Below is a list of Perl DBI functions. Click on a function in the list to see more information about it, including its syntax, an explanation of its use, and examples of how it may be used to interface with MySQL.

available_drivers( )

This Perl DBI function returns a list of available DBD drivers, which may be used with MySQL.

begin_work( )

This Perl DBI function is used for transactions with a MySQL database.

bind_col( )

This Perl DBI function associates or binds a MySQL column from a statement handle to a given variable.

bind_columns( )

This Perl DBI function associates or binds MySQL columns from a statement handle to a given list of variables.

bind_param( )

This Perl DBI function associates or binds a value in a MySQL statement to a placeholder.

bind_param_array( )

This Perl DBI function associates or binds an array of values in a MySQL statement within a prepare( ) using placeholders.

bind_param_inout( )

This Perl DBI function associates or binds a value in a MySQL statement using a placeholder.

can( )

This Perl DBI function returns true if the method named is implemented by the driver used to connect to MySQL.

clone( )

Use this Perl DBI function to create a new Perl DBI database handle by reusing the parameters of the MySQL database handle calling the method.

column_info( )

This Perl DBI function returns a statement handle for fetching information about columns in a MySQL table.

commit( )

This Perl DBI function commits or makes permanent changes to a MySQL database, for transactional tables (e.g., InnoDB).

connect( )

Use this Perl DBI function method to establish a connection to MySQL and to select the default MySQL database.

connect_cached( )

This Perl DBI function is similar to the Perl DBI function connect( ), except that the database handle for MySQL is stored in a hash with the given parameters.

data_diff( )

This Perl DBI function returns the results of both the Perl DBI functions data_string_desc( ) and data_string_diff( ) related to MySQL, describing the difference between the two given strings.

data_sources( )

This Perl DBI function returns a list of MySQL databases associated with a given driver.

data_string_desc( )

This Perl DBI function returns a description of given string, which could be from MySQL.

data_string_diff( )

This Perl DBI function returns a description of the difference between two given strings, which could be columns from MySQL.

disconnect( )

This disconnects a Perl program from a database; it ends a MySQL session.

do( )

This Perl DBI function executes a MySQL statement without having to use the Perl DBI prepare( ) method.

dump_results( )

This Perl DBI function displays the results of a MySQL statement using the Perl DBI function neat_list( ) on each row for the statement handle given.

err( )

This Perl DBI function returns any MySQL error codes from the last driver method call.

errstr( )

This Perl DBI function returns any MySQL error messages from the last driver method called by the current MySQL connection.

execute( )

This Perl DBI function executes a MySQL statement handle that has been processed with the prepare( ) method.

execute_array( )

Use this Perl DBI function to execute a prepared MySQL statement multiple times, once for each set of values given either as the second argument of the method or from previous uses of the bind_param_array( ) method.

execute_for_fetch( )

Use this Perl DBI method to execute multiple MySQL statements given as the argument of the method, as a sub method.

fetch( )

This Perl DBI function returns a reference in memory to an array of one row from the results of a MySQL statement handle.

fetchall_arrayref( )

This Perl DBI function captures the results of a MySQL statement and returns a reference in memory to the data.

This Perl DBI method captures the result of a MySQL statement and returns a reference in memory to the data.

fetchrow_array( )

This MySQL statement handle method of Perl DBI returns one row, the next from the results of a MySQL statement in the form of an array, each of whose element is a field of data.

fetchrow_arrayref( )

This Perl DBI function returns a reference to a place in memory containing an array of one row, the next row from the results of a MySQL statement handle.

fetchrow_hashref( )

This Perl DBI function returns a reference to a place in memory containing a hash of keys and values for one row from the results of a MySQL statement handle.

finish( )

This Perl DBI method ends a MySQL statement handle given that was established by the Perl DBI prepare( ) method.

foreign_key_info( )

This Perl DBI function returns a MySQL statement handle for fetching information about foreign keys in a given MySQL table.

func( )

This Perl DBI function calls private non-portable and non-standard methods for handles related to MySQL.

get_info( )

This Perl DBI function returns information about the MySQL database handle for the numeric code type (based on SQL standards) given as an argument to the method.

installed_drivers( )

This Perl DBI function returns a hash listing driver names and handles related to MySQL that were loaded for the current process.

installed_versions( )

This Perl DBI function returns a list of installed drivers on MySQL.

looks_like_number( )

This Perl DBI method is used for testing a given array to determine if each element seems to be a number or not.

neat( )

This Perl DBI function returns a string or MySQL column given as the first argument of the function, placed in quotes, for an optional maximum length given as the second argument.

neat_list( )

This Perl DBI function returns a list of strings or MySQL columns given as the first argument of the function, placed in quotes, each truncated to an optional maximum length given as the second argument.

parse_dsn( )

This Perl DBI function returns the components of the DBI Data Source Name (DSN) values: the scheme; the driver used to connect with MySQL; an optional attribute string; a reference to a hash with the attribute names and values; and the DSN DBI string.

parse_trace_flag( )

This Perl DBI function returns a bit flag for a trace flag name given as an argument to this method used with MySQL.

parse_trace_flags( )

Use this Perl DBI function to parse a string or MySQL column given as an argument that contains a list of trace settings.

ping( )

Use this Perl DBI function to determine if a MySQL server is still running and the database connection is still available.

prepare( )

This Perl DBI function creates a statement handle by preparing a MySQL statement given as the first argument for subsequent execution with Perl DBI execute( ) function.

primary_key( )

This Perl DBI function is meant to return a list of primary key column names for a given MySQL table.

primary_key_info( )

This Perl DBI function is meant to return a statement handle for fetching information about primary key columns for a MySQL table.

private_attribute_info( )

This Perl DBI function is meant to return a reference to a hash containing the private attributes available for the MySQL handle from which it is called.

quote_identifier( )

Use this Perl DBI function to escape special characters of an identifier (e.g., a MySQL database, table, or column name) for use in an MySQL statement.

rollback( )

Use this Perl DBI function to undo a transaction in MySQL which has not yet been committed.

rows( )

This Perl DBI function returns the number of rows in the related MySQL table that was affected by the last statement handle executed for the current MySQL connection.

This Perl DBI function returns a reference to an array, which is the results set of the MySQL statement executed.

This Perl DBI function returns a reference to a hash of reference to hashes, one for each row from the results of a MySQL statement given.

This Perl DBI function returns a reference to an array containing a value in the first column of each row selected from a MySQL table.

This Perl DBI function returns one row from the results of a MySQL statement in the form of an array, where each column returned is represented by an element of the array, in order.

This Perl DBI function returns a reference to an array of one row from the results of a MySQL statement given.

This Perl DBI function returns a reference to a hash of one row from the results of a MySQL statement given.

set_err( )

This Perl DBI function sets the values for err, errstr, and state for the related MySQL handle.

state( )

This Perl DBI method returns the MySQL error code of an error in a five-character format, in the SQLSTATE format.

statistics_info( )

This Perl DBI method is meant to return an active statement handle that can be used to retrieve statistical information about a given MySQL table and its indexes.

swap_inner_handle( )

This Perl DBI method is used to swap handles related to MySQL.

tables( )

This Perl DBI function returns an array containing a list of MySQL tables and views for a database handle.

table_info( )

This Perl DBI function returns a statement handle for fetching information about the MySQL tables in a given database.

take_imp_data( )

This Perl DBI method severs the MySQL database handle that calls it from the API connection data.

trace( )

This Perl DBI function sets the trace level for a handle used with MySQL.

trace_msg( )

This Perl DBI function adds text or a MySQL column given in first argument to trace data.

type_info( )

This Perl DBI function returns a hash containing information on a given MySQL datatype.

type_info_all( )

This Perl DBI function returns a reference to an array of all MySQL datatypes supported by the driver.