> > 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;
> while (<>) {
> chomp;
> my ($product_code, $qty, $price) = split /,/;
> $sth->execute($product_code, $qty, $price) or die $dbh->errstr;
> }
> $dbh->commit or die $dbh->errstr;
>
Have a look here for some examples.
http://www.dbmaker.com/reference/technotes/perl.html
It would be nice to see the data that you are doing this with. The Perl
DBI allows you to iterate ove a range off values and what you
effectively do is execute a singel SQL statement for each set of values
so not yiou do not need to have 500 ? . The perl DBI has various
methods to this see the examples in the link above.
Harry
__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]