]
Web: http:\\ldsa.sbcld.sbc.com
-Original Message-
From: Wieland Pusch [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 08, 2004 3:17 AM
To: CAMPBELL, BRIAN D (BRIAN)
Cc: NIPP, SCOTT V (SBCSI); dbi-users@perl.org
Subject: Re: Large SQL statements...
Hallo BRIAN,
I like your
08, 2004 3:17 AM
To: CAMPBELL, BRIAN D (BRIAN)
Cc: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]
Subject: Re: Large SQL statements...
Hallo BRIAN,
I like your solution with foreach and bind_param. Just add the prepare
like this:
$sth = $dbh->prepare("INSERT INTO AllMid_Data VALUES(?&quo
Hallo BRIAN,
I like your solution with foreach and bind_param. Just add the prepare
like this:
$sth = $dbh->prepare("INSERT INTO AllMid_Data VALUES(?".(",?" x 21).")")
or print "Error with INSERT _prepare_ $DBI::errstr\n";
Tuesday, September 7, 2004, 9:31:15 PM, you wrote:
CBDB> This should work
Sorry about this. My groupwise client has a nasty habit of
taking all my formatting out. If you like I can send an attachment
to you. Just let me know.-Ian
>>>Ian Harisay <[EMAIL PROTECTED]> 09/07 8:33 am >>>
A good approach is to to define your dataset. You are just
using a CSV
A good approach is to to define your dataset. You are just
using a CSV so I would do the following: 1) load CSV record into a
data structure (hashes are great for this).2) insert record into table
by way of a generic loader method. -- code snippet --use strict;use
Text::CSV; #-- I us
NIPP, SCOTT V (SBCSI) wrote:
I have a table with 22 columns, and my INSERT on this table is
actually putting in data to possibly all 22 fields. My question is, is
there a better way to write this INSERT? Here's what I have:
while ($line = ) {
$csv->parse($line);
@data = $csv->fields;
$
-Original Message-
$sth->execute(undef,$data[0],$data[1],$data[2],$data[3],$data[4],$data[5
],$dat
a[6],$data[7],$data[8],$data[9],$data[10],$data[11],$data[12],$data[13],
$data[14
],$data[15],$data[16],$data[17],$data[18],$data[19],$data[20]) or print
"Error with
INSERT _execute_: $DBI
why wouldn't
prepare("insert into ... values (null, ?, ?, ?, ...")
$sth->execute(@data);
work?
On Sep 7, NIPP, SCOTT V (SBCSI) scribed:
> I have a table with 22 columns, and my INSERT on this table is
> actually putting in data to possibly all 22 fields. My question is, is
> there a better
Use an array of bind vars.
-
Ron Reidy
Lead DBA
Array BioPharma, Inc.
-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 07, 2004 2:04 PM
To: [EMAIL PROTECTED]
Subject: Large SQL statements...
I have a table with 22