Dear fellow monks, The title says it all : I can't get my script to write or read to/from a CLOB field in an Oracle table.
I followed the various examples from the documentation (using my table instead) and I keep getting again and again:
Can't locate object method "ora_lob_read" via package "DBI::db" at ./t +estoracl.pl line 81.
or
Can't locate object method "ora_lob_write" via package "DBI::db" at ./ +testoracl.pl line 68.

I even looked into the DBD::Oracle.pm file, and yes, the methods are there!

The versions are : Does anyone understand what I am missing?

#!/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, $passw +d) 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; }

In reply to Oracle bites me again... by wazoox

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.