Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Oracle CLOB using DBI

Reply
Thread Tools

Oracle CLOB using DBI

 
 
Ken Chesak
Guest
Posts: n/a
 
      06-24-2003
Does someone have a working code sample of Perl/DBI returning a CLOB
column from Oracle. Here is what I came up with, I counld not get
ORA_CLOB to work.

$sth1 = $dbh->prepare(q{
BEGIN OPEN :cursor FOR
SELECT dbms_lob.substr( comments, 30000, 1)
FROM comments WHERE id_comment = 46;
END;
});

$sth1->bind_param_inout(":cursor", \$sth2, 30000, { ora_type
=> ORA_RS
ET } );
$sth1->execute();

while ( @row = $sth2->fetchrow ) {
print "row = @row\n";
}

Thanks
 
Reply With Quote
 
 
 
 
Ron Reidy
Guest
Posts: n/a
 
      06-25-2003
What error (if any) are you getting? Did you 'perldoc DBD::Oracle' and
look at the section entitled 'Handling LOBS'? Did you set
LongReadLen/LongTruncOK on the $dbh?

--
Ron Reidy
Oracle DBA

Ken Chesak wrote:
> Does someone have a working code sample of Perl/DBI returning a CLOB
> column from Oracle. Here is what I came up with, I counld not get
> ORA_CLOB to work.
>
> $sth1 = $dbh->prepare(q{
> BEGIN OPEN :cursor FOR
> SELECT dbms_lob.substr( comments, 30000, 1)
> FROM comments WHERE id_comment = 46;
> END;
> });
>
> $sth1->bind_param_inout(":cursor", \$sth2, 30000, { ora_type
> => ORA_RS
> ET } );
> $sth1->execute();
>
> while ( @row = $sth2->fetchrow ) {
> print "row = @row\n";
> }
>
> Thanks



--
Ron Reidy
Oracle DBA

 
Reply With Quote
 
 
 
 
Markus Stueker
Guest
Posts: n/a
 
      06-25-2003
On 24 Jun 2003 13:55:40 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (Ken Chesak)
wrote:

>Does someone have a working code sample of Perl/DBI returning a CLOB
>column from Oracle. Here is what I came up with, I counld not get
>ORA_CLOB to work.
>
>$sth1 = $dbh->prepare(q{
> BEGIN OPEN :cursor FOR
> SELECT dbms_lob.substr( comments, 30000, 1)
> FROM comments WHERE id_comment = 46;
> END;
> });
>
> $sth1->bind_param_inout(":cursor", \$sth2, 30000, { ora_type
>=> ORA_RS
>ET } );
> $sth1->execute();
>
> while ( @row = $sth2->fetchrow ) {
> print "row = @row\n";
> }
>
>Thanks


 
Reply With Quote
 
Ron Reidy
Guest
Posts: n/a
 
      06-26-2003
From metalink Note 19792.1:

Error: ORA 3115

Text: unsupported network datatype or representation

-------------------------------------------------------------------------------

Cause: A user bind or define, or an Oracle function, is not supported by
this

heterogeneous SQL*Net connection.

Action: Upgrade the older version of Oracle and try again.

Do you have an old Oracle install on the machine the code is running on?
If so, this is your problem.

--
Ron Reidy
Oracle DBA

Ken Chesak wrote:
> Would you email my hotmail account again, I delete by mistake since
> 99% is junk mail.
>
> I get the following error,
>
> DBD::Oracle::db prepare failed: ORA-03115: unsupported network
> datatype or repre
> sentation (DBD: odescr failed) at clob.pl line 26.
>
> It runs if I use dbms_lob.substr( comments, 30000, 1).
>
> $dbh->{LongReadLen} = 512 * 1024 ;
> $dbh->{LongTruncOk} = 1;
>
> $sth1 = $dbh->prepare(q{
> SELECT cd_type, comments
> FROM comments WHERE id_comment = 53
> });
>
> $sth1->execute();
>
> while ( ($name, $data) = $sth1->fetchrow_array ) {
>
> print "row = $name $data \n";
>
> }



--
Ron Reidy
Oracle DBA

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CLOB issue with JDBC, IBATIS and Oracle 10g kartechy@googlemail.com Java 1 09-21-2007 11:06 AM
Want to send CLOB/CLOB to Oracle AQ from Java brian.vanheesch@gmail.com Java 0 02-15-2006 09:22 AM
install_driver(Oracle) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified procedure could not be found at C:/Perl/lib/DynaLoader.pm line 230. Feyruz Perl Misc 4 10-14-2005 06:47 PM
Oracle CLOB column =?Utf-8?B?RGlmZmlkZW50?= ASP .Net 0 06-07-2005 02:42 PM
DBI and DBI::Oracle packages configuration ulloa Perl 1 07-22-2004 05:52 PM



Advertisments