use DBI; ... $sth->bind_param(1, $str, DBI::SQL_LONGVARCHAR);