FryingFinn has asked for the wisdom of the Perl Monks concerning the following question:
results ..my $sth1 = $dbh->prepare("SELECT * FROM $table"); $sth1->execute() or die $DBI::errstr; my $col_names = $sth1->{NAME}; foreach my $column ( @{$col_names}) { my $sth = $dbh->column_info(undef, undef, $table, $column); foreach my $col_info ($sth->fetchrow_hashref) { print " $col_info->{'ORDINAL_POSITION'} $col_info->{'COLU +MN_NAME'} \n"; } }
1 id 1 name 1 start
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI column_info question
by runrig (Abbot) on Mar 20, 2015 at 19:39 UTC | |
by FryingFinn (Beadle) on Mar 26, 2015 at 16:54 UTC | |
|
Re: DBI column_info question
by ww (Archbishop) on Mar 20, 2015 at 19:03 UTC |