SPUG: insert Clob problems

Colin Meyer cmeyer at helvella.org
Wed Sep 12 15:05:31 CDT 2001


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.


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/





More information about the spug-list mailing list