On Thu, May 16, 2002 at 03:55:29PM -0500, Kevin O wrote:
> My problem is, I have 500 fields. I know I can start the Insert statement
> like INSERT INTO mytable VALUES - cause I'm inserting a value for every
> field in the database, but do I have to type a "?" for all 500 fields?
> BTW, I'm ju
On Thu, 2002-05-16 at 16:55, Kevin O wrote:
> Hello all,
>
> I need to insert a lot of data into a mysql table. Know that I can do it
> like this example:
>
>
>
> my $sth = $dbh->prepare(q{
> INSERT INTO sales (product_code, qty, price) VALUES (?, ?, ?)
> }) or die $dbh->errstr;
> w
> > From: Kevin O[SMTP:[EMAIL PROTECTED]]
>
> Hello all,
>
> I need to insert a lot of data into a mysql table. Know that I can
> do it
> like this example:
>
>
>
> my $sth = $dbh->prepare(q{
> INSERT INTO sales (product_code, qty, price) VALUES (?, ?, ?)
> }) or die $dbh->errst
On Thursday, May 16, 2002, at 01:55 PM, Kevin O wrote:
> Hello all,
>
> I need to insert a lot of data into a mysql table. Know that I can do it
> like this example:
>
>
>
> my $sth = $dbh->prepare(q{
>INSERT INTO sales (product_code, qty, price) VALUES (?, ?, ?)
> }) or die $dbh->errstr
> > From: Kevin O[SMTP:[EMAIL PROTECTED]]
>
> Hello all,
>
> I need to insert a lot of data into a mysql table. Know that I can
> do it
> like this example:
>
> my $sth = $dbh->prepare(q{
> INSERT INTO sales (product_code, qty, price) VALUES (?, ?, ?)
> }) or die $dbh->errstr;
>
I would first suggest taking another look at your table design.
Having 500 columns in a table is most likely not a thing you
really want to do.
But if you must, then yes you will have to put in 500 ?'s into
your prepare.
-
Frank Wiles <[EMAIL
Hello all,
I need to insert a lot of data into a mysql table. Know that I can do it
like this example:
my $sth = $dbh->prepare(q{
INSERT INTO sales (product_code, qty, price) VALUES (?, ?, ?)
}) or die $dbh->errstr;
while (<>) {
chomp;
my ($product_code, $qty, $price) =