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

Hi,

I'm trying to insert into a CLOB field as follows

$sql = "INSERT INTO my_table NAMES (clob_field) VALUES (?) "; $sth = $db->prepare($sql); ### err checking $sth->bind_param(1, $clob_val,{"ora_type", ORA_CLOB}); $sth->execute(); ### err checking $db->commit();
when I check in the db only part of the text is
getting inserted, and obviously when I try to fetch it
I don't get the full text, I'm just wondering how I can
insert the full text or when fetching how to fetch the
locator and what to do with it to fetch the full text.
(btw. when fetching I set LongReadLen to large val and
LongtuncOk = 1)

cheers,
Ronan

Replies are listed 'Best First'.
Re: Insert and selecting CLOB's
by blakem (Monsignor) on Sep 13, 2001 at 11:05 UTC
    It sounds like you might already be doing this, but here is the code I used to get around a similiar CLOB issue...
    my $dbh = DBI->connect("DBI:Oracle:", "$login\@$sid", $pass); die "Couldn't connect to Oracle: $!" unless $dbh; $dbh->{LongReadLen} = 66000; $dbh->{LongTruncOk} = 1;

    -Blake