The following methods are available under DBI.
available_drivers |
@drivers = DBI->available_drivers([nowarn])
Returns a list of available drivers by searching @INC for the presence of DBD::* modules.
bind_col |
$result = $st_handle->bind_col(col, \variable [, \%attr ])
Binds a field of a select statement to a variable, to be updated whenever the row is fetched.
bind_columns |
$result = $st_handle->bind_columns(\%attr, @reflist )
Runs bind_col on each column of the statement.
bind_param |
$result = $st_handle->bind_param(n, value [, type ])
Binds a value with a placeholder in a prepared statement.
commit |
$result = $db_handle->commit
Commits the most recent changes. See also the AutoCommit attribute.
connect |
$db_handle = DBI->connect(data_source, user, passwd,[\%attr])
Connects to the specified database, returning a database handle object. The connect method automatically installs the driver if it has not already been installed.
DBI:$driver:database=$database;host=$hostname;port= $port
data_sources |
@drivers = DBI->data_sources(driver)
Returns a list of all databases available for the named driver. (The database server must be running for data_sources to return any results.)
do |
$rows = $db_handle->do(statement [, \%attr, @bind_values ])
Prepares and executes a statement, returning the number of rows affected.
dump_results |
$rows = DBI::dump_results(st_handle, maxlen, ldelim, fdelim, fileh)
Runs DBI::neat( ) on all the rows of a statement handle and prints them for testing purposes.
execute |
$result = $st_handle->execute([@bind_values])
Executes a prepared statement.
fetch |
$arrayref = $st_handle->fetch
Fetches the next row of data, returning an array reference with the field values.
fetchall_arrayref |
$arrayref = $st_handle->fetchall_arrayref
Fetches all data from a prepared statement and returns a reference to an array of references.
fetchrow_array |
$array = $st_handle->fetchrow_array
Fetches the next row of data, returning an array with the field values.
fetchrow_arrayref |
$arrayref = $st_handle->fetchrow_arrayref
Fetches the next row of data, returning an array reference with the field values. Synonym for fetch.
fetchrow_hashref |
$hashref = $st_handle->fetchrow_hashref
Fetches the next row of data, returning a hash reference containing the field values. The keys of the hash are the same as $st_handle->{NAME}.
func |
$handle->func(@arguments, function)
Calls a private nonportable method on the specific handle.
neat |
$newstring = DBI::neat(string, maxlength)
Converts a string to one with quoted strings, null values shown as undef, and unprintable characters shown as ".".
neat_list |
$newstring = DBI::neat_list(\@list, maxlength, delim)
Converts each element of a list with DBI::neat and returns it as a string.
prepare |
$st_handle = $db_handle->prepare(statement [, \%attr ])
Prepares a statement for execution and returns a reference to a statement handle object.
quote |
$sql = $db_handle->quote(string)
Escapes special characters in a string for use in a SQL statement.
rollback |
$result = $db_handle->rollback
Undoes the most recent database changes if not yet committed.
rows |
$rows = $st_handle->rows
Returns the number of rows affected by the last change to the database.
trace |
DBI->trace(n, filename)
trace |
$handle->trace(n, filename)
Same as the class method DBI->trace, but for a specific database, statement, or driver handle.
Copyright © 2002 O'Reilly & Associates. All rights reserved.