Loading ...
Sorry, an error occurred while loading the content.
 

Re: [PBML] column headers in sql query in perl script

Expand Messages
  • merlyn@stonehenge.com
    ... Ankur I am having a perl script which outputs the table data from sybase db Ankur in the output.csv file using sql query ... Are you using DBI? If so,
    Message 1 of 2 , Oct 10, 2008
      >>>>> "Ankur" == Ankur <ankurzvohra@...> writes:

      Ankur> I am having a perl script which outputs the table data from sybase db
      Ankur> in the output.csv file using sql query ...

      Are you using DBI?

      If so, you can call $sth->{NAME} to get an arrayref of the names of your
      columns after the query has been executed. There's an example on
      the DBI manpage:

      print "First column name: $sth->{NAME}->[0]\n";

      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
      See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
    Your message has been successfully submitted and would be delivered to recipients shortly.