in reply to perl dbi - no column headings
TMTOWTDI. This strikes me as an OK time to use SELECT *:
# Use LIMIT 1 to keep the database from working # too hard my $sql = q(SELECT * FROM table LIMIT 1); my $sth = $dbh->prepare($sql) or die . . . ; $sth->execute(); my @col_names = keys %{ $sth->fetchrow_hashref }; $sth->finish();
There are most certainly better ways, though.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: perl dbi - no column headings
by mpeppler (Vicar) on Jul 09, 2003 at 17:12 UTC | |
|
Re: Re: perl dbi - no column headings
by cchampion (Curate) on Jul 09, 2003 at 16:46 UTC | |
by hardburn (Abbot) on Jul 09, 2003 at 16:51 UTC | |
by cchampion (Curate) on Jul 09, 2003 at 17:14 UTC |