my $sth = $dbh->prepare("insert into foo(data) values (?);"); $sth->bind_param(1, $value, SQL_LONGVARBINARY); $sth->execute();