in reply to Re: perl mysql - INSERT INTO, 157 columns
in thread perl mysql - INSERT INTO, 157 columns
describe is not present in all databases :(
More portable would be:
my $sth = $dbh->prepare ("select * from foo"); $sth->execute; my @fld = @{$sth->{NAME}}; $sth->finish; $sth = do { local $" = ","; $dbh->prepare ("insert into foo (@fld) values (@{[('?') x scalar @ +fld]})"); };
Enjoy, Have FUN! H.Merijn
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: perl mysql - INSERT INTO, 157 columns
by graff (Chancellor) on May 02, 2014 at 16:52 UTC | |
by choroba (Cardinal) on May 02, 2014 at 17:03 UTC | |
by gsiems (Deacon) on May 02, 2014 at 18:17 UTC | |
Re^3: perl mysql - INSERT INTO, 157 columns
by erix (Prior) on May 02, 2014 at 12:53 UTC | |
by Tux (Canon) on May 02, 2014 at 14:57 UTC | |
by erix (Prior) on May 02, 2014 at 19:25 UTC | |
by Tux (Canon) on May 03, 2014 at 12:52 UTC |
In Section
Seekers of Perl Wisdom