http://qs321.pair.com?node_id=760835

Samy_rio has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I am getting the DBD::Oracle error while fetching CLOB content with huge content ex. char. length 254806 (appr).
The same code is working fine for fetching CLOB content with some 45043 char. length.
The NLS_LANG is same in both client and server.

$DBD::Oracle::VERSION = '1.17';
$DBI::VERSION = "1.604";

DBD::Oracle::st fetchrow_hashref failed: ORA-03106: fatal two-task com +munication protocol error (DBD ERROR: OCILobRead) [for Statement

I tried to fetch the CLOB content using Java for clarification and its extract correctly.

Please suggest me to resolve this error.
Thanks in advance.

Regards,
Velusamy R.


eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';

Replies are listed 'Best First'.
Re: DBD::Oracle - OCILobRead error
by almut (Canon) on Apr 29, 2009 at 10:19 UTC

    I've encountered similar problems when LongReadLen was set too small...

      I assigned the LongReadLen value like below and also i got the exact length, eventhough i am getting the same error.

      my $new_sql = <<EOS; select <col_name> from <table_name> EOS $dbh->{LongReadLen} = $dbh->selectrow_array(qq{ SELECT dbms_lob.getlength(<col_name>) FROM <table_name> }); print "CLOB Length: ".$dbh->{LongReadLen}; my $sth = $dbh->prepare($new_sql); $sth->execute(); my @rows; while(my $cols = $sth->fetchrow_hashref()) { push(@rows, $cols); } $sth->finish();

      Anything wrong in that?

      Regards,
      Velusamy R.


      eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';

        Just set it to an arbitrarily large value:
        $dbh->{LongReadLen} = 1024*1024; # or even another 1024*4
Re: DBD::Oracle - OCILobRead error
by marto (Cardinal) on Apr 29, 2009 at 10:16 UTC

    The version of DBD::Oracle you are running is from 2006, looking at the list of current Changes file, some work has been done around this area over the years.

    Also, which versions of Perl and Oracle are you working with?

    Hope this helps

    Martin

      currently i am working in x86_64 x86_64 x86_64 GNU/Linux, Kernal: 2.6.9-67.ELsmp

      Perl Version: 5.8.5 built for x86_64-linux-thread-multi Oracle 9i Oracle Client : 9.2.0.1.0

      Updated

      Also i tried these oracle version also

      Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit

      Regards,
      Velusamy R.


      eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';