I have one script in which I am connecting to database and trying to eexecute the sql query. My code is like this
use DBI;
$dbh = DBI->connect('Databasename', 'uid','pswd');
my $sth = $dbh->prepare ("select * from Tablename");
$sth->execute();
my @row_ary = $sth->hetshrow_array;
foreach $item (@row_ary)
{
print "$item\n";
}
when I am trying to execute this code I am getting the following error message
Can't connect to data source 'Databasename' because I can't work out what driver to use (it doesn't seem to contain a 'dbi:driver:' prefix and the DBI_DRIVER env var is not set) at demo.pl line 2
Can anybody please suggest me why I am getting this message. What is the configuration I need to do for executing sql queries.
Thanks