in reply to Re: Re: Re: Oracle BLOBs DBD::Oracle
in thread Oracle BLOBs DBD::Oracle

Still not working. Do you have a working example I could see?

Code now looks like and gets can't call bind_param on an undefined value but I don't know what it's on about.

# 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); my $sth = $dbh->prepare ("update ssi_pri_photos set recorded = sysdate +, recorded_by = 'David', photograph = ? where number = $id"); $sth->bind_param(1, $blob, {ora_type => ORA_BLOB, ora_field => 'photog +raph'});

I've tried putting in 113 for ORA_BLOB too but that didn't make any difference.

Any ideas?

Thanks,
David

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Oracle BLOBs DBD::Oracle
by perrin (Chancellor) on Apr 09, 2003 at 22:28 UTC
    There are complete working examples in the test suite that comes with DBD::Oracle. Take a look at this one.

    The error you're getting is because your call to $dbh->prepare failed. You aren't checking the return value.

      Cheers, I'll check that out.

      (Yep on the second point. It failed because some gonzo changed permissions and didn't tell me and I'd missed the error check out).

      Thanks for your help.
      David