Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: perl dbi - no column headings

by lachoy (Parson)
on Jul 09, 2003 at 16:34 UTC ( #272729=note: print w/replies, xml ) Need Help??


in reply to perl dbi - no column headings

You need to grab the column names manually:

my $sth = $dbh->prepare($sql); $sth->execute() || die $sth->errstr; my $columns = $sth->{NAME}; print IN join( "\t", @{ $columns } ), "\n"; while ( my @row = $sth->fetchrow_array ) { print IN join("\t", @row), "\n"; }

Chris
M-x auto-bs-mode

Replies are listed 'Best First'.
Re: Re: perl dbi - no column headings
by cosmicsoup (Beadle) on Jul 09, 2003 at 18:40 UTC
    Chris,

    Your solution worked perfectly.

    Thanks,
    Louis

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://272729]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2022-05-22 23:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (81 votes). Check out past polls.

    Notices?