Fixed Was-RE: SPUG: insert Clob problems

Brittingham, John john.brittingham at attws.com
Wed Sep 12 16:09:44 CDT 2001


Thanks for the assistance both issues are fixed and was mostly due to my
misinterpreting the examples I was working from.

-----Original Message-----
From: Colin Meyer [mailto:cmeyer at helvella.org]
Sent: Wednesday, September 12, 2001 1:06 PM
To: Brittingham, John
Cc: dbi-users at perl.org; spug-list at pm.org
Subject: Re: SPUG: insert Clob problems


Hi, John,

On Wed, Sep 12, 2001 at 12:20:33PM -0700, Brittingham, John wrote:
> I get the following error when I try to insert a CLOB using DBI: Not a
CODE
> reference at extract_ccml__to_oracle_db_testing.pl line 381, <FILE_NAMES>
> line 1. What am I doing wrong?
> 
> 380 $sth = $dbh->prepare(qq{INSERT INTO t_opr_instr (
> TITLE,DSCR,ORDER_SEQ,PRD_MODEL_SPEC_ITEM_ID ) VALUES (?, ?, ?, ?) });
> 381 $sth->( 1, $subproc_heading[$n]);
> 382 $sth->( 2, $dscr, SQL_LONGVARCHAR);
> 383 $sth->( 3, $ord_seq);
> 384 $sth->( 4, $prd_model_spec_item_id);
> 385 $sth->execute ; 

You want to use the bind_param() method of the statement handle:

$sth->bind_param(1, $subproc_heading[$n]);       
# ...

If you are interested in learning a lot about DBI programming, then
you may be interested in my course, Database Programming with Perl:
http://www.consultix-inc.com/dbi.html

hth,
-C.


More information about the spug-list mailing list