get_info()
$dbh->get_info(type)
This function returns information about the database handle
for the numeric code type (based on SQL standards) given as an
argument to the method. Information can include the driver and the
capabilities of the data source. The function returns
undef for an unknown type. Here is an
example:
...
use DBI::Const::GetInfoType;
...
if($dbh->get_info($GetInfoType{SQL_DBMS_VER}) lt '5.0') {
print "Old version of MySQL. Upgrade!"
};To see a list of other parameters available and their values on your server, run the following from your server:
...
use DBI;
use DBI::Const::GetInfoType;
...
while( my ($key,$value) = each(%GetInfoType) ) {
my $info = $dbh->get_info( $GetInfoType{"$key"} );
print "$key\->$info \n";
}