OK, here is it. It's a bit mixed up as I've been trying different things.

Getting the impression this doesn't work though, despite what the documentation says.

# perform the connection using the Oracle driver my $dbh = DBI->connect("dbi:Oracle:$database", "$username", "$password +", { PrintError => 0, RaiseError => 0 }) or die "Can't connect to the database: $DBI::errstr\n"; print "INFO: connected to $database OK, updating picture_table with $p +hoto\n"; # prepare update statement print "INFO: reading $photo to blob\n"; open (BLOB, "<$photo") or die "Can't open $photo: $!"; binmode BLOB; { local($/) = undef; $blob = <BLOB>; } close (BLOB); $quotedblob = $dbh->quote($blob); # THIS ALL WORKS BAR THE BLOB UPLOAD...!!!! #my $sth = $dbh->prepare ("update ssi_pri_photos set recorded = sysdat +e, recorded_by = 'David', photograph = '$blob' where person_number = +'$person_id'"); #my $sth = $dbh->prepare ("select recorded_by from ssi_pri_photos"); my $sth = $dbh->prepare ("update ssi_pri_photos set recorded = sysdate +, recorded_by = 'David', photograph = ? where person_number = $person +_id"); $sth->bind_param(1, $quotedblob, SQL_LONGVARBINARY); # execute the statement in the database $sth->execute or die "Can't execute SQL statement: $DBI::errstr\n";

Thanks to everyone for the suggestions so far, by the way.

Thanks,
David


In reply to Re: Re: Oracle BLOBs DBD::Oracle by PerliKnight
in thread Oracle BLOBs DBD::Oracle by PerliKnight

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.