use strict; use DBI qw(:sql_types); my $dbh = DBI->connect("DBI:Oracle:host=172.16.21.16;sid=xxxx", 'xxxxxx', 'xxxxxxxx') or die "Connecting : $DBI::errstr\n"; open IMG, "$ARGV[0]" or die "Couldn't open $ARGV[0]: $!\n"; binmode(IMG); undef $/; $image = ; $hex = unpack("H*", $image); close IMG; my $sth = $dbh->prepare("INSERT INTO pics (TITLE, HEX_PIC) VALUES (?, ?)")or die "$DBI::errstr\n"; $sth->bind_param( 1, 'pic1'); $sth->bind_param( 2, $hex, SQL_LONGVARCHAR); $sth->execute();