Two things:
 1) Wolfgang asked that if table "crr" is a synonym, then try
    using the real table name instead
 2) Your DBI and DBD::Oracle versions are not current - this
    shouldn't(?) matter, but if you can I would try upgrading
    those to the recent versions.

      DBI - now at version 1.20
      DBD::Oracle - now at version 1.12

HTH.

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

Becka Louden [[EMAIL PROTECTED]] wrote:
> Well, that was worth trying- taking out the space- but didn't change 
> anything.  The reason I have a hard-coded value in the prepare statement for 
> crr_id is because someone suggested the bind problem might actually be with 
> the id number and not the CLOB value.  I did actually have it just as you 
> have written below, originally.
> 
> At least I'm not missing something obvious!
> Perl version: 5.005
> Oracle version: 8.0.4.3.2
> DBI: 1.13.1
> DBD::Oracle: 1.03
> 
> I really appreciate your help.
> Becka
> 
> >From: Hardy Merrill <[EMAIL PROTECTED]>
> >To: Becka Louden <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED], [EMAIL PROTECTED]
> >Subject: Re: inserting into CLOB field
> >Date: Thu, 15 Nov 2001 16:56:45 -0500
> >
> >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
> 
> 
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

Reply via email to