RE: Oracle and BLOBs

RE: Oracle and BLOBs

am 24.11.2005 05:52:44 von ron

On Thu, 24 Nov 2005 13:55:48 +1100, Steve Baldwin wrote:

Hi Steve

That's good to know. I won't use that, though, in V 1.00. Here's the context
(pinched from the Postgres driver):

if ($sth->fetchrow_array() )
{
_run_sql($dbh, 'update ' . $self -> table_name() . ' set a_session=? where
id=?', $datastr, $sid) or return $self -> set_error("store(): serialize to db
failed " . $dbh->errstr() );
}
else
{
_run_sql($dbh, 'insert into ' . $self -> table_name() . ' (a_session, id)
values(?, ?)', $datastr, $sid) or return $self -> set_error("store():
serialize to db failed " . $dbh->errstr() );
}

and

sub _run_sql
{
my($dbh, $sql, $datastr, $sid) = @_;
eval
{
my($sth) = $dbh -> prepare($sql) or return 0;
$sth -> bind_param(1, $datastr) or return 0;
$sth -> bind_param(2, $sid) or return 0;
$sth -> execute() or return 0;
};
return 0 if $@;
return 1;
} # End of _run_sql.
--
Ron Savage
ron@savage.net.au
http://savage.net.au/index.html