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]})"); };
In reply to Re^2: perl mysql - INSERT INTO, 157 columns
by Tux
in thread perl mysql - INSERT INTO, 157 columns
by ler224
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |