Column headings question

"Louis Proyect" <[email protected]> Wed, 7 Oct 2009 11:39:55 -0400
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <2690DBBEF4364D45B0E834208CDD712E0300B2BB@CUIT-EXCHANGE2.ais.columbia.edu>
Is there an easier way to access column headings than this:

@res=$dbh->ct_sql("exec stored_procedure");

@res2=$dbh->ct_sql("sp_help table_name"); ---> this is the table that
maps to the stored procedure results

$cntr = 0;

foreach $row (@res2)   # Loop through each row
{
  print "@$row[0]: ";
  print "$res[0][$cntr]\n";
  $cntr++;
}

Most importantly, this only works if the stored procedure is returning
results that map to a single table. If the results are from joined
tables, you are out of luck.