$sth = $dbh->prepare("$sql") or die $dbh->errstr; $sth->execute() or die $dbh->errstr; I would double check your $sql... or possibly do multiple inserts rather than using the range operator within the sql plus it would make the code more platform independent.