Maybe I'm missing something - this seems too easy, but in your
statement:

  my $result_ins = $insert_cr ->execute() || print "Insert into CRR table
  failed!!\n";

you have a space before the "->execute()" - try removing the space,
and make it look like:

  my $result_ins = $insert_cr->execute()
     || print "Insert into CRR table failed!!\n";

One other thing I noticed - shouldn't make a difference, but why
not put the "where" value as a placeholder as well, like:

  my $insert_cr = $dbh->prepare("
     UPDATE crr
     SET crr_print_image = ?
     WHERE crr_id = ?
  ");

  my $cr = "A string";

  $insert_cr->bind_param(1, $cr, {ora_type => ORA_CLOB});
  $insert_cr->bind_param(2, '218936');

  my $result_ins = $insert_cr->execute()
     || print "Insert into CRR table failed!!\n";


Other than that, I can't really see anything else wrong.

What versions of Perl, DBI, DBD::Oracle are you using, and what
version of Oracle?

HTH.

-- 
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com

Becka Louden [[EMAIL PROTECTED]] wrote:
> I did give that a try, before.  Unfortunately, I get the same error.
> 
> 
> >From: "Sterin, Ilya" <[EMAIL PROTECTED]>
> >To: 'Becka Louden ' <[EMAIL PROTECTED]>, "'[EMAIL PROTECTED] '"  
> ><[EMAIL PROTECTED]>
> >Subject: RE: inserting into CLOB field
> >Date: Thu, 15 Nov 2001 14:07:40 -0700
> >
> >How about
> >
> >$insert_cr->bind_param(1, $cr);
> >
> >Ilya
> >
> >
> >
> >-----Original Message-----
> >From: Becka Louden
> >To: [EMAIL PROTECTED]
> >Sent: 11/15/01 2:00 PM
> >Subject: inserting into CLOB field
> >
> >Hi, I am new to this newsgroup, so I hope this is not a bad question.
> >
> >I trying to use the Perl::DBI to insert a string value into the Oracle
> >database.  However, I get this error : "ORA-01461: can bind a LONG value
> >
> >only for insert into a LONG column (DBD: oexec error) at query_crr.pl
> >line
> >98."
> >Here are the pertinent parts of the script:
> >
> >use strict; use DBI; use DBD::Oracle qw(:ora_types);
> >
> >my $insert_cr =$dbh->prepare("UPDATE crr set crr_print_image = ? WHERE
> >crr_id = 218936");
> >
> >my $cr = "A string";
> >
> >$insert_cr->bind_param(1, $cr, {ora_type => ORA_CLOB});
> >
> >my $result_ins = $insert_cr ->execute() || print "Insert into CRR table
> >failed!!\n";
> >
> >if(!defined($result_ins)) {
> >print "Insert into CRR table failed!!\n";
> >} else {
> >print "Insert into CRR table result: $result_ins\n";
> >}
> >
> >The execute fails, and the script prints "Insert into CRR table failed!!
> >Insert into CRR table result: 1".
> >
> >I have also tried to use:
> >$insert_cr->bind_param(1, $cr, SQL_WLONGVARCHAR); (with :sql_types- same
> >
> >error)
> >and
> >$insert_cr->bind_param(1, $cr, -9112); #this one errors out saying it is
> >not
> >fully supported.
> >
> >Can anyone recommend a way to write a string into a CLOB field through
> >Perl,
> >or tell me what I did wrong?
> >
> >Thanks!!
> >Becka Louden
> >Collect America
> >
> >
> >_________________________________________________________________
> >Get your FREE download of MSN Explorer at
> >http://explorer.msn.com/intl.asp
> 
> 
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

Reply via email to