|
#! c:/perl/bin/perl.exe my $filePath = "D://malware//ixigua.exe"; print 'insert_id=',$id, "/n"; warn( $DBI::errstr ) if $DBI::err; ================================================
注释: 若数据库插入语句不用参数预留,操作就失败,原因没有找到? my $insertStr = "insert into `SIMPLE_BODY` ( SIMPLE_SIZE, SIMPLE_BODY) values( $fileLen, $data);"; #不预留参数而直接填充 my $sth = $dbh->prepare( $insertStr ) or die("Cannot prepare statement:", $dbh->errstr(),"/n"); my $rc = $sth->execute() or die("Cannot execute statement:", $sth->errstr(), "/n"); |
Perl: 向mysql数据库插入二进制字段
最新推荐文章于 2024-05-30 13:53:22 发布
本文介绍如何使用Perl向MySQL数据库中插入二进制文件数据,并获取最新插入记录的自增ID。涉及Perl模块如DBI、DBD::mysql等的使用方法,以及在操作过程中确保数据正确性和完整性的技巧。
Perl: 向mysql数据库插入二进制字段, 并返回所插入记录的自动增长字段的值
2007-10-27 13:47
5万+

被折叠的 条评论
为什么被折叠?



