[prev in list] [next in list] [prev in thread] [next in thread]
List: msqlperl
Subject: Re: $sth->{NAME} contains only the first field name
From: Michael Bletzinger <Michael.Bletzinger () ssa ! crane ! navy ! mil>
Date: 1997-09-09 16:29:29
[Download RAW message or body]
Nem W Schlecht wrote:
>
> Michael Bletzinger e-mailed me on Tue Sep 9 13:00:21 1997
> (Re: "Re: $sth->{NAME} contains only the first field name")
> >
> >> I'm not sure if this is the problem, but it won't cost you much to try it!
> >> > out "Name ", @$Name_p,p;
> >
> >It was a good idea but I could not get it to work. The only compilable
> >version was
> >
> > $Name_p = \$sth1->{NAME};
> ^^ this returns a referenc. to a reference.
>
> > out "Name ", @$$Name_p,p;
> ^^ (see above) that's why you have to de-ref. twice here.
>
> The DBD::mSQL and DBD::mysql docs will be fixed in the next release. This
> is the best way if you want the column names from your select:
>
> @names = @{$sth->{NAME}};
>
> --
> Nem W Schlecht nem@plains.nodak.edu
> NDUS UNIX SysAdmin http://www.nodak.edu/~nem
> "Perl did the magic. I just waved the wand."
Okay,
Thanks for pointing me to the right perldoc. The original statement
and your version work if I execute the private _ListFields function as
described in the DBD::mSQL perldoc.
$ref = $dbh->func( 'pcr', '_ListFields' );
Neither of them work if I do the following select.
$sth1 = $dbh->prepare( q{
SELECT *
FROM pcr
}) || croak $dbh->errstr;
$sth1->execute || croak $sth->errstr;
My understanding is that I need to stick to the DBI way of doing things
for portability. Is my select statement wrong?
Thanks
Michael
--
Phone (voice): (812)854-1101 (fax): (812)854-3437
E-Mail: Michael.Bletzinger@ssa.crane.navy.mil
NWSC Crane WPO E-Mail: MEB709
----------------------------------------------------------------------
To unsubscribe from this list send a message containing "unsubscribe"
to msqlperl-request@franz.ww.tu-berlin.de
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic