MySQL Forums
Forum List  »  Perl

Re: How to get column names
Posted by: Michael Rizzuto
Date: November 05, 2007 08:10PM

my $table = 'name';
my $sth = $dbh->prepare("SELECT * FROM $table WHERE 1=0;");
my @cols = @{$sth->{NAME}}; # or NAME_lc if needed
foreach ( @cols ) {
printf( "Note: col : %s\n", $_ );

Options: ReplyQuote

Written By
June 19, 2007 04:29AM
Re: How to get column names
November 05, 2007 08:10PM
July 07, 2008 06:46PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.