hello colleagues

i have this snippet of code that works well:
=================
$query = qq(SELECT * FROM smalllabor;);
$sth = $dbh->prepare($query);
$sth->execute() or webdb4::dberr_trap("Unable to get table info");
while(my $row_href = $sth->fetchrow_hashref)
       {
        print "$row_href->{'area'}\n"; ##prints column 'area' for all rows
       }
==================
but now assume for a moment that i dont know the columns in the table so i
cant use  [print "$row_href->{'area'}\n";] anymore (i would not know that
there is a column 'area').

how can i get the column names - what i presume to be the keys to the
hashref? assume that i just want to list the column names.

i tried a few of the usual key listings but no luck.

any help is greatly appreciated.

thank you.
mario

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to