tomgracey has asked for the wisdom of the Perl Monks concerning the following question:
I'm sure this is a pretty easy one, but I've spent a long time searching on the internet and still haven't resolved the problem.
I am trying to extract the lengths of the fields from a mysql table using DBI. Based on the documentation I read I wrote this code:
If I substitute NAME for SCALE then I get an array of column names as expected. However, using SCALE I just get an array full of zeros. I wonder what the problem with this is? Also, is there a better way of doing this?$sth=$dbh->prepare('SELECT * FROM userReports WHERE 1=0'); $sth->execute(); my $flh=$sth->{SCALE}; my @lengths=@{$flh}; print "@lengths";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: field lengths of database tables
by dbwiz (Curate) on Apr 20, 2005 at 07:33 UTC | |
Thanks! - Re to field lengths of database tables
by polettix (Vicar) on Apr 20, 2005 at 14:51 UTC | |
Re: field lengths of database tables
by Anonymous Monk on Apr 20, 2005 at 07:50 UTC | |
by tomgracey (Scribe) on Apr 20, 2005 at 08:29 UTC | |
Re: field lengths of database tables
by kgraff (Monk) on Apr 20, 2005 at 19:40 UTC |
Back to
Seekers of Perl Wisdom