I use the oracle driver to retrieve data from my database.  You should download and 
install it along with DBI.
#!/usr/local/bin/perl
use strict;
use DBI;


my $statement = "SELECT * from table";
my $dbh = DBI->connect('dbi:Oracle:host=hostname;sid=mysid','username','password') or 
die "could not co
nnect to database: ".DBI->errstr;
my $sth = $dbh->prepare($statement);
my $rv = $sth->execute;
while (my @row = $sth->fetchrow_array) {
   print "@row\n";
}
my $rc = $dbh->disconnect;

-----Original Message-----
From: Paresh Kakrecha [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 3:14 PM
To: [EMAIL PROTECTED]
Subject: Problem in fetching CLOB data using perl DBI


Hi ,

I have perl script to fetch CLOB data from oracle table

Table structure is

ID   number ( 5)
long_field   clob



  Perl code :

#!/usr/local/bin/perl5
use DBI qw(:sql_types);

$dbh= DBI->connect ( ..... );

  $dbh->{LongReadLen}=512*1024;

  $sql="select * from table";

  $sth = $dbh->prepare($sql);

    $sth->execute();

    while ( ($id , $edi_data ) = $sth->fetchrow ) {

     print "id=$id\n";
     print "data=$edi_data\n";

   }

     When I try to fetch data I get error like

ORA-03115: unsupported network datatype or representation (DBD: odescr failed)

Can anyone suggest why I am geting this error and what is the resolution.

thanks
Paresh.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to