Can't locate object method "ora_lob_read" via package "DBI::db" at ./testoracl.pl line 81.
####
Can't locate object method "ora_lob_write" via package "DBI::db" at ./testoracl.pl line 68.
####
#!/usr/bin/perl -w
use strict;
use DBI;
use DBD::Oracle qw(:ora_types);
my $host="10.1.31.207";
my $sid="ora9i";
my $user="iq";
my $passwd="iq";
$ENV{NLS_LANG}='french_france.WE8ISO8859P15';
my $dbh = DBI->connect("dbi:Oracle:host=$host;sid=$sid", $user, $passwd) or die "aaaaargh: $!";
# JOB_MESSAGE is the only CLOB field in this table
my $request="SELECT JOB_MESSAGE FROM JOBS WHERE JOB_ID='1' FOR UPDATE";
my $sth = $dbh->prepare($request, { ora_auto_lob => 0 } );
$sth->execute() or die "aaaaargh: $!";
my ($jmess)=$sth->fetchrow_array();
my $offset = 1; # Offsets start at 1, not 0
my $chunk_size=4096;
my $message="1 אחיט אחיט אחיט אחיט אחיט אחיט אחיט אחיט אחיט אחיט אחיט \n";
# this one fails...
$dbh->ora_lob_write( $jmess, $offset, $message );
$request="SELECT JOB_MESSAGE FROM JOBS WHERE JOB_ID='1' ";
$sth=$dbh->prepare($request, { ora_auto_lob => 0 });
$sth->execute() or die "ooooooouch:$!";
($jmess)=$sth->fetchrow_array();
print "JMESS $jmess\n";
# this one too...
while (my $data=$dbh->ora_lob_read( $jmess, $offset, 4 )) {
print $data;
$offset+=4;
}