in reply to Getting Column Names from DBI?
NAME and NUM_OF_FIELDS are magic attributes of a statement handle that are supported by many DBDs.my $names = $sth->{'NAME'}; my $numFields = $sth->{'NUM_OF_FIELDS'}; for (my $i = 0; $i < $numFields; $i++) { printf("%s%s", $$names[$i], $i ? "," : ""); }
|
|---|