Hi,
Does anyone know how to generate column headers for output based on the SQL.
my $sth = $dbh->prepare("SELECT field1, field2 FROM table1");
$sth->execute;

print $headers ## how would I do this based on the fields returned??

while ( my $rec = $sth->fetchrow_arrayref ){
  print join(", ", @{ $rec } ), $/;
}

Thanks,

Ian

Reply via email to