Oracle CLOB using DBI

K

Ken Chesak

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
 
R

Ron Reidy

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?
 
M

Markus Stueker

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
 
R

Ron Reidy

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top