in reply to Getting Column Names from DBI?

Try doing the following immediately after execute():
my $names = $sth->{'NAME'}; my $numFields = $sth->{'NUM_OF_FIELDS'}; for (my $i = 0; $i < $numFields; $i++) { printf("%s%s", $$names[$i], $i ? "," : ""); }
NAME and NUM_OF_FIELDS are magic attributes of a statement handle that are supported by many DBDs.