On Wed, 18 Sep 2002 12:24:52 -0500 [EMAIL PROTECTED] wrote:

> I am using the following code to update a BLOB field into 
> our Oracle database: 
> 
> $sql = "UPDATE CMSDOCUMENT SET CONTENT=? WHERE CMSDOCUMENTID=$cmsid";
> $sth = $oradbh->prepare($sql);
> $sth->bind_param(1, $html, {ora_type => ORA_BLOB});
> $sth->execute() or die "update of topic content failed.\n";
> 
> This code works for small size saves.  However, when value 
> of $html  gets large, the code just hungs.  

Add <$oradbh->trace( 4, "trace.file" );> before the prepare() so you can
see what DBI thinks is happening.

If you don't have them, add '-w' to the '#!' line and <use strict;> to the
top of your program.  They help you catch errors before they get too big to
find.

The error message in the 'or die' after execute() doesn't tell you what the
problem was.  $DBI::errstr in the message would do that for you.

You aren't checking for errors from prepare().  Either add an 'or' clause
like the execute() or set $oradbh->{RaiseError} to 1.

Is there a reason you are pasting $cmsid into the SQL?  If you execute this
more than once or from more than one process, Oracle has to replan it every
time.  A placeholder would prevent that.

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.

Reply via email to